| 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)
root - the root nodepublic XPathContext(Map<String,String> prefix2uri)
prefix2uri - maps from prefix to namespace URI.public void navigateToChild(int index)
index - index of child to navigate topublic void navigateToAttribute(QName attribute)
attribute - name of attribute to navigate topublic void navigateToParent()
public void addAttributes(Iterable<? extends QName> attributes)
attributes - attributes to addpublic void addAttribute(QName attribute)
attribute - attribute to addpublic void setChildren(Iterable<? extends XPathContext.NodeInfo> children)
children - children to addpublic void appendChildren(Iterable<? extends XPathContext.NodeInfo> children)
children - children to addpublic String getXPath()
public String getParentXPath()
public XPathContext clone()
Copyright © 2001–2025 XMLUnit. All rights reserved.