Document.evalute function providing exception
I have code like
res = doc.evalute(xpathExpr,doc,
function(prefix) {return namespaces[prefix] || null;},
XPathResult.ANY_TYPE,null );
Here doc is the DOM node document
When I run a loop for this type
for(i in doc) alert(i);
he gives the evaluation method
but when i tried to use this method for dom node it gave me error like
xpathResult is undefined ...
I am working in an android browser.
thanks in advance....
a source to share
XPathResult.ANY_TYPE
It is not guaranteed that a DOM Level 3 XPath interface XPathResult
will actually be exposed as a member window
called XPathResult
. In fact, none of the DOM interfaces are specified as function constructors in window
. Most non-IE browsers have many. But the Android browser doesn't seem to support evaluate
on HTMLDocument
; I guess that's why it doesn't provide either XPathResult
.
So, if you want to get a static member of a type ANY_TYPE
, the only reliable way to do it is to have an instance of that class already and access it .ANY_TYPE
. Since you don't have an XPathResult at this point, your best bet is probably to tell 0
.
a source to share