G
Guest
Hi there,
I've got an XML document and I would like to remove any elements that have
certain value, say "TagNotRequired". I tried the following code but it didn't
work. The count of nodes is always 0 instead of the number of nodes with
TagNotRequired value inside. Please help! Thanks!
XmlNode rootNode = doc.DocumentElement;
XmlNodeList nodes = rootNode.SelectNodes("*[*='TagNotRequired']");
foreach(XmlNode node in nodes)
{
rootNode.RemoveChild(node);
}
Cloud
I've got an XML document and I would like to remove any elements that have
certain value, say "TagNotRequired". I tried the following code but it didn't
work. The count of nodes is always 0 instead of the number of nodes with
TagNotRequired value inside. Please help! Thanks!
XmlNode rootNode = doc.DocumentElement;
XmlNodeList nodes = rootNode.SelectNodes("*[*='TagNotRequired']");
foreach(XmlNode node in nodes)
{
rootNode.RemoveChild(node);
}
Cloud