From ece7d18cf35374bf4e26d041799cda8f791c89f8 Mon Sep 17 00:00:00 2001 From: gregor Date: Mon, 7 Jul 2003 10:58:37 +0000 Subject: Initial commit git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/trunk@2 d688527b-c9ab-4aba-bd8d-4036d912da1d --- .../at/gv/egovernment/moa/util/XPathUtils.html | 543 +++++++++++++++++++++ 1 file changed, 543 insertions(+) create mode 100644 spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/XPathUtils.html (limited to 'spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/XPathUtils.html') diff --git a/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/XPathUtils.html b/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/XPathUtils.html new file mode 100644 index 000000000..ee16972f5 --- /dev/null +++ b/spss.server/doc/api-doc-internal/at/gv/egovernment/moa/util/XPathUtils.html @@ -0,0 +1,543 @@ + + + + + + +MOA SP/SS Server Internal API: Class XPathUtils + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + +
+ +

+ +at.gv.egovernment.moa.util +
+Class XPathUtils

+
+java.lang.Object
+  |
+  +--at.gv.egovernment.moa.util.XPathUtils
+
+
+
+
public class XPathUtils
extends Object
+ +

+Utility methods to evaluate XPath expressions on DOM nodes. +

+

+
Version:
$Id$
+
Author:
Patrick Peck
+
+
+ +

+ + + + + + + + + + + + + + +
+Field Summary
+static StringALL_NODES_XPATH + +
+          The XPath expression selecting all nodes under a given root (including the + root node itself).
+  + + + + + + + + + + +
+Constructor Summary
XPathUtils() + +
+           
+  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+Method Summary
+static StringgetAttributeValue(org.w3c.dom.Element root, + String xpath, + String def) + +
+          Return the value of a DOM attribute whose location is given by an XPath + expression.
+static StringgetElementValue(org.w3c.dom.Element root, + String xpath, + String def) + +
+          Return the value of a DOM element whose location is given by an XPath + expression.
+static org.w3c.dom.traversal.NodeIteratorselectNodeIterator(org.w3c.dom.Node contextNode, + org.w3c.dom.Element namespaceElement, + String exp) + +
+          Return a NodeIterator over the nodes matching the XPath + expression.
+static org.w3c.dom.traversal.NodeIteratorselectNodeIterator(org.w3c.dom.Node contextNode, + Map namespaceMapping, + String exp) + +
+          Return a NodeIterator over the nodes matching the XPath + expression.
+static org.w3c.dom.traversal.NodeIteratorselectNodeIterator(org.w3c.dom.Node contextNode, + String exp) + +
+          Return a NodeIterator over the nodes matching the XPath + expression. + +
+static org.w3c.dom.NodeListselectNodeList(org.w3c.dom.Node contextNode, + org.w3c.dom.Element namespaceElement, + String exp) + +
+          Return a NodeList of all the nodes matching the XPath + expression.
+static org.w3c.dom.NodeListselectNodeList(org.w3c.dom.Node contextNode, + Map namespaceMapping, + String exp) + +
+          Return a NodeList of all the nodes matching the XPath + expression.
+static org.w3c.dom.NodeListselectNodeList(org.w3c.dom.Node contextNode, + String exp) + +
+          Return a NodeList of all the nodes matching the XPath + expression. + +
+static org.w3c.dom.NodeselectSingleNode(org.w3c.dom.Node contextNode, + org.w3c.dom.Element namespaceElement, + String exp) + +
+          Select the first node matching an XPath expression.
+static org.w3c.dom.NodeselectSingleNode(org.w3c.dom.Node contextNode, + Map namespaceMapping, + String exp) + +
+          Select the first node matching an XPath expression.
+static org.w3c.dom.NodeselectSingleNode(org.w3c.dom.Node contextNode, + String exp) + +
+          Select the first node matching an XPath expression. + +
+ + + + + + + +
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+  +

+ + + + + + + + +
+Field Detail
+ +

+ALL_NODES_XPATH

+
+public static final String ALL_NODES_XPATH
+
+
The XPath expression selecting all nodes under a given root (including the + root node itself).
+ + + + + + + + +
+Constructor Detail
+ +

+XPathUtils

+
+public XPathUtils()
+
+
+ + + + + + + + +
+Method Detail
+ +

+selectNodeIterator

