I’m trying to call the XElement.XPathSelectElements() overload that requires an IXmlNamespaceResolver object. Can anyone show me how to get (or make) an IXmlNamespaceResolver? I have a list of the namespaces I want to use in my query
I’m trying to call the XElement.XPathSelectElements() overload that requires an IXmlNamespaceResolver object. Can anyone
Share
You can use an XmlNamespaceManager that implements that interface
Use the constructor which takes an
XmlNameTable, passing into it an instance ofSystem.Xml.NameTablevianew NameTable(). You can then callAddNamespacefunction to add namespaces: