-
July 10th, 2011, 11:24 AM
#1
Allow user to work with XML from c# page
Hi, let me explain what I am trying to do.
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
-
July 12th, 2011, 07:27 PM
#2
Re: Allow user to work with XML from c# page
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.
-
July 15th, 2011, 07:45 AM
#3
Re: Allow user to work with XML from c# page
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.
-
July 15th, 2011, 01:30 PM
#4
Re: Allow user to work with XML from c# page
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?
-
July 17th, 2011, 07:15 AM
#5
Re: Allow user to work with XML from c# page
Why not upload the files and extract the file data into a database (or at least the summary of the data into a database)?
Then have the web site query and manipulate the data in the database.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|