+
+public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(org.w3c.dom.Node contextNode,
+                                                                    String exp)
+                                                             throws XPathException
+
+
Return a NodeIterator over the nodes matching the XPath + expression. + + All namespace URIs and prefixes declared in the Constants + interface are used for resolving namespaces.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
An iterator over the resulting nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectNodeIterator

+
+public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(org.w3c.dom.Node contextNode,
+                                                                    org.w3c.dom.Element namespaceElement,
+                                                                    String exp)
+                                                             throws XPathException
+
+
Return a NodeIterator over the nodes matching the XPath + expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceElement - An element from which to build the + namespace mapping for evaluating the XPath expression
exp - The XPath expression to evaluate.
Returns:
An iterator over the resulting nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectNodeIterator

+
+public static org.w3c.dom.traversal.NodeIterator selectNodeIterator(org.w3c.dom.Node contextNode,
+                                                                    Map namespaceMapping,
+                                                                    String exp)
+                                                             throws XPathException
+
+
Return a NodeIterator over the nodes matching the XPath + expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceMapping - A namespace prefix to namespace URI mapping + (String to String) for evaluating the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
An iterator over the resulting nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectNodeList

+
+public static org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
+                                                  String exp)
+                                           throws XPathException
+
+
Return a NodeList of all the nodes matching the XPath + expression. + + All namespace URIs and prefixes declared in the Constants + interface are used for resolving namespaces.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
A NodeList containing the matching nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectNodeList

+
+public static org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
+                                                  org.w3c.dom.Element namespaceElement,
+                                                  String exp)
+                                           throws XPathException
+
+
Return a NodeList of all the nodes matching the XPath + expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceElement - An element from which to build the + namespace mapping for evaluating the XPath expression
exp - The XPath expression to evaluate.
Returns:
A NodeList containing the matching nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectNodeList

+
+public static org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode,
+                                                  Map namespaceMapping,
+                                                  String exp)
+                                           throws XPathException
+
+
Return a NodeList of all the nodes matching the XPath + expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceMapping - A namespace prefix to namespace URI mapping + (String to String) for evaluating the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
A NodeList containing the matching nodes.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectSingleNode

+
+public static org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
+                                                String exp)
+                                         throws XPathException
+
+
Select the first node matching an XPath expression. + + All namespace URIs and prefixes declared in the Constants + interface are used for resolving namespaces.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
Node The first node matching the XPath expression, or + null, if no node matched.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectSingleNode

+
+public static org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
+                                                org.w3c.dom.Element namespaceElement,
+                                                String exp)
+                                         throws XPathException
+
+
Select the first node matching an XPath expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceElement - An element from which to build the + namespace mapping for evaluating the XPath expression
exp - The XPath expression to evaluate.
Returns:
Node The first node matching the XPath expression, or + null, if no node matched.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+selectSingleNode

+
+public static org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode,
+                                                Map namespaceMapping,
+                                                String exp)
+                                         throws XPathException
+
+
Select the first node matching an XPath expression.
+
Parameters:
contextNode - The root node from which to evaluate the XPath + expression.
namespaceMapping - A namespace prefix to namespace URI mapping + (String to String) for evaluating the XPath + expression.
exp - The XPath expression to evaluate.
Returns:
Node The first node matching the XPath expression, or + null, if no node matched.
Throws:
XPathException - An error occurred evaluating the XPath expression.
+
+
+
+ +

+getElementValue

+
+public static String getElementValue(org.w3c.dom.Element root,
+                                     String xpath,
+                                     String def)
+
+
Return the value of a DOM element whose location is given by an XPath + expression.
+
Parameters:
root - The root element from which to evaluate the XPath.
xpath - The XPath expression pointing to the element whose value + to return.
def - The default value to return, if no element can be found using + the given xpath.
Returns:
The element value, if it can be located using the + xpath. Otherwise, def is returned.
+
+
+
+ +

+getAttributeValue

+
+public static String getAttributeValue(org.w3c.dom.Element root,
+                                       String xpath,
+                                       String def)
+
+
Return the value of a DOM attribute whose location is given by an XPath + expression.
+
Parameters:
root - The root element from which to evaluate the XPath.
xpath - The XPath expression pointing to the attribute whose value to + return.
def - The default value to return, if no attribute can be found using + the given xpath.
Returns:
The element value, if it can be located using the + xpath. Otherwise, def is returned.
+
+
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + +
+ + + -- cgit v1.2.3