GetElementsByTagName not finding my nodes

  • Thread starter Thread starter mychevworld
  • Start date Start date
M

mychevworld

I must be missing something, but I'm not seeing it.
This returns a count of 1
XmlNodeList oList = oXml.GetElementsByTagName("Scout");

This returns a count of 0
XmlNodeList oList = oXml.GetElementsByTagName("Scout/Employees");

<Scout>
<Employees>
</Employees>
</Scout>


What am I doing wrong?
 
There is no the "Scout/Employees" tag name in your XML. You have to
write instead:

XmlNodeList oList = oXml.GetElementsByTagName("Employees")

I believe you confused GetElementsByTagName with XmlNode.SelectNodes
which does not exist for CF1.0 (though it exists in .NET CF2.0).

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
 
Back
Top