I am uploading xml files containing questionnaire/survey results to my server.
What I need to do is attain some method of allowing the user to manipulate the data from a webpage.
For example, I want to allow the user to be able to click on a page, option Build histogram-> then they choose the variable set from a dropdown list
- or -
The user selects calculate mean -> then selects the question to calculate the mean on.
I hope you see my issue. I need to, for want of a better phrase, read the XML data into a buffer, which a dropdown list can display, to allow the user to choose items to work with.
I'm sure there is a simple method for this I am new to the field however.
Any ideas would be greatly appreciated, im not looking for specific code or anything just a method for doing this. Thanks
On your page load or page init... use the XmlDocument class to open and read in the content, you can then select the nodes you wish to utilize to populate your dropdown list and set it's values that way.
Thanks for the reply, so I need to work with nodes thats fine, is this applicable if I dont know what the nodes are though. For example if I have a file containing the value "Name" thats ok I can use the value that way but what about a file just uploaded by an outside user? Is there a way to pull all header or name values from a file. Once that is done I can use the header/name values to manipulate the data no problem. Its just displaying them all for the user to select.
Well, the short answer is you can really parse an XML file however you want, you can read every element and determine it's name, attributes, values, child nodes, etc etc...
Thing is, if you are going to process it, it really needs to have some sort of "rules" as to what it contains and how it is organized, and the users sending the file will have to adhere to those rules if your application is going to produce anything reliably.
Perhaps if you post a small example of the sort of XML you might expect a user to send, we can give you some hints on how to gather what you want from it?