How to make xml in C#?
Posted
by kacalapy
on Stack Overflow
See other posts from Stack Overflow
or by kacalapy
Published on 2010-04-28T15:41:15Z
Indexed on
2010/04/28
15:53 UTC
Read the original article
Hit count: 444
i have not worked with XML in a while can someone post the syntax needed to build and save an xml node structure that resembles that of a tree structure that is created by a recursive function.
basically i have a recursive function that saves data found an a page(url) and then follows each URL found on that page recursivley and does the same to it. to audit this i want an output as a xml file to disk so i can see how it is doing its recursion and parsing.
the code i have is below. please add to it the needed xml calls needed to create a xml structure like the one i show below. (please include the full name space so i can see where the objects i need in .net are for this.)
page1.htm has 2 links on it:
<a href=page1_1.htm>
<a href=page1_2.htm>
page1_1.htm has 2 links on it
<a href=page1_1_a.htm> (this then will have some links also)
<a href=page1_1_b.htm> (this then will have no more links on it - dead end)
the xml should do something like this:
<node url=page1.htm>
...<node url=page1_1_a.htm>
...... <node url="xxx.htm"/>
...... <node url="yyy.htm".>
... </node>
...<node url=page1_1_b.htm />
</node>
© Stack Overflow or respective owner