Class StringFn

  extended by net.sf.saxon.expr.Expression
      extended by net.sf.saxon.expr.FunctionCall
          extended by net.sf.saxon.functions.SystemFunction
              extended by net.sf.saxon.functions.StringFn
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, EvaluableItem, SequenceIterable, InstructionInfo, Locator

public class StringFn
extends SystemFunction

Implement XPath function string()

See Also:
Serialized Form

Field Summary
Fields inherited from class net.sf.saxon.functions.SystemFunction
Fields inherited from class net.sf.saxon.expr.FunctionCall
Fields inherited from class net.sf.saxon.expr.Expression
Constructor Summary
Method Summary
 PathMap.PathMapNodeSet addToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodeSet)
          Add a representation of this expression to a PathMap.
 Item evaluateItem(XPathContext c)
          Evaluate the function
 int getImplementationMethod()
          An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process().
 Expression optimize(ExpressionVisitor visitor, ItemType contextItemType)
          Perform optimisation of an expression and its subexpressions.
 Expression simplify(ExpressionVisitor visitor)
          Simplify and validate.
Methods inherited from class net.sf.saxon.functions.SystemFunction
addContextDocumentArgument, addDocToPathMap, checkArguments, computeCardinality, computeSpecialProperties, copy, getDetails, getErrorCodeForTypeErrors, getItemType, getRequiredType, makeSystemFunction, setDetails, useContextItemAsDefault
Methods inherited from class net.sf.saxon.expr.FunctionCall
addExternalFunctionCallToPathMap, checkArgumentCount, equals, explain, getArguments, getDisplayName, getExpressionName, 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, getEvaluationMethod, getExecutable, getHostLanguage, 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, setEvaluationMethod, setFiltered, setFlattened, setLocationId, staticTypeCheck, suppressValidation, typeError
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail


public StringFn()
Method Detail


public int getImplementationMethod()
An implementation of Expression must provide at least one of the methods evaluateItem(), iterate(), or process(). This method indicates which of these methods is provided directly. The other methods will always be available indirectly, using an implementation that relies on one of the other methods.

getImplementationMethod in class SystemFunction
the implementation method, for example Expression.ITERATE_METHOD or Expression.EVALUATE_METHOD or Expression.PROCESS_METHOD


public Expression simplify(ExpressionVisitor visitor)
                    throws XPathException
Simplify and validate. This is a pure function so it can be simplified in advance if the arguments are known

simplify in class FunctionCall
visitor - an expression visitor
the simplified expression
XPathException - if an error is discovered during expression rewriting


public Expression optimize(ExpressionVisitor visitor,
                           ItemType contextItemType)
                    throws XPathException
Perform optimisation of an expression and its subexpressions.

This method is called after all references to functions and variables have been resolved to the declaration of the function or variable, and after all type checking has been done.

optimize in class SystemFunction
visitor - an expression visitor
contextItemType - the static type of "." at the point where this expression is invoked. The parameter is set to null if it is known statically that the context item will be undefined. If the type of the context item is not known statically, the argument is set to Type.ITEM_TYPE
the original expression, rewritten if appropriate to optimize execution
XPathException - if an error is discovered during this phase (typically a type error)


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.

addToPathMap in class Expression
pathMap - the PathMap to which the expression should be added
pathMapNodeSet - the PathMapNodeSet to which the paths embodied in this expression should be added
the pathMapNodeSet representing the points in the source document that are both reachable by this expression, and that represent possible results of this 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.


public Item evaluateItem(XPathContext c)
                  throws XPathException
Evaluate the function

Specified by:
evaluateItem in interface EvaluableItem
evaluateItem in class Expression
c - The context in which the expression is to be evaluated
the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
XPathException - if any dynamic error occurs evaluating the expression

Copyright (c) 2004-2010 Saxonica Limited. All rights reserved.