I have an arbitrary XML document provided by a url. I also have xpath-like expressions.
var xml = <doc><node1><node2><node3>some value</node3></node2></node1></doc>;
var path = "node1.node2.node3";
I need to check if the above path is really specified in XML. I tried to do this using eval and E4X.
var value = eval("xml."+path);
However, my actual xml document has namespaces that get in the way. I donβt know namespaces ahead of time or care about what they are.
Is there a way to remove all namespaces ahead of time? Is there a better way to do this?
Thank!
source
share