Hi there,
Using ASP.NET my goal is to modify a xml document using XmlTextReader and XmlTextWriter (performance reasons). While reading a xml document line by line I want to write selective lines to another file.
My problem lies in the fact that XmlTextReader does not allow you to return a single line of xml, only the InnerXml or OuterXml of a node.
For example, consider the following xml
Code:
<animals>
<fish selected="true">
<type>Water</type>
</fish>
<monkey selected="false">
<type>Land</type>
</monkey>
</animals>
Say I want to create a new xml file that contains all of the selected animals (i.e. selected="true") from the above xml. I would write the xml line by line if the elements do not contain attribute selected="false".
Any suggestions on how I can accomplish this?
Thanks!