org.exolab.adaptx.xpath.expressions
Class PathExpr
java.lang.Object
org.exolab.adaptx.xpath.expressions.PathExpr
- MatchExpression, XPathExpression
public abstract class PathExpr
extends java.lang.Object
An abstract class representing an XPath Location Path
expression.
Version:
- Keith Visco
BOOLEAN , ERROR , FILTER_EXPR , LOCATION_PATH , NODE_TEST , NUMBER , PATH_EXPR , PRIMARY , STEP , STRING , UNION_EXPR |
XPathResult | evaluate(XPathContext context) - Evaluates the expression and returns the XPath result.
|
double | getDefaultPriority() - Determines the priority of a PatternExpr as follows:
From the 19991116 XSLT 1.0 Recommendation:
+ If the pattern has the form of a QName preceded by a
ChildOrAttributeAxisSpecifier or has the form
processing-instruction(Literal) then the priority is 0.
|
short | getExprType() - Returns the XPathExpression type
|
PathComponent | getPathComponent() - Returns the PathComponent for the this PathExpr, either
a FilterExpr or LocationStep.
|
PathExpr | getSubPath()
|
boolean | isAbsolute() - Returns true if this PathExpr is an absolute expression,
otherwise false (ie.
|
boolean | matches(XPathNode node, XPathContext context) - Determines if the given node is matched by this MatchExpr with
respect to the given context.
|
getDefaultPriority
public double getDefaultPriority()
Determines the priority of a PatternExpr as follows:
From the 19991116 XSLT 1.0 Recommendation:
+ If the pattern has the form of a QName preceded by a
ChildOrAttributeAxisSpecifier or has the form
processing-instruction(Literal) then the priority is 0.
+ If the pattern has the form NCName:* preceded by a
ChildOrAttributeAxisSpecifier, then the priority is -0.25
+ Otherwise if the pattern consists of just a NodeTest
preceded by a ChildOrAttributeAxisSpecifier then the
priority is -0.5
+ Otherwise the priority is 0.5
- the priority for this PatternExpr
getPathComponent
public PathComponent getPathComponent()
Returns the PathComponent for the this PathExpr, either
a FilterExpr or LocationStep.
- the PathComponent for this PathExpr
isAbsolute
public boolean isAbsolute()
Returns true if this PathExpr is an absolute expression,
otherwise false (ie. it's a relative expression).
- true if this PathExpr is an absolute expression.
matches
public boolean matches(XPathNode node,
XPathContext context)
throws XPathException
Determines if the given node is matched by this MatchExpr with
respect to the given context.
- matches in interface MatchExpression
node
- the node to determine a match forcontext
- the XPathContext
- true if the given node is matched by this MatchExpr
XPathException
- when an error occurs during
evaluation