I am running one application in an Android browser that contains the following code.
if (typeof XPathResult != "undefined") {
var xmlDocument = doc;
if (doc.nodeType != 9) {
xmlDocument = doc.ownerDocument;
}
results = xmlDocument.evaluate( xpathExpr,
doc,
function(prefix) {
return namespaces[prefix] || null;
},
XPathResult.ANY_TYPE,
null );
var thisResult;
result = [];
var len = 0;
do {
thisResult = results.iterateNext();
if (thisResult) {
result[len] = thisResult;
len++;
}
} while ( thisResult );
}
else {
try {
if (doc.selectNodes) {
result = doc.selectNodes(xpathExpr);
}
} catch (ex) {}
}
return result;
but when I run this application in Firefox, enter the if statement and everything works fine.
but in the android browser it gives an error ... XPathResult undefined ... this time control comes in the else statement, and even here it shows that selectNodes is undefind and. therefore, the result is zero, whereas in Firefox it provides a list of nodes.
it really needs to be done ... need help ..
thank...
source
share