Allow user to work with XML from c# page
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Allow user to work with XML from c# page

  1. #1
    Join Date
    Jul 2011
    Posts
    9

    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

  2. #2
    Join Date
    May 2011
    Location
    Washington State
    Posts
    220

    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.

  3. #3
    Join Date
    Jul 2011
    Posts
    9

    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.

  4. #4
    Join Date
    May 2011
    Location
    Washington State
    Posts
    220

    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?

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,480

    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
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center