com.xml_project.morganaxproc.core
Class XPathInXProcSelector

java.lang.Object
  extended by com.xml_project.morganaxproc.core.XPathInXProcSelector

public class XPathInXProcSelector
extends java.lang.Object

Instancing of this class represent a ready to run XPath expression


Method Summary
 java.lang.String getExpression()
           Returns the expression represented in this XPath match pattern as string.
 XdmSequence run(nu.xom.Node context)
           Return an XdmSequence with the selected nodes.
 boolean runToBoolean(nu.xom.Node context)
           Returns the effective boolean value for the expression and the context node.
 nu.xom.Document[] runToDocuments(nu.xom.Node context)
           Evaluates the expression for the given context node.
 nu.xom.Node[] runToNodes(nu.xom.Node context)
           Returns a Node array with the selected nodes.
 XS_UntypedAtomic runToValue(nu.xom.Node context)
           Evaluates the given expression for the given context node to an xs:untypedAtomic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

run

public XdmSequence run(nu.xom.Node context)
                throws XPathException

Return an XdmSequence with the selected nodes. Use runToNodes() if you do not need an XdmSequence.

Parameters:
context - the context node
Returns:
an XdmSequence
Throws:
XPathException - if an error occurred during evaluation.

runToValue

public XS_UntypedAtomic runToValue(nu.xom.Node context)
                            throws XPathException

Evaluates the given expression for the given context node to an xs:untypedAtomic. Use getStringValue() to get the actual value.

Parameters:
context - the context node
Returns:
an XS_UntypedAtomic
Throws:
XPathException - if an error occurred during evaluation.

runToBoolean

public boolean runToBoolean(nu.xom.Node context)
                     throws XPathException

Returns the effective boolean value for the expression and the context node.

Parameters:
context - the context node.
Returns:
the effective boolean value.
Throws:
XPathException - if an error occurred during evaluation.

runToDocuments

public nu.xom.Document[] runToDocuments(nu.xom.Node context)
                                 throws XPathException

Evaluates the expression for the given context node. Results of type element are wrapped into a document.
An Exception is thrown if the expression does not evaluate to an element or a document.

Parameters:
context - the context node
Returns:
a document array.
Throws:
XPathException - if an error occurred during evaluation.

runToNodes

public nu.xom.Node[] runToNodes(nu.xom.Node context)
                         throws XPathException

Returns a Node array with the selected nodes.

Parameters:
context - the context node
Returns:
a node array,
Throws:
XPathException - if an error occurred during evaluation.

getExpression

public java.lang.String getExpression()

Returns the expression represented in this XPath match pattern as string.

Returns:
the expression.