Code example for XPath

Methods: compile

0
    public GenericXmlBikeRentalDataSource(String path) {
        XPathFactory factory = XPathFactory.newInstance();
 
        XPath xpath = factory.newXPath();
        try { 
            xpathExpr = xpath.compile(path);
        } catch (XPathExpressionException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    @Override 
    public boolean update() { 
        try { 
            InputStream data = HttpUtils.getData(url);
            if (data == null) {
                log.warn("Failed to get data from url " + url);
                return false; 
            } 
            parseXML(data);
        } catch (IOException e) {