How do I use XPath with a default namespace with no prefix?

后端 未结 6 1462
广开言路
广开言路 2020-12-13 13:16

What is the XPath (in C# API to XDocument.XPathSelectElements(xpath, nsman) if it matters) to query all MyNodes from this document?



        
6条回答
  •  眼角桃花
    2020-12-13 13:36

    Example with Xpath 2.0 + a library :

    using Wmhelp.XPath2;

    doc.XPath2SelectElements("/*:configuration/*:MyNode");

    See :

    XPath and XSLT 2.0 for .NET?

提交回复
热议问题