Modifier and Type | Class and Description |
---|---|
static class |
XPathContext.DOMNodeInfo
DOM based implementation of
XPathContext.NodeInfo . |
static interface |
XPathContext.NodeInfo
Representation of a node used by
XPathContext . |
Constructor and Description |
---|
XPathContext()
Starts with an empty context.
|
XPathContext(Map<String,String> prefix2uri)
Starts with an empty context and a given namespace mapping.
|
XPathContext(Map<String,String> prefix2uri,
Node root)
Starts with the context of an optional root node and an
optional namespace mapping.
|
XPathContext(Node root)
Starts with the context of a root node.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(QName attribute)
Adds knowledge about a single attribute of the current node.
|
void |
addAttributes(Iterable<? extends QName> attributes)
Adds knowledge about the current node's attributes.
|
void |
appendChildren(Iterable<? extends XPathContext.NodeInfo> children)
Adds knowledge about the current node's children appending to
the knowledge already present.
|
XPathContext |
clone()
Creates a deep copy of this XPathContext.
|
String |
getParentXPath()
Stringifies the XPath of the current node's parent.
|
String |
getXPath()
Stringifies the XPath of the current node.
|
void |
navigateToAttribute(QName attribute)
Moves from the current node to the given attribute.
|
void |
navigateToChild(int index)
Moves from the current node to the given child node.
|
void |
navigateToParent()
Moves back to the parent.
|
void |
setChildren(Iterable<? extends XPathContext.NodeInfo> children)
Adds knowledge about the current node's children replacing
existing knowledge.
|
public XPathContext()
public XPathContext(Node root)
public XPathContext(Map<String,String> prefix2uri)
prefix2uri
- maps from prefix to namespace URI.public void navigateToChild(int index)
public void navigateToAttribute(QName attribute)
public void navigateToParent()
public void addAttributes(Iterable<? extends QName> attributes)
public void addAttribute(QName attribute)
public void setChildren(Iterable<? extends XPathContext.NodeInfo> children)
public void appendChildren(Iterable<? extends XPathContext.NodeInfo> children)
public String getXPath()
public String getParentXPath()
public XPathContext clone()
Copyright © 2001–2017 XMLUnit. All rights reserved.