Seems like this should be easy, but I’m not finding a simple configuration setting. Basically I have a page that will be parsing xml files that may have some comment tags in them. I’m loading it as an xml doc and looping through a particular node of the document and I’m running into problems because it’s counting the comment as a child node. Any way to tell asp.net not to look at comments other than writing my own check for <!-- ?
Seems like this should be easy, but I’m not finding a simple configuration setting.
Share
If you use XmlNode, then that has a NodeType property. Ignore the nodes where that has a value of “Comment”.
An XNode has the same property.