Package org.webharvest.exception

Examples of org.webharvest.exception.ScraperXPathException


     * @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);
        }
    }
View Full Code Here


        try {
            RuntimeConfig runtimeConfig = scraper.getRuntimeConfig();
            return XmlUtil.evaluateXPath(expression, xml.toString(), runtimeConfig);
        } catch (XPathException e) {
            throw new ScraperXPathException("Error parsing XPath expression (XPath = [" + expression + "])!", e);
        }
    }
View Full Code Here

TOP

Related Classes of org.webharvest.exception.ScraperXPathException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.