javax.xml.xpath

Interface XPath

public interface XPath

Interface to the XPath evaluation environment.

Since: 1.3

Method Summary
XPathExpressioncompile(String expression)
Compiles an XPath expression for future evaluation.
Objectevaluate(String expression, Object item, QName returnType)
Evaluates an expression.
Stringevaluate(String expression, Object item)
Evaluates an expression and returns the result as a string.
Objectevaluate(String expression, InputSource source, QName returnType)
Evaluates an expression.
Stringevaluate(String expression, InputSource source)
Evaluates an expression and returns the result as a string.
NamespaceContextgetNamespaceContext()
XPathFunctionResolvergetXPathFunctionResolver()
XPathVariableResolvergetXPathVariableResolver()
voidreset()
Resets the environment.
voidsetNamespaceContext(NamespaceContext nsContext)
voidsetXPathFunctionResolver(XPathFunctionResolver resolver)
voidsetXPathVariableResolver(XPathVariableResolver resolver)

Method Detail

compile

public XPathExpression compile(String expression)
Compiles an XPath expression for future evaluation.

Parameters: expression the expression

evaluate

public Object evaluate(String expression, Object item, QName returnType)
Evaluates an expression.

Parameters: expression the expression item the expression context returnType the desired return type

evaluate

public String evaluate(String expression, Object item)
Evaluates an expression and returns the result as a string.

Parameters: expression the expression item the expression context

evaluate

public Object evaluate(String expression, InputSource source, QName returnType)
Evaluates an expression.

Parameters: expression the expression source the source to load the expression context from returnType the desired return type

evaluate

public String evaluate(String expression, InputSource source)
Evaluates an expression and returns the result as a string.

Parameters: expression the expression source the source to load the expression context from

getNamespaceContext

public NamespaceContext getNamespaceContext()

getXPathFunctionResolver

public XPathFunctionResolver getXPathFunctionResolver()

getXPathVariableResolver

public XPathVariableResolver getXPathVariableResolver()

reset

public void reset()
Resets the environment.

setNamespaceContext

public void setNamespaceContext(NamespaceContext nsContext)

setXPathFunctionResolver

public void setXPathFunctionResolver(XPathFunctionResolver resolver)

setXPathVariableResolver

public void setXPathVariableResolver(XPathVariableResolver resolver)