Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.novell.xml.dom
Class DOMQuery

    java.lang.Object
      com.novell.xml.dom.DOMQuery

All Implemented Interfaces:
  XPathResetRegistrar

    public class DOMQuery

extends Object
implements XPathResetRegistrar

A class that uses XPath expressions to find nodes in a DOM tree

Nested Class Summary
`static class` | `DOMQuery.StringNSContext` Class implementing NamespaceContext for resolving namespaces in expression by specifying String pairs.

Constructor Summary
`DOMQuery(String expression)` Create a DOMQuery based on the passed expression.
`DOMQuery(String expression, NamespaceContext nsContext)` Create a DOMQuery based on the passed expression.

Method Summary
`NodeSet` | `evaluate(Node node)` Evaluate the DOMQuery expression and return the resulting node-set
`static NodeSet` | `query(Node node, String expression)` A convenience method to perform a query using the passed node as context and returning the result of the query.
`static NodeSet` | `query(Node node, String expression, List namespaces)` A convenience method to perform a query using the passed node as context and returning the result of the query.
`static NodeSet` | `query(Node node, String expression, String[] namespaces)` A convenience method to perform a query using the passed node as context and returning the result of the query.
`static Node` | `queryFirst(Node node, String expression)` A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.
`static Node` | `queryFirst(Node node, String expression, List namespaces)` A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.
`static Node` | `queryFirst(Node node, String expression, String[] namespaces)` A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.
`void` | `registerResetCache(XPathResetCache reset)` Register an instance of `XPathResetCache` so it will be called when the source document changes

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DOMQuery

    public DOMQuery(String expression)
             throws IllegalArgumentException

  Create a DOMQuery based on the passed expression. The expression must not contain any namespace qualified QNames.

  Parameters:
    `expression` - The string form of the expression for this query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.

### DOMQuery

    public DOMQuery(String expression,
                    NamespaceContext nsContext)
             throws IllegalArgumentException

  Create a DOMQuery based on the passed expression. The passed NamespaceContext is used to resolve any namespace-qualified names in the expression.

  Parameters:
    `expression` - The string form of the expression for this query.
    `nsContext` - The namespace context to be used to resolve namespace- qualified names.
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.

Method Detail

### query

    public static NodeSet query(Node node,
                                String expression)
                         throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
  Returns:
    The resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### query

    public static NodeSet query(Node node,
                                String expression,
                                List namespaces)
                         throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
    `namespaces` - a List containing pairs of strings that specify prefix and URI for a namespace
  Returns:
    The resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### query

    public static NodeSet query(Node node,
                                String expression,
                                String[] namespaces)
                         throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
    `namespaces` - an array of Strings containing pairs of strings that specify prefix and URI for a namespace
  Returns:
    The resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### queryFirst

    public static Node queryFirst(Node node,
                                  String expression)
                           throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
  Returns:
    The first node in document order from the resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### queryFirst

    public static Node queryFirst(Node node,
                                  String expression,
                                  List namespaces)
                           throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
    `namespaces` - a List containing pairs of strings that specify prefix and URI for a namespace
  Returns:
    The first node in document order from the resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### queryFirst

    public static Node queryFirst(Node node,
                                  String expression,
                                  String[] namespaces)
                           throws XPathEvaluationException

  A convenience method to perform a query using the passed node as context and returning the first node in the node-set result of the query.

  Parameters:
    `node` - The context node for the query.
    `expression` - The XPath expression to evaluate
    `namespaces` - an array of Strings containing pairs of strings that specify prefix and URI for a namespace
  Returns:
    The first node in document order from the resulting node set from the query
  Throws:
    `IllegalArgumentException` - If the expression is not syntactically correct or if the expression does not result in a node-set.
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### evaluate

    public NodeSet evaluate(Node node)
                     throws XPathEvaluationException

  Evaluate the DOMQuery expression and return the resulting node-set

  Parameters:
    `node` - The context node for evaluation of the query
  Returns:
    The resulting node-set
  Throws:
    `XPathEvaluationException` - Thrown if there is an error during the evaluation of the expression.

### registerResetCache

    public void registerResetCache(XPathResetCache reset)

  Register an instance of `XPathResetCache` so it will be called when the source document changes

  Specified by:
    `registerResetCache` in interface `XPathResetRegistrar`
  Parameters:
    `reset` - The object implementing `XPathResetCache`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD