Understanding XML in Web Development
I'm new to web programming, right now, I'm working on on a Web Based Survey Application on which I want to utilize XML.
My Questions are the following:
- Using ASP.NET MVC, how do I return an XML File from the database to the Client?
- Usually, where does an XML file reside o开发者_如何学Gon the Client's directory and how to I locate it using JQuery or JavaScript?
Thanks
A google search lead me to this article which describes the process of sending an XML file (or any file stored in the database) to the client system near the end.
https://web.archive.org/web/20210304133428/https://www.4guysfromrolla.com/articles/120606-1.aspx
When you send an XML file (or any other file sent via the method above) to a client, the user will be prompted and have save it to their hard drive. Once this has occurred, JavaScript will not have access to the file.
In my PHP experience, when you want to give JavaScript data to work with, you output it to a variable declaration somewhere in the script space such that you know where to retrieve and manipulate it. This may be more useful for whatever you're trying to accomplish but it rarely involves XML.
The grander question is what are you trying to do? It sounds like you need to rethink your approach. Just because you have a hammer doesn't mean everything is a nail.
精彩评论