Java Utililty Methods XPath Create

List of utility methods to do XPath Create

Description

The list of methods to do XPath Create are organized into topic(s).

Method

ListxPathNodes(String expr, Object context)
x Path Nodes
return xPathObjects(expr, context);
StringxPathSearch(String input, String expression)
x Path Search
DocumentBuilder documentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
XPath xPath = XPathFactory.newInstance().newXPath();
XPathExpression xPathExpression = xPath.compile(expression);
Document document = documentBuilder.parse(new ByteArrayInputStream(input.getBytes("UTF-8")));
return (String) xPathExpression.evaluate(document, XPathConstants.STRING);