public class NodeExtractor extends Object
Node
from a parent node given a list of xpaths using DOM methods,
not XPathExpression
objects.
This utility exists because the Node
objects produced by Axis and JAX-WS do not seem to
be compatible with XPathExpression
.
Constructor and Description |
---|
NodeExtractor() |
Modifier and Type | Method and Description |
---|---|
Node |
extractNode(Node parentNode,
Iterable<String> xPath)
Extracts the node specified by the xpath list.
|
String |
extractNodeValue(Node parentNode,
Iterable<String> xPath)
Convenience method for getting the value of a node, handling the case where the node does not
exist.
|
public String extractNodeValue(@Nullable Node parentNode, Iterable<String> xPath)
xPath
if it exists, else null
.public Node extractNode(@Nullable Node parentNode, Iterable<String> xPath)
parentNode
- the node to extract the child node from.xPath
- xpath elements for local names that make up the child node's xpath.Node
, or null
if no such child node exists.Copyright © 2018. All Rights Reserved.