@Test public void testGetNode() throws Exception { Node node = xPathHelper.getNode("/xml/secondTag/valueTag", xmlDoc); assertEquals("C", node.getTextContent()); }
public Node getNode(String pathExpr, Node node) { try { return (Node) xPath.evaluate(pathExpr, node, XPathConstants.NODE); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPpath '" + pathExpr + "' invalid.", e); } }
XPathHelper { public Node getNode(String pathExpr, Node node) { try { return (Node) xPath.evaluate(pathExpr, node, XPathConstants.NODE); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPpath '" + pathExpr + "' invalid.", e); } } }
XPathHelper { public Node getNode(String pathExpr, Node node) { try { return (Node) xPath.evaluate(pathExpr, node, XPathConstants.NODE); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPpath '" + pathExpr + "' invalid.", e); } } XPathHelper(XPath xPath); }
XPathHelper { public Node getNode(String pathExpr, Node node) { try { return (Node) xPath.evaluate(pathExpr, node, XPathConstants.NODE); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPpath '" + pathExpr + "' invalid.", e); } } XPathHelper(XPath xPath); String getString(String pathExpr, Node node); NodeList getNodeList(String pathExpr, Node node); Node getNode(String pathExpr, Node node); }
XPathHelper { public Node getNode(String pathExpr, Node node) { try { return (Node) xPath.evaluate(pathExpr, node, XPathConstants.NODE); } catch (XPathExpressionException e) { throw new IllegalArgumentException("XPpath '" + pathExpr + "' invalid.", e); } } XPathHelper(XPath xPath); String getString(String pathExpr, Node node); NodeList getNodeList(String pathExpr, Node node); Node getNode(String pathExpr, Node node);  }