Closed bbarker closed 6 years ago
Yes, indeed. You first create an XML DOM document, and then run a query over it:
var doc = new DOMParser().parseFromString('<my:test xmlns:my="myns"/>', 'text/xml');
alert($(doc).xpath('//my:test', function(prefix){ if (prefix === "my") return "myns"; return null;}))
Awesome, thanks!
For instance, if you've retrieved an XML document using an XHR and want use XPath to retrieve specific elements, is this possible?