X
xeroxero
I have an XML document with this as a sample fragment:
<?xml version="1.0" encoding="utf-16"?>
<directory path="c:\\test\\directory">
<file name="fileA.doc" />
<file name="fileB.txt" />
</directory>
I would like to iterate over the document, find any element that is
named 'file', and add an attribute 'size' if it doesn't already exist.
Can an XPathNavigator be used for that purpose, and if so how? I am
not sure about which tool to use, since it seems like I'll modify the
collection while it's in-use.
Thanks.
<?xml version="1.0" encoding="utf-16"?>
<directory path="c:\\test\\directory">
<file name="fileA.doc" />
<file name="fileB.txt" />
</directory>
I would like to iterate over the document, find any element that is
named 'file', and add an attribute 'size' if it doesn't already exist.
Can an XPathNavigator be used for that purpose, and if so how? I am
not sure about which tool to use, since it seems like I'll modify the
collection while it's in-use.
Thanks.