E
e-mid
Here is an xml structure. i want to remove <a> nodes that do not have any
child. How can i do that in csharp?
<root>
<a>
<b/>
</a>
<a/>
<a/>
<a>
<c/>
</a>
</root>
i tried following but it does not work:
xmlNodeList l = xr.getElementsByTagName("a");
foreach(XmlNode n in l)
{
if(n.HasChildNodes == false) xr.RemoveChild(n)
}
child. How can i do that in csharp?
<root>
<a>
<b/>
</a>
<a/>
<a/>
<a>
<c/>
</a>
</root>
i tried following but it does not work:
xmlNodeList l = xr.getElementsByTagName("a");
foreach(XmlNode n in l)
{
if(n.HasChildNodes == false) xr.RemoveChild(n)
}