How can I write inside an xml file using c# and the xmldocument or xpathnavigator class. I want to write a node inside of three entries. As an example, I want to write a “window” entry a few times..
<tabpage>
<form>
<Window>
<.....>name<...>
<.....>age<.....>
<.....>gender<..>
</Window>
<Window>
<.....>name<...>
<.....>age<.....>
<.....>gender<..>
</Window>
</form>
<tabpage>
you can use something like the following:
obviously you should change the above code snippet to fit to your specific XML you want to generate. you also didn’t provide much information what should be inside a window XML element – do you plan to write XML attributes per window or sub XML elements describing name/age/gender information.
you can see many more examples in MSDN – go to http://msdn.microsoft.com and search from XmlTextWriter.