|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
remove xml node in xml documenti have the following xml document <root> <item> <key> <scode></scode> </key> <scode></scode> <desc></desc> <pc></pc> </item> <item> <key> <scode></scode> </key> <scode></scode> <desc></desc> <pc></pc> </item> <item> <key> <scode></scode> </key> <scode></scode> <desc></desc> <pc></pc> </item> </root> how do i remove , the second scode node so that the document looks as follows <root> <item> <key> <scode></scode> </key> <desc></desc> <pc></pc> </item> <item> <key> <scode></scode> </key> <desc></desc> <pc></pc> </item> <item> <key> <scode></scode> </key> <desc></desc> <pc></pc> </item> </root> thanks Que Have you used the xmldocument? Put your xml in a file and test with the following code:
Dim xmldoc As New Xml.XmlDocument() Dim nodRoot As Xml.XmlNode xmldoc.Load("c:\test.xml") nodRoot = xmldoc.ChildNodes(0) 'write debug info Debug.WriteLine("ChildNodes count: " & nodRoot.ChildNodes.Count) 'remove the 2nd node nodRoot.RemoveChild(nodRoot.ChildNodes(1)) 'write debug info Debug.WriteLine("ChildNodes count: " & nodRoot.ChildNodes.Count) Also, you can use XPath to find a desired node to further remove. []s Cesar Show quoteHide quote "Que" <aq.maho***@gmail.com> wrote in message news:1147468267.715035.33390@i39g2000cwa.googlegroups.com... > hi > i have the following xml document > <root> > <item> > <key> > <scode></scode> > </key> > <scode></scode> > <desc></desc> > <pc></pc> > </item> > <item> > <key> > <scode></scode> > </key> > <scode></scode> > <desc></desc> > <pc></pc> > </item> > <item> > <key> > <scode></scode> > </key> > <scode></scode> > <desc></desc> > <pc></pc> > </item> > </root> > > how do i remove , the second scode node so that the document looks as > follows > > <root> > <item> > <key> > <scode></scode> > </key> > <desc></desc> > <pc></pc> > </item> > <item> > <key> > <scode></scode> > </key> > <desc></desc> > <pc></pc> > </item> > <item> > <key> > <scode></scode> > </key> > <desc></desc> > <pc></pc> > </item> > </root> > > thanks > Que >
int64 or double
serializing data to a file datatable.import row bug/issue DataGridView and ComboBox Custom List casting Console Application - Exit Code Formating Text in a text box How to copy a form file associatoin with application How to move a control contained within a usercontrol at design time |
|||||||||||||||||||||||