public class XMLPathCtx extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PREFERED_XPATH_FACTORIES
change this property to set your prefered xpath engine.
|
Modifier | Constructor and Description |
---|---|
protected |
XMLPathCtx(org.n52.security.common.xml.XMLPathCtx.XPathPool xPathPool)
Constructor creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
XMLPathCtx |
addNamespace(String prefix,
String namespace)
Method adds prefix to namespace mapping, so the prefix can be used to
qualify xpath expressions.
|
XMLPathCtx |
addNamespaces(Map<String,String> prefixNamespaceMap)
Adds all namespaces from the given Map
|
XMLPathCtx |
addNamespaces(SimpleNamespaceContext ctx)
Adds all namespaces from the given context to the internal prefix list.
|
static XMLPathCtx |
createNew()
Method creates a new XMLPathCtx instance.
|
XMLPath |
findIn(Document doc)
Method findIn constructs a new XMLPath starting in a Document source.
|
XMLPath |
findIn(InputSource source)
Method findIn constructs a new XMLPath starting in a InputSource source.
|
XMLPath |
findIn(Node node)
Method findIn constructs a new XMLPath starting in a Node source.
|
XMLPath |
findIn(NodeList nodeList)
Method findIn constructs a new XMLPath starting in a NodeList source.
|
XMLPath |
findIn(String source)
Method findIn constructs a new XMLPath starting in a string source.
|
protected XPathExpression |
lookUp(String xpath)
Method looks up an XPathExpression.
|
XMLPathCtx |
register(String xpath)
Method registers an xpath as precompiled XPathExpression.
|
XMLPathCtx |
register(String name,
String xpath)
Method registers an xpath as precompiled XPathExpression with a special
name.
|
public static String PREFERED_XPATH_FACTORIES
XPathFactory.newInstance()
.protected XMLPathCtx(org.n52.security.common.xml.XMLPathCtx.XPathPool xPathPool)
xPathPool
- the xPathPool.public XMLPathCtx addNamespace(String prefix, String namespace)
prefix
- the prefix.namespace
- the namespace.public XMLPathCtx addNamespaces(SimpleNamespaceContext ctx)
ctx
- an namespace context.public XMLPathCtx addNamespaces(Map<String,String> prefixNamespaceMap)
prefixNamespaceMap
- a map with prefix to namespace mappings.public static XMLPathCtx createNew()
public XMLPath findIn(Document doc)
doc
- the doc.public XMLPath findIn(Node node)
node
- the node.public XMLPath findIn(NodeList nodeList)
nodeList
- the nodeList.public XMLPath findIn(InputSource source)
source
- the source.public XMLPath findIn(String source)
source
- the source.protected XPathExpression lookUp(String xpath)
xpath
- the xpath.public XMLPathCtx register(String xpath)
xpath
- the xpath.public XMLPathCtx register(String name, String xpath)
name
- the name.xpath
- the xpath.Copyright © 2004–2016 52north.org. All rights reserved.