Refine search
@SuppressWarnings("unchecked") public List<Node> evaluateAsNodeList(Node node) { try { return xpath.selectNodes(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public Node evaluateAsNode(Node node) { try { return (Node) xpath.selectSingleNode(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public String evaluateAsString(Node node) { try { return xpath.stringValueOf(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public boolean evaluateAsBoolean(Node node) { try { return xpath.booleanValueOf(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
private Object splitNode(Node node) throws ParserConfigurationException { if (this.iterator) { try { NodeList nodeList = (NodeList) this.jaxpExpression.evaluate(node, XPathConstants.NODESET); return new NodeListIterator(nodeList); } catch (XPathExpressionException e) { throw new XPathException("Could not evaluate XPath expression:" + e.getMessage(), e); } } else { List<Node> nodeList = this.xpathExpression.evaluateAsNodeList(node); if (this.createDocuments) { return convertNodesToDocuments(nodeList); } return nodeList; } }
public Node evaluateAsNode(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return (Node) xpath.selectSingleNode(element); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
public String evaluateAsString(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.stringValueOf(element); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
public boolean evaluateAsBoolean(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.booleanValueOf(element); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
@Override public double evaluateAsDouble(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.numberValueOf(element).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
throw new XPathException("Unable to create 'documentBuilder'.", e);
@Override @SuppressWarnings("unchecked") public List<Node> evaluateAsNodeList(Node node) { try { return xpath.selectNodes(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public Node evaluateAsNode(Node node) { try { return (Node) xpath.selectSingleNode(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public String evaluateAsString(Node node) { try { return xpath.stringValueOf(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public boolean evaluateAsBoolean(Node node) { try { return xpath.booleanValueOf(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public double evaluateAsNumber(Node node) { try { return xpath.numberValueOf(node).doubleValue(); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
public Jaxp13XPathTemplate(String xpathFactoryUri) { try { xpathFactory = XPathFactory.newInstance(xpathFactoryUri); } catch (XPathFactoryConfigurationException ex) { throw new XPathException("Could not create XPathFactory", ex); } }
@SuppressWarnings("unchecked") public List<Node> evaluateAsNodeList(String expression, Source context) throws XPathException { try { XPath xpath = createXPath(expression); Element element = getRootElement(context); return xpath.selectNodes(element); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + expression + "]", ex); } catch (TransformerException ex) { throw new XPathException("Could not transform context to DOM Node", ex); } }
public Node evaluateAsNode(Node node) { try { return (Node) xpath.selectSingleNode(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }
@Override public String evaluateAsString(Node node) { try { return xpath.stringValueOf(node); } catch (JaxenException ex) { throw new XPathException("Could not evaluate XPath expression [" + xpath + "] :" + ex.getMessage(), ex); } }