net.sf.saxon.functions

Class StringFn

public class StringFn extends SystemFunction implements DivisibleInstruction

Implement XPath function string()
Method Summary
PathMap.PathMapNodeSetaddDocToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodes)
Add a representation of a doc() call or similar function to a PathMap.
ItemevaluateItem(XPathContext c)
Evaluate the function
voidprocessLeft(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the first half of the instruction (for example, to start a new document or element)
voidprocessRight(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the right half of the instruction (for example, to end a new document or element) Note that unlike other divisible instructions this one doesn't push the result to the current output destination, it leaves a sequenceIterator over the result on the stack.
Expressionsimplify(ExpressionVisitor visitor)
Simplify and validate.

Method Detail

addDocToPathMap

public PathMap.PathMapNodeSet addDocToPathMap(PathMap pathMap, PathMap.PathMapNodeSet pathMapNodes)
Add a representation of a doc() call or similar function to a PathMap. This is a convenience method called by the addToPathMap() methods for doc(), document(), collection() and similar functions. These all create a new root expression in the path map.

Parameters: pathMap the PathMap to which the expression should be added pathMapNodes the node in the PathMap representing the focus at the point where this expression is called. Set to null if this expression appears at the top level.

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

evaluateItem

public Item evaluateItem(XPathContext c)
Evaluate the function

processLeft

public void processLeft(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the first half of the instruction (for example, to start a new document or element)

Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()

processRight

public void processRight(Stack<XPathContext> contextStack, Stack state)
In streaming mode, process the right half of the instruction (for example, to end a new document or element) Note that unlike other divisible instructions this one doesn't push the result to the current output destination, it leaves a sequenceIterator over the result on the stack.

Parameters: contextStack state a stack on which the instruction can save state information during the call on processLeft()

simplify

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

Parameters: visitor an expression visitor