我正在使用.NET 4.0,我想使用XPath 2.0方法,如([Matches()] [1],[upper-case()] [2],[lower-case()] [3])试图在文档中查找元素.
示例XPath: "/MyDocument/MyNode[matches(@MyAttribute, 'MyValue', 'i')]"
我尝试过使用:
System.Xml.XPath.XPathNavigator.Compile()System.Xml.XmlDocument.SelectNodes()System.Xml.Linq.XDocument.SelectElements()但我基本上抛出异常"UndefinedXsltContextException"(或类似的东西).这可以在.NET 4.0中完成,如果是这样,你能提供一个关于如何设置它的小例子吗?
谢谢