AlexFM
asked on
Generate and read XML file
<List>
<Person Age="40">
<FirstName>John</FirstName >
<LastName>Brown</LastName>
<Children>
<Son Age="3">
<Name>Bill</Name>
</Son>
<Son Age="5">
<Name>Jerry</Name>
</Son>
</Children>
</Person>
<Person Age="35">
<FirstName>Tom</FirstName>
<LastName>Robbins</LastNam e>
<Children>
<Son Age="2">
<Name>Michael</Name>
</Son>
<Daughter Age="5">
<Name>Mary</Name>
</Daughter>
</Children>
</Person>
</List>
I need code to generate this XML using XMLDocument and save it to file. Then I need to load file to XMLDocument and enumerate all nodes.
<Person Age="40">
<FirstName>John</FirstName
<LastName>Brown</LastName>
<Children>
<Son Age="3">
<Name>Bill</Name>
</Son>
<Son Age="5">
<Name>Jerry</Name>
</Son>
</Children>
</Person>
<Person Age="35">
<FirstName>Tom</FirstName>
<LastName>Robbins</LastNam
<Children>
<Son Age="2">
<Name>Michael</Name>
</Son>
<Daughter Age="5">
<Name>Mary</Name>
</Daughter>
</Children>
</Person>
</List>
I need code to generate this XML using XMLDocument and save it to file. Then I need to load file to XMLDocument and enumerate all nodes.
ASKER
Thanks, but I want to do this using XMLDocument.
ASKER
Code please :)
Take a look also at other my question: https://www.experts-exchange.com/questions/21789271/Enumerating-XML-child-nodes-2.html
Take a look also at other my question: https://www.experts-exchange.com/questions/21789271/Enumerating-XML-child-nodes-2.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=309
http://www.developer.com/net/net/article.php/1482531