Well those documents describe the XPath API and how to use that, basically the DOM document gets a method named 'evaluate' to which you pass an XPath expression, a context node, an optional namespace resolver, a result type and an optional result.
Here is an example how to use that with Mozilla:
Code:
var httpRequest = new XMLHttpRequest();
httpRequest.open('GET', 'campaigns.xml', true);
httpRequest.onreadystatechange = function () {
if (httpRequest.readyState == 4) {
var doc = httpRequest.respon****ML;
var id = '1111111';
if (typeof doc.evaluate != 'undefined') {
var xpathResult = doc.evaluate('Campaigns/Campaign[@ScriptID = "' + id + '"]', doc, null, XPathResult.ORDERED_NODE_ITERATOR_TYPE, null);
var campaign;
while ((campaign = xpathResult.iterateNext()) != null) {
var id = campaign.getElementsByTagName('ID')[0];
alert(id.textContent);
}
}
}
};
httpRequest.send(null);
(editing) The property the code is supposed to use is called 'r e s p o n s e X M L' without the spaces, it seems the forum software censors that as it contains a certain three letter word.