net.sf.saxon.expr
public final class PathExpression extends SlashExpression implements ContextMappingFunction
This class inherits from SlashExpression; it is used in the common case where the SlashExpression is known to return nodes rather than atomic values.
This class is not responsible for sorting the results into document order or removing duplicates. That is done by a DocumentSorter expression which is wrapped around the path expression. However, this class does contain the logic for deciding statically whether the DocumentSorter is needed or not.
Constructor Summary | |
---|---|
PathExpression(Expression start, Expression step)
Constructor |
Method Summary | |
---|---|
Expression | addDocumentSorter()
Add a document sorting node to the expression tree, if needed |
PathMap.PathMapNodeSet | addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
Add a representation of this expression to a PathMap. |
int | computeSpecialProperties()
Get the static properties of this expression (other than its type). |
Expression | copy()
Copy an expression. |
void | explain(ExpressionPresenter destination)
Diagnostic print of expression structure. |
Expression | getRemainingSteps()
Get all steps after the first.
|
boolean | isAbsolute(TypeHierarchy th)
Test whether a path expression is an absolute path - that is, a path whose first step selects a
document node |
boolean | isHybrid() |
SequenceIterator | iterate(XPathContext context)
Iterate the path-expression in a given context |
Expression | optimize(ExpressionVisitor visitor, ItemType contextItemType)
Optimize the expression and perform type analysis |
Expression | promote(PromotionOffer offer, Expression parent)
Promote this expression if possible |
Expression | simplify(ExpressionVisitor visitor)
Simplify an expression |
String | toString()
The toString() method for an expression attempts to give a representation of the expression
in an XPath-like form, but there is no guarantee that the syntax will actually be true XPath.
|
PathExpression | tryToMakeAbsolute(TypeHierarchy th)
Test whether a path expression is an absolute path - that is, a path whose first step selects a
document node; if not, see if it can be converted to an absolute path. |
Expression | typeCheck(ExpressionVisitor visitor, ItemType contextItemType)
Perform type analysis |
Parameters: start A node-set expression denoting the absolute or relative set of nodes from which the navigation path should start. step The step to be followed from each node in the start expression to yield a new node-set
Parameters: pathMap the PathMap to which the expression should be added pathMapNodeSet
Returns: the pathMapNode representing the focus established by this expression, in the case where this expression is the first operand of a path expression or filter expression
Returns: the copy of the original expression
Returns: a path expression containing all steps in this path expression other than the first, after expanding any nested path expressions
Parameters: th the type hierarchy cache
Returns: true if the first step in this path expression selects a document node
Parameters: context the evaluation context
Parameters: visitor the expression visitor
Returns: the simplified expression
Parameters: th the type hierarchy cache
Returns: the path expression if it is absolute; the converted path expression if it can be made absolute; or null if neither condition applies.