|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xml.dom.DOMQuery
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 |
public DOMQuery(String expression) throws IllegalArgumentException
expression
- The string form of the expression for this query
IllegalArgumentException
- If the expression is not syntactically
correct or if the expression does not result in a node-set.public DOMQuery(String expression, NamespaceContext nsContext) throws IllegalArgumentException
expression
- The string form of the expression for this query.nsContext
- The namespace context to be used to resolve namespace-
qualified names.
IllegalArgumentException
- If the expression is not syntactically
correct or if the expression does not result in a node-set.Method Detail |
public static NodeSet query(Node node, String expression) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluate
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.public static NodeSet query(Node node, String expression, List namespaces) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluatenamespaces
- a List containing pairs of strings that specify prefix and URI for a namespace
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.public static NodeSet query(Node node, String expression, String[] namespaces) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluatenamespaces
- an array of Strings containing pairs of strings that specify prefix and URI for a namespace
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.public static Node queryFirst(Node node, String expression) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluate
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.public static Node queryFirst(Node node, String expression, List namespaces) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluatenamespaces
- a List containing pairs of strings that specify prefix and URI for a namespace
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.public static Node queryFirst(Node node, String expression, String[] namespaces) throws XPathEvaluationException
node
- The context node for the query.expression
- The XPath expression to evaluatenamespaces
- an array of Strings containing pairs of strings that specify prefix and URI for a namespace
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.public NodeSet evaluate(Node node) throws XPathEvaluationException
node
- The context node for evaluation of the query
XPathEvaluationException
- Thrown if there is an error
during the evaluation of the expression.public void registerResetCache(XPathResetCache reset)
XPathResetCache
so
it will be called when the source document changes
registerResetCache
in interface XPathResetRegistrar
reset
- The object implementing XPathResetCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |