How to append to the middle of a file

monuindia2002

Member
Joined
Jan 26, 2006
Messages
8
Programming Experience
1-3
Hi,
I have an xml file like this

<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>


i want to append a tag between envelope and body tag.
how do i append that.
Can any body help me in this.

Thanks
Mahesh
 

m_ogden

Well-known member
Joined
Mar 3, 2006
Messages
74
Location
New Hampshire
Programming Experience
5-10
here's some pseudo-code for doing that:
xmlDoc as new System.Xml.XmlDocument
xmlDoc.loadXML(<String of XML>)
xmlElem as System.Xml.XmlElement = xmlDoc.CreateElement("NewElemName")
xmlDoc.documentElement.appendChild(xmlElem)
 
Top Bottom