Search code examples
c#xmlselectnodes

Xml Element SelectNodes help required - C#


I am new to XML parsing. If anybody can please explain in simple words that what kind of child nodes will be selected from following statement?

XmlElement.SelectNodes("child::w:r", nsmgr)

Thanks in advance


Solution

  • Your code

    XmlElement.SelectNodes("child::w:r", nsmgr)
    

    Is using this overload of the SelectNodes method. It should return all child nodes (child:: axis) of the current element that have an element name r in a namespace w.

    What that namespace w is, is defined in the namespace manager nsmgr.