You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
evaluate("//WG:F[@id='22']", objContext, Xml_NSResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) - no results
evaluate("//WG:F[@*[local-name()='Id']='22']", objContext, Xml_NSResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) - no results
evaluate("//[local-name()='F' and namespace-uri()='gNamespace'][@[local-name()='Id']='22']", objContext, Xml_NSResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) - no results
evaluate("//[local-name()='F'][@[local-name()='Id']='22']", objContext, Xml_NSResolver, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) - Gives results, but doesn't distinguish namespaces so unusable.
All the above xpath queries work fine in online xpath testers.
Attached is a fully contained test.html for these tests.
Using input XML as:
<WG:R xmlns:WC="cNamespace" xmlns:WG="gNamespace" AF="22"><WG:F Id="22"/></WG:R>Namespace resolver as:
` function Xml_NSResolver(strPrefix) {
if (strPrefix == "WG") {
return 'gNamespace';
}
else if (strPrefix == "WC") {
return 'cNamespace';
}
}`
The script initialized by:
mobjXpathEngineWindow = { document: {} };
wgxpath.install(mobjXpathEngineWindow);
Then calling evaluate as:
All the above xpath queries work fine in online xpath testers.
Attached is a fully contained test.html for these tests.
Palli
dist.zip