public abstract class XMLPath extends Object
XMLPathCtx.findIn(org.w3c.dom.Document)
methods.
From there you can use the
methods to build a whole xpath. After creation of an whole xpath you can call
the get() method of each concrete XMLPath instance, to get the result of the
query.
Sample (finds a root node of a document):
XMLPathCtx ctx = XMLPathCtx.createNew()
.addNamespace("t", "http://tempuri.org/test");
Node result = ctx.findIn(document).node("/*").get();
Modifier and Type | Class and Description |
---|---|
static class |
XMLPath.BooleanXMLPath
Class BooleanXMLPath, represents xpath queries resulting in boolean
values.
|
static class |
XMLPath.NodeSetXMLPath
Class NodeSetXMLPath, represents xpaths resulting in NodeLists.
|
static class |
XMLPath.NodeXMLPath
Class NodeXMLPath, represents xpaths resulting in nodes.
|
static class |
XMLPath.NumberXMLPath
Class NumberXMLPath, represents xpath queries resulting in number values.
|
static class |
XMLPath.SourceXMLPath
Class SourceXMLPath, represents the xpath root/or source of evaluation.
|
static class |
XMLPath.StringXMLPath
Class StringXMLPath, represents xpaths queries resulting in string
values.
|
Modifier and Type | Field and Description |
---|---|
protected XMLPathCtx |
m_ctx |
protected XMLPath |
m_previous
previous path element.
|
protected XPathExpression |
m_xPath
Xpath expression.
|
Modifier | Constructor and Description |
---|---|
protected |
XMLPath(XMLPath previous) |
protected |
XMLPath(XMLPathCtx ctx) |
Modifier and Type | Method and Description |
---|---|
XMLPath.NodeSetXMLPath |
all(String xpath)
Method all, expects a xpath query resulting in a NodeList.
|
XMLPath.BooleanXMLPath |
bool(String xpath)
Method bool, expects a xpath query resulting in a Boolean.
|
protected XMLPath |
compile(String xpath)
Method compiles an xpath.
|
protected Object |
eval()
Method evals the xpath.
|
protected abstract QName |
getReturnType()
Method gets the returnType of an evaluation.
|
XMLPath.NodeXMLPath |
node(String xpath)
Method node, expects a xpath query resulting in a node.
|
XMLPath.NumberXMLPath |
number(String xpath)
Method number, expects a xpath query resulting in a number.
|
XMLPath.StringXMLPath |
text(String xpath)
Method text, expects a xpath query resulting in a string.
|
protected XMLPathCtx m_ctx
protected XMLPath m_previous
protected XPathExpression m_xPath
protected XMLPath(XMLPathCtx ctx)
protected XMLPath(XMLPath previous)
protected Object eval()
protected abstract QName getReturnType()
protected XMLPath compile(String xpath)
xpath
- the xpath.public XMLPath.NodeXMLPath node(String xpath)
xpath
- the xpath.public XMLPath.NodeSetXMLPath all(String xpath)
xpath
- the xpath.public XMLPath.NumberXMLPath number(String xpath)
xpath
- the xpath.public XMLPath.StringXMLPath text(String xpath)
xpath
- the xpath.public XMLPath.BooleanXMLPath bool(String xpath)
xpath
- the xpath.Copyright © 2004–2016 52north.org. All rights reserved.