// Obtém a tag "tags"
if(xmlDoc.ChildNodes[1].ChildNodes[1].ChildNodes[1].SelectSingleNode("tags") != null)
{
}
I'm running an Xml and on some nodes there is no such tags and error tags.
Does anyone know another way to validate this?
// Obtém a tag "tags"
if(xmlDoc.ChildNodes[1].ChildNodes[1].ChildNodes[1].SelectSingleNode("tags") != null)
{
}
I'm running an Xml and on some nodes there is no such tags and error tags.
Does anyone know another way to validate this?
var node = xmlEnvio.GetElementsByTagName("tag").OfType<XmlNode>();
if (node != null && node.Count() > 0)
{
foreach (XmlNode item in node)
{
if (item["tags"] != null)
{
//Código
}
}
}
I use this form to validate nodes.