I'm converting over from using XmlNodes (specifically ConfigXmlNode, but the
API uses XmlNode) to IXPathNavigable in some methods I have, but I'm finding
in the process, that I can't seem to get the attributes. If I have some
XML:
<ApplicationConfiguration Test="Blahblah"
AnotherAttr="asdfasd">
And I have the code:
XPathNavigator navigator = node.CreateNavigator();
XPathNodeIterator child =
navigator.SelectChildren(XPathNodeType.Attribute);
foreach (Object child in
navigator.SelectChildren(XPathNodeType.Attribute))
{
System.Diagnostics.Debug.WriteLine(child.ToString( ));
}
But the child count is always 0. If I change to XPathNodeType.All, I will
enumerate through the child elements, but again, the attributes don't show
up. Is this correct behavior, a bug, or am I misusing IXPathNavigable?