Recursively parse XmlDOcument
Posted
by user177883
on Stack Overflow
See other posts from Stack Overflow
or by user177883
Published on 2010-03-31T17:51:18Z
Indexed on
2010/03/31
17:53 UTC
Read the original article
Hit count: 232
I have an XML document as follows:
<directory>
<file><monitored>0</monitored>
<xferStatus>1</xferStatus>
<name>test1.txt</name>
<size>7</size>
<created>03/31/10 11:30:02 AM</created>
<modified>03/31/10 11:30:00 AM</modified>
<tPathList><tPath>http://hwcdn.net/p2f4h2b5/cds/testing/test1.txt</tPath>
</tPathList>
<tPath>http://hwcdn.net/p2f4h2b5/cds/testing/test1.txt</tPath>
<oPathList><oPath>http://hwcdn.net/p2f4h2b5/w9m3i4q9/test1.txt</oPath>
</oPathList>
<oPath>http://hwcdn.net/p2f4h2b5/w9m3i4q9/test1.txt</oPath>
<aPath></aPath>
</file>
<file><monitored>0</monitored>
<xferStatus>1</xferStatus>
<name>GenericDAO.cs</name>
<size>1843</size>
<created>03/31/10 11:41:10 AM</created>
<modified>03/31/10 11:41:10 AM</modified>
<tPathList><tPath>http://hwcdn.net/p2f4h2b5/cds/testing/GenericDAO.cs</tPath>
</tPathList>
<tPath>http://hwcdn.net/p2f4h2b5/cds/testing/GenericDAO.cs</tPath>
<oPathList><oPath>http://hwcdn.net/p2f4h2b5/w9m3i4q9/GenericDAO.cs</oPath>
</oPathList>
<oPath>http://hwcdn.net/p2f4h2b5/w9m3i4q9/GenericDAO.cs</oPath>
<aPath></aPath>
</file>
<nEntries>2</nEntries>
</directory>
Well there are two files in the document, how can i recursively or iteratively get the files, sizes, etc..
The response was in string format, and converted to XML as follows :
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.LoadXml(response);
© Stack Overflow or respective owner