|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jdesktop.xpath.XPathUtils
public class XPathUtils extends Object
Various utilities for working with XPath. This class uses a static XPath object for most of it's work. This XPath object is preconfigured to use the extended XPath functions of the org.jdesktop.xpath.function package.
| Field Summary | |
|---|---|
private static XPathFunctionResolverImpl |
functionResolver
|
private static XPath |
xpath
|
| Constructor Summary | |
private XPathUtils()
|
|
| Method Summary | |
|---|---|
static XPathExpression
|
compile(String expression)
Compiles the given expression, using the internal XPath instance of this class and returns the XPathExpression. |
static org.w3c.dom.Node
|
getElement(String expression, org.w3c.dom.Node node)
Returns a Node matching the given expression. |
static org.w3c.dom.Node
|
getElement(XPathExpression expression, org.w3c.dom.Node node)
Returns a Node matching the given expression. |
static SimpleNodeList
|
getElements(String expression, org.w3c.dom.Node node)
Returns a SimpleNodeList containing all the nodes that match the given expression when executed on the given node (as opposed to the dom as a whole). |
static SimpleNodeList
|
getElements(XPathExpression expression, org.w3c.dom.Node node)
Returns a SimpleNodeList containing all the nodes that match the given expression when executed on the given node (as opposed to the dom as a whole). |
static String
|
getString(String expression, org.w3c.dom.Node node)
Returns the text content of the Node matching the given expression. |
static String
|
getString(String expression, org.w3c.dom.Node node, String namespace, String namespacePrefix)
|
static String
|
getString(XPathExpression expression, org.w3c.dom.Node node)
Returns the text content of the Node matching the given expression. |
static String
|
toXML(org.w3c.dom.Document dom)
Exports this DOM as a String |
static String
|
toXML(org.w3c.dom.Document dom, Properties outputProperties)
|
| Methods inherited from class Object | |
|---|---|
| wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
| Field Detail |
|---|
private static final XPathFunctionResolverImpl functionResolver
private static final XPath xpath
| Constructor Detail |
|---|
private XPathUtils()
| Method Detail |
|---|
public static XPathExpression compile(String expression)
expression - The XPath expression to compile
public static org.w3c.dom.Node getElement(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static org.w3c.dom.Node getElement(XPathExpression expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static SimpleNodeList getElements(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static SimpleNodeList getElements(XPathExpression expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static String getString(String expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static String getString(String expression, org.w3c.dom.Node node, String namespace, String namespacePrefix)
public static String getString(XPathExpression expression, org.w3c.dom.Node node)
expression - an XPath expressionnode - the contextual node
public static String toXML(org.w3c.dom.Document dom)
public static String toXML(org.w3c.dom.Document dom, Properties outputProperties)
Groovy Documentation