/********************************************************************
AUTHOR: Darryl Yip
DATE: 02/06/2005

DESCRIPTION:
  This class is used to abstract all the lower level calls
  from the various xpath libraries.
  
DEPENDENCIES: 
  xpath/misc.js
  xpath/dom.js
  xpath/xpath.js

SAMPLE USAGE:
  xmlText = "<?xml version=\"1.0\"?><ROOT><TAG1>Hello World 1</TAG1><TAG1>Hello World 2</TAG1></ROOT>"
  var myXML = new XpathHelper(xmlText);
  var nodeSet = myXML.query("//TAG1/text()");

  for(var x=0; x <= nodeSet.length;x++){
    document.write(nodeSet[x].nodeValue+'<br />');
  }
********************************************************************/

function XpathHelper(xmlString){
	this.ctx = new ExprContext(xmlParse(xmlString));
}

XpathHelper.prototype.query = function(str) {
	return xpathParse(str).evaluate(this.ctx).nodeSetValue();
}