|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.svario.xpathapi.jaxp.XPathAPI
public class XPathAPI
The container for the various static methods exposed by the XPathAPI.
See the XPathAPI package documentation for an overview of XPathAPI and examples of how to use these methods.
it.svario.xpathapi.jaxp| Constructor Summary | |
|---|---|
XPathAPI()
|
|
| Method Summary | |
|---|---|
static List<Node> |
selectListOfNodes(Node contextNode,
String xpathString)
Selects all the nodes that match the given XPath expression (returns a List<Node> list). |
static List<Node> |
selectListOfNodes(Node contextNode,
String xpathString,
Map<String,String> namespaces)
Selects all the nodes that match the given XPath expression, taking into account the namespace mappings defined in namespaces
(returns a List<Node> list). |
static List<Node> |
selectListOfNodes(Node contextNode,
String xpathString,
Node namespaceNode)
Selects all the nodes that match the given XPath expression, taking into account all namespaces found in namespaceNode (returns a
List<Node> list). |
static org.w3c.dom.traversal.NodeIterator |
selectNodeIterator(Node contextNode,
String xpathString)
Returns an iterator over all the nodes that match the given XPath expression. |
static org.w3c.dom.traversal.NodeIterator |
selectNodeIterator(Node contextNode,
String xpathString,
Node namespaceNode)
Returns an iterator over all the nodes that match the given XPath expression, taking into account all namespaces found in namespaceNode. |
static NodeList |
selectNodeList(Node contextNode,
String xpathString)
Selects all the nodes that match the given XPath expression (returns a org.w3c.dom.NodeList list). |
static NodeList |
selectNodeList(Node contextNode,
String xpathString,
Map<String,String> namespaces)
Selects all the nodes that match the given XPath expression, taking into account the namespace mappings defined in namespaces
(returns a org.w3c.dom.NodeList list). |
static NodeList |
selectNodeList(Node contextNode,
String xpathString,
Node namespaceNode)
Selects all the nodes that match the given XPath expression, taking into account all namespaces found in namespaceNode (returns a
org.w3c.dom.NodeList list). |
static List<String> |
selectNodeListAsStrings(Node contextNode,
String xpathString)
Returns a list with the textual content of all the nodes that match the given XPath expression. |
static List<String> |
selectNodeListAsStrings(Node contextNode,
String xpathString,
Map<String,String> namespaces)
Returns a list with the textual content of all the nodes that match the given XPath expression, taking into account the namespace mappings defined in namespaces. |
static List<String> |
selectNodeListAsStrings(Node contextNode,
String xpathString,
Node namespaceNode)
Returns a list with the textual content of all the nodes that match the given XPath expression, taking into account all namespaces found namespaceNode. |
static Node |
selectSingleNode(Node contextNode,
String xpathString)
Selects the first node that matches the given XPath expression. |
static Node |
selectSingleNode(Node contextNode,
String xpathString,
Map<String,String> namespaces)
Selects the first node that matches the given XPath expression, taking additional namespace from the namespaces mapping. |
static Node |
selectSingleNode(Node contextNode,
String xpathString,
Node namespaceNode)
Selects the first node that matches the given XPath expression, taking into account all namespaces found in namespaceNode. |
static String |
selectSingleNodeAsString(Node contextNode,
String xpathString)
Returns the textual content of the first node that matches the given XPath expression. |
static String |
selectSingleNodeAsString(Node contextNode,
String xpathString,
Map<String,String> namespaces)
Returns the textual content of the first node that matches the given XPath expression, taking into account the namespace mappings defined in namespaces. |
static String |
selectSingleNodeAsString(Node contextNode,
String xpathString,
Node namespaceNode)
Returns the textual content of the first node that matches the given XPath expression, taking into account all namespaces found namespaceNode. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XPathAPI()
| Method Detail |
|---|
public static Node selectSingleNode(Node contextNode,
String xpathString)
throws XPathException
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectSingleNode(Node, String, Map) or
selectSingleNode(Node, String, Node).
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathException
public static Node selectSingleNode(Node contextNode,
String xpathString,
Map<String,String> namespaces)
throws XPathException
namespaces mapping.
This function behaves like selectSingleNode(Node, String), but
the namespace prefixes that can be used in the XPath expression are not
only those available in contextNode, but also the ones defined
in the namespaces mapping.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaces - a mapping between namespace prefixes and URIs
XPathException
public static Node selectSingleNode(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode.
This function behaves like selectSingleNode(Node, String), but
the namespace prefixes that can be used in the XPath expression are not
those available in contextNode, but those available in
namespaceNode.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathException
public static String selectSingleNodeAsString(Node contextNode,
String xpathString)
throws XPathException
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectSingleNodeAsString(Node, String, Map) or
selectSingleNodeAsString(Node, String, Node).
Node node = selectSingleNode(contextNode, xpathString); return node.getTextContent();
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathExceptionselectSingleNode(Node, String)
public static String selectSingleNodeAsString(Node contextNode,
String xpathString,
Map<String,String> namespaces)
throws XPathException
namespaces.
Basically, this method is equivalent to
Node node = selectSingleNode(contextNode, xpathString, namespaces); return node.getTextContent();
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaces - a mapping between namespace prefixes and URIs
XPathExceptionselectSingleNode(Node, String, Map)
public static String selectSingleNodeAsString(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode.
Basically, this method is equivalent to
Node node = selectSingleNode(contextNode, xpathString, namespaceNode); return node.getTextContent();
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathExceptionselectSingleNode(Node, String, Node)
public static NodeList selectNodeList(Node contextNode,
String xpathString)
throws XPathException
org.w3c.dom.NodeList list).
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectNodeList(Node, String, Map) or
selectNodeList(Node, String, Node).
It is better to use the selectListOfNodes(Node, String) method
because it returns a List<Node> instead of a legacy
org.w3c.dom.NodeList.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathExceptionselectListOfNodes(Node, String)
public static NodeList selectNodeList(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode (returns a
org.w3c.dom.NodeList list).
This function behaves like selectNodeList(Node, String), but
the namespace prefixes that can be used in the XPath expression are not
those available in contextNode, but those available in
namespaceNode.
It is better to use the selectListOfNodes(Node, String, Node)
method because it returns a List<Node> instead of a legacy
org.w3c.dom.NodeList.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathExceptionselectListOfNodes(Node, String, Node)
public static NodeList selectNodeList(Node contextNode,
String xpathString,
Map<String,String> namespaces)
throws XPathException
namespaces
(returns a org.w3c.dom.NodeList list).
This function behaves like selectNodeList(Node, String), but
the namespace prefixes that can be used in the XPath expression are not
only those available in contextNode, but also the ones defined
in the namespaces mapping.
It is better to use the selectListOfNodes(Node, String, Map)
method because it returns a List<Node> instead of a legacy
org.w3c.dom.NodeList.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaces - a mapping between namespace prefixes and URIs
XPathExceptionselectListOfNodes(Node, String, Map)
public static List<Node> selectListOfNodes(Node contextNode,
String xpathString)
throws XPathException
List<Node> list).
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectListOfNodes(Node, String, Map) or
selectListOfNodes(Node, String, Node).
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathException
public static List<Node> selectListOfNodes(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode (returns a
List<Node> list).
This function behaves like selectListOfNodes(Node, String),
but the namespace prefixes that can be used in the XPath expression are
not those available in contextNode, but those available in
namespaceNode.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathException
public static List<Node> selectListOfNodes(Node contextNode,
String xpathString,
Map<String,String> namespaces)
throws XPathException
namespaces
(returns a List<Node> list).
This function behaves like selectListOfNodes(Node, String),
but the namespace prefixes that can be used in the XPath expression are
not only those available in contextNode, but also the ones
defined in the namespaces mapping.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaces - a mapping between namespace prefixes and URIs
XPathException
public static List<String> selectNodeListAsStrings(Node contextNode,
String xpathString)
throws XPathException
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectNodeListAsStrings(Node, String, Map) or
selectNodeListAsStrings(Node, String, Node).
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathExceptionselectNodeList(Node, String)
public static List<String> selectNodeListAsStrings(Node contextNode,
String xpathString,
Map<String,String> namespaces)
throws XPathException
namespaces.
This function behaves like
selectNodeListAsStrings(Node, String), but the namespace
prefixes that can be used in the XPath expression are not only those
available in contextNode, but also the ones defined in the
namespaces mapping.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaces -
XPathExceptionselectNodeList(Node, String, Map)
public static List<String> selectNodeListAsStrings(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode.
This function behaves like
selectNodeListAsStrings(Node, String), but the namespace
prefixes that can be used in the XPath expression are not those
available in contextNode, but those available in
namespaceNode.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathExceptionselectNodeList(Node, String, Node)
public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(Node contextNode,
String xpathString)
throws XPathException
Same as selectNodeList(Node, String) but returns a
NodeIterator instead of a simple NodeList.
The only namespaces prefixes usable in the XPath expression are those
available in contextNode. If other additional prefixes are
required, use selectNodeIterator(Node, String, Node).
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluate
XPathExceptionselectNodeList(Node, String)
public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(Node contextNode,
String xpathString,
Node namespaceNode)
throws XPathException
namespaceNode.
Same as selectNodeList(Node, String, Node) but returns a
NodeIterator instead of a simple NodeList.
This function behaves like selectNodeIterator(Node, String),
but the namespace prefixes that can be used in the XPath expression are
not those available in contextNode, but those available in
namespaceNode.
contextNode - the node from which the XPath expression is
evaluatedxpathString - the XPath expression to evaluatenamespaceNode - the node from which all the namespace declarations
will be taken
XPathExceptionselectNodeList(Node, String, Node)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||