var results = []; 
function eval_xpath(xpath, inDocument, pageBot){    // Trim any trailing "/": not valid xpath, and remains from attribute    // locator.    if (xpath.charAt(xpath.length - 1) == '/') {        xpath = xpath.slice(0, -1);    }        var results = [];        // Handle //tag    var match = xpath.match(/^\/\/(\w+|\*)$/);    if (match) {        var elements = inDocument            .getElementsByTagName(match[1].toUpperCase());        if (elements != null) {            for (var i = 0; i < elements.length; ++i) {                results.push(elements[i]);            }        }        return results;    }        if (pageBot) {        // Handle //tag[@attr='value']        var match = xpath            .match(/^\/\/(\w+|\*)\[@(\w+)=('([^\']+)'|"([^\"]+)")\]$/);        if (match) {            // comments removed            var val = pageBot._findElementByTagNameAndAttributeValue(                    inDocument,                    match[1].toUpperCase(),                    match[2].toLowerCase(),                    match[3].slice(1, -1)                    );            if (val) {                return [ val ];            }        }                // Handle //tag[text()='value']        var match = xpath            .match(/^\/\/(\w+|\*)\[text\(\)=('([^\']+)'|"([^\"]+)")\]$/);        if (match) {            return [ pageBot._findElementByTagNameAndText(                inDocument,                match[1].toUpperCase(),                match[2].slice(1, -1)) ];        }    }        // HUGE hack - remove namespace from xpath for IE    if (browserVersion.isIE) {        xpath = xpath.replace(/x:/g, '')    }        var results = [];    if (inDocument.evaluate) {        // Use document.evaluate() if it's available        var xpathResult = inDocument            .evaluate(xpath, inDocument, GLOBAL.NAMESPACE_RESOLVER, 0, null);        var result = xpathResult.iterateNext();        while (result) {            results.push(result);            result = xpathResult.iterateNext();        }    }    else {        // If not, fall back to slower JavaScript implementation        var context = new ExprContext(inDocument);        var xpathObj = xpathParse(xpath);        var xpathResult = xpathObj.evaluate(context);        if (xpathResult && xpathResult.value) {            for (var i = 0; i < xpathResult.value.length; ++i) {                results.push(xpathResult.value[i]);            }        }    }        return results;}
4983	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4983/f7ada6c3bf281c06c938359ab1756a2ece016364/ui-element.js/clean/src/content/ui-element.js