XPath is a language for addressing parts of an XML document. Complete W3C Specification can be found here. dhtmlxAjax supports XPath for loader object (it comes to the callback function as an incomming argument in case of async request or you get it as a result of getSync and postSync methods). Common way of usage is:
var loader = dhtmlxAjax.getSync(url); loader.doXPath(xpathExp, docObj, namespace, result_type);
where:
Thus in the most simple cases the following syntax is enough. It will return array of found elements. You can iterate through them using common way of iterating through array.
var result = loader.doXPath("/some/expression[@arg='value']"); for(var i=0;i<result.length;i++){ alert(result[i].nodeName) }