net.sf.saxon.functions

Class NumberFn

public class NumberFn extends SystemFunction implements MappingFunction

Implements the XPath number() function. This can also be used as a mapping function in a MappingIterator to map a sequence of values to numbers.
Method Summary
static DoubleValueconvert(AtomicValue value)
Static method to perform the same conversion as the number() function.
ItemevaluateItem(XPathContext context)
Evaluate in a general context
Objectmap(Item item, XPathContext context)
Mapping function for use when converting a sequence of atomic values to doubles using the rules of the number() function
Expressionsimplify(StaticContext env)
Simplify and validate.

Method Detail

convert

public static DoubleValue convert(AtomicValue value)
Static method to perform the same conversion as the number() function. This is different from the convert(Type.DOUBLE) in that it produces NaN rather than an error for non-numeric operands.

evaluateItem

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

map

public Object map(Item item, XPathContext context)
Mapping function for use when converting a sequence of atomic values to doubles using the rules of the number() function

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