net.sf.saxon.functions
Class Root
java.lang.Object
net.sf.saxon.expr.Expression
net.sf.saxon.expr.FunctionCall
net.sf.saxon.functions.SystemFunction
net.sf.saxon.functions.Root
- All Implemented Interfaces:
- Serializable, SourceLocator, LocationProvider, SaxonLocator, EvaluableItem, SequenceIterable, InstructionInfo, Locator
public class Root
- extends SystemFunction
Implement the XPath 2.0 root() function
- See Also:
- Serialized Form
Constructor Summary |
Root()
|
Methods inherited from class net.sf.saxon.functions.SystemFunction |
addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, optimize, setDetails, useContextItemAsDefault |
Methods inherited from class net.sf.saxon.expr.FunctionCall |
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getFunctionName, getNumberOfArguments, hashCode, iterateSubExpressions, preEvaluate, promote, replaceSubExpression, setArguments, setFunctionName, simplifyArguments, toString, typeCheck |
Methods inherited from class net.sf.saxon.expr.Expression |
adoptChildExpression, checkForUpdatingSubexpressions, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, evaluateAsString, evaluatePendingUpdates, explain, getCardinality, getColumnNumber, getColumnNumber, getConstructType, getContainer, getDependencies, getExecutable, getHostLanguage, getImplementationMethod, getIntrinsicDependencies, getLineNumber, getLineNumber, getLocationId, getLocationProvider, getObjectName, getProperties, getProperty, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, getSystemId, hasLoopingSubexpression, implementsStaticTypeCheck, isSubtreeExpression, isUpdatingExpression, isVacuousExpression, iterate, iterateEvents, iterateSameFocusSubExpressions, markTailFunctionCalls, process, resetLocalStaticProperties, setContainer, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError |
Root
public Root()
simplify
public Expression simplify(ExpressionVisitor visitor)
throws XPathException
- Simplify and validate.
- Overrides:
simplify
in class FunctionCall
- Parameters:
visitor
- an expression visitor
- Returns:
- the simplified expression
- Throws:
XPathException
- if an error is discovered during expression
rewriting
computeSpecialProperties
public int computeSpecialProperties()
- Get the static properties of this expression (other than its type). The result is
bit-significant. These properties are used for optimizations. In general, if
property bit is set, it is true, but if it is unset, the value is unknown.
- Overrides:
computeSpecialProperties
in class SystemFunction
- Returns:
- the special properties, as a bit-significant integer
addToPathMap
public PathMap.PathMapNodeSet addToPathMap(PathMap pathMap,
PathMap.PathMapNodeSet pathMapNodeSet)
- Add a representation of this expression to a PathMap. The PathMap captures a map of the nodes visited
by an expression in a source tree.
The default implementation of this method assumes that an expression does no navigation other than
the navigation done by evaluating its subexpressions, and that the subexpressions are evaluated in the
same context as the containing expression. The method must be overridden for any expression
where these assumptions do not hold. For example, implementations exist for AxisExpression, ParentExpression,
and RootExpression (because they perform navigation), and for the doc(), document(), and collection()
functions because they create a new navigation root. Implementations also exist for PathExpression and
FilterExpression because they have subexpressions that are evaluated in a different context from the
calling expression.
- Overrides:
addToPathMap
in class Expression
- Parameters:
pathMap
- the PathMap to which the expression should be addedpathMapNodeSet
-
- 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. For an expression that does
navigation, it represents the end of the arc in the path map that describes the navigation route. For other
expressions, it is the same as the input pathMapNode.
evaluateItem
public Item evaluateItem(XPathContext c)
throws XPathException
- Evaluate in a general context
- Specified by:
evaluateItem
in interface EvaluableItem
- Overrides:
evaluateItem
in class Expression
- Parameters:
c
- The context in which the expression is to be evaluated
- Returns:
- the node or atomic value that results from evaluating the
expression; or null to indicate that the result is an empty
sequence
- Throws:
XPathException
- if any dynamic error occurs evaluating the
expression
Copyright (c) Saxonica Limited. All rights reserved.