Reputation: 1038
How can we update an xml file without loading it entirely into memory. In the following code I want to navigate through each parent node note and update the value of the to node. How can we achieve this using C#. I have to update the to field based on some other calculation that I have in code.
<note>
<from>Jani</from>
<to>Tove</to>
</note>
<note>
<from>John</from>
<to>Doe</to>
</note>
Upvotes: 2
Views: 2736
Reputation: 63065
you can use XmlReader and XmlWriter. here are some examples.
http://dotnetperls.com/xmlreader, http://dotnetperls.com/xmlwriter
Upvotes: 1