net.sf.saxon.functions

Class StringLength

public class StringLength extends SystemFunction

Implement the XPath string-length() function
Method Summary
ItemevaluateItem(XPathContext c)
Evaluate in a general context
intgetIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived from the dependencies of its subexpressions.
ExpressionpreEvaluate(StaticContext env)
Pre-evaluate a function at compile time.
voidsetShortcut()
setShortCut() - used by optimizer when we only need to know if the length is non-zero
Expressionsimplify(StaticContext env)
Simplify and validate.

Method Detail

evaluateItem

public Item evaluateItem(XPathContext c)
Evaluate in a general context

getIntrinsicDependencies

public int getIntrinsicDependencies()
Determine the intrinsic dependencies of an expression, that is, those which are not derived from the dependencies of its subexpressions. For example, position() has an intrinsic dependency on the context position, while (position()+1) does not. The default implementation of the method returns 0, indicating "no dependencies".

Returns: a set of bit-significant flags identifying the "intrinsic" dependencies. The flags are documented in class net.sf.saxon.value.StaticProperty

preEvaluate

public Expression preEvaluate(StaticContext env)
Pre-evaluate a function at compile time. Functions that do not allow pre-evaluation, or that need access to context information, can override this method.

setShortcut

public void setShortcut()
setShortCut() - used by optimizer when we only need to know if the length is non-zero

simplify

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