Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am having an XML file containing containing multiple nodes.

But I want to add all the attributes in these nodes to struct so that
I can access it for further use.

How to import XML values to Struct

Can anyone help me to get rid of this problem
Posted
Comments
gggustafson 19-Mar-14 20:26pm    
Why do you need a struct? If you read the XML into an XmlDocument, all of the data is available through XPath without a need to move data from one place to another.

1 solution

Sorry to state the obvious, but:

  • Read the XML data with one of the .NET classes
  • Loop through the nodes extracting the attribute (or other) data items
  • Add the items to your struct, or array, or list etc.
  • Process the resultant data as required
  • Bask in the admiration of your peers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900