xpath evaluting error in andorid
Posted
by R_Dhorawat
on Stack Overflow
See other posts from Stack Overflow
or by R_Dhorawat
Published on 2010-04-22T04:58:28Z
Indexed on
2010/04/22
5:03 UTC
Read the original article
Hit count: 200
Xml
i'm running one application in android browser which contain the following code..
[
if (typeof XPathResult != "undefined") { //use build in xpath support for Safari 3.0 //alert("xpathExpr"+xpathExpr); //alert("doc"+doc); 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 app in Firefox control come in if statement and everything works fine..
but in android browser it's giving error ... XPathResult undefined... this time control come to else statement and even here it's showing that selectNodes is undefind and. so the result come as null whereas in Firefox it's giving list of nodes..
realy need it to be done ... help needed..
thanks...
© Stack Overflow or respective owner