tags:

views:

95

answers:

0

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
    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...