V
Vai2000
Sometimes it works, sometimes it doesn't!! Can someone pinpoint the bug or
alternative way..?
Tx
Input:
<root>
<element name="AC1">
<children name="chd1">
</children>
</element>
<element name="AC2">
<children name="chd2">
</element>
</root>
Output:
<root>
<element name="AC2">
<children name="chd2">
</element>
</root>
CS Code
===============
XmlDocument doc = new XmlDocument();
doc.Load(master);
XmlNode
deleteNode=doc.SelectSingleNode(String.Format("descendant::Item[@name='{0}']
","AC1"));
doc.DocumentElement.RemoveChild(deleteNode);
doc.Save(master);
alternative way..?
Tx
Input:
<root>
<element name="AC1">
<children name="chd1">
</children>
</element>
<element name="AC2">
<children name="chd2">
</element>
</root>
Output:
<root>
<element name="AC2">
<children name="chd2">
</element>
</root>
CS Code
===============
XmlDocument doc = new XmlDocument();
doc.Load(master);
XmlNode
deleteNode=doc.SelectSingleNode(String.Format("descendant::Item[@name='{0}']
","AC1"));
doc.DocumentElement.RemoveChild(deleteNode);
doc.Save(master);