* @param expression
* @param xml
*/
public Variable xpath(Object expression, Object xml) {
if (expression == null) {
throw new ScraperXPathException("XPath expression is null!");
}
if (xml == null) {
throw new ScraperXPathException("XML value is null!");
}
try {
return XmlUtil.evaluateXPath(expression.toString(), xml.toString(), scraper.getRuntimeConfig());
} catch (XPathException e) {
throw new ScraperXPathException("Error parsing XPath expression (XPath = [" + expression + "])!", e);
}
}