Need help with xml editing using xmltextwriter

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,<br/>
<br/>
I have an xml file with the below structure:<br/>
<br/>
<Root><br/>
<br/>
<span style="white-space:pre <Node1>Node1Data</Node1><br/>
<br/>
<span style="white-space:pre <Node2>Node2Data</Node2><br/>
<br/>
</Root><br/>
<br/>
The code has been implemented using XmlTextWriter in the base class.<br/>
<br/>
My requirement is to use the overridden method in the child class to open the xml and append some more nodes to get the below structure:<br/>
<br/>
<Root><br/>
<br/>
<span style="white-space:pre <Node1>Node1Data</Node1><br/>
<br/>
<span style="white-space:pre <Node2>Node2Data</Node2><br/>
<br/>
<span style="white-space:pre <Node3>Node3Data</Node3> <br/>
<br/>
</Root><br/>
<br/>
Using a StreamWriter in the XmlTextWriter constructor, I am able to write the
Node3 after the ending Root node and not inside. Kindly help.<br/>
<br/>
Regards,<br/>
<br/>
Asim.
<br/>


View the full article
 
Back
Top