Package net.sf.saxon.functions
This package provides implementations of all the core functions available for use
in XPath expressions. This includes all the functions defined in the XPath 2.0
Functions and Operators specification, as well as the additional functions
defined for use in XSLT. The package also includes Saxon extension functions. Most
of these are in a single class Extensions
, but some of the more
complex functions are in their own classes, for example Evaluate
implements
saxon:evaluate()
.
There is one class for group of closelyrelated functions. These all inherit from the class
net.sf.saxon.expr.Function. The class StandardFunction
is used to map a function
name to its implementation; it contains tables of information describing the signature of each
function, so that the typechecking code is completely generic.
The package also contains machinery for defining user extension functions. A collection
of functions is represented by a FunctionLibrary
object. There are several
standard function libraries available, covering core functions, Saxon extension functions
constructor functions, and user extension functions: each category is covered by a subclass
of FunctionLibrary
, and there is also a FunctionLibraryList
that
represents the total collection of functions in these individual libraries. The
JavaExtensionLibrary
contains the logic for binding Java extension functions
given their name and arity and the types of their arguments. The class ExtensionFunctionCall
contains the runtime logic for converting XPath values to the required Java types, and for converting
the result back to an XPath value.
These classes, although public, will not normally be used directly by userwritten
Java applications. There are a few exceptions, such as ResolveURI
which deliberately
expose functionality equivalent to the XPath function in a static method.

Interface Summary Interface Description Fold FunctionLibrary A FunctionLibrary handles the binding of function calls in XPath (or XQuery) expressions.PushableFunction Interface implemented by functions that have a "push" implementation, whereby the result of the function is written incrementally to anOutputter
rather than being returned as the result of acall()
method.StatefulSystemFunction 
Class Summary Class Description Abs This class implements the fn:abs() functionAbstractFunction Abstract superclass (and factory class) for implementations of FunctionAccessorFn This class supports the get_X_from_Y functions defined in XPath 2.0AccessorFn.DayFromDate AccessorFn.DayFromDateTime AccessorFn.DaysFromDuration AccessorFn.HoursFromDateTime AccessorFn.HoursFromDuration AccessorFn.HoursFromTime AccessorFn.LocalNameFromQName AccessorFn.MinutesFromDateTime AccessorFn.MinutesFromDuration AccessorFn.MinutesFromTime AccessorFn.MonthFromDate AccessorFn.MonthFromDateTime AccessorFn.MonthsFromDuration AccessorFn.NamespaceUriFromQName AccessorFn.PrefixFromQName AccessorFn.SecondsFromDateTime AccessorFn.SecondsFromDuration AccessorFn.SecondsFromTime AccessorFn.TimezoneFromDate AccessorFn.TimezoneFromDateTime AccessorFn.TimezoneFromTime AccessorFn.YearFromDate AccessorFn.YearFromDateTime AccessorFn.YearsFromDuration AccumulatorFn Nonstreaming implementation of accumulatorbefore() and accumulatorafter()AccumulatorFn.AccumulatorAfter AccumulatorFn.AccumulatorBefore Adjust_1 This class implements the XPath 2.0 functions adjustdatetotimezone(), adjusttimetimezone(), and adjustdateTimetimezone(), with a single argumentAdjust_2 This class implements the XPath 2.0 functions adjustdatetotimezone(), adjusttimetimezone(), and adjustdateTimetimezone(), with two argumentsAggregate This abstract class provides functionality common to the sum(), avg(), count(), exists(), and empty() functions.AnalyzeStringFn Implements the fn:analyzestring function defined in XPath 3.0.ApplyFn This class implements the function fn:apply(), which is a standard function in XQuery 3.1.AvailableEnvironmentVariables AvailableSystemProperties Average Implementation of the fn:avg functionBaseUri_1 This class implements the fn:baseuri() function in XPath 2.0BooleanFn This class supports the XPath function boolean()CallableFunction A function item that wraps a CallableCeiling This class supports the ceiling() functionCodepointEqual Implements the XPath 2.0 fn:codepointequal() function.CodepointsToString This class implements the function fn:codepointstostring()CollatingFunctionFixed Abstract superclass for functions that take an optional collation argument, in which the collation is not present as an explicit argument, either because it was defaulted in the original function call, or because it has been bound during static analysis.CollatingFunctionFree Generic class for all functions that take an optional collation argument, where the collation argument is supplied and has not yet been resolved.CollationKeyFn Implements the collationkey function defined in the XSLT 3.0 and XPath 3.1 specificationsCollectionFn Implement the fn:collection() function.Compare This class implements the XPath 2.0 fn:compare() functionConcat Implementation of the fn:concat() functionConstantFunction A ConstantFunction is a zeroargument function that always delivers the same result, supplied at the time the function is instantiated.ConstantFunction.False ConstantFunction.True Contains Implements the fn:contains() function, with the collation already knownContainsToken Implements the fn:containstoken() function with the collation already bound.ContextAccessorFunction A ContextAccessorFunction is a function that is dependent on the dynamic context.ContextItemAccessorFunction A ContextItemAccessorFunction is a function that takes no arguments, but operates implicitly on the context item.ContextItemAccessorFunction.Number_0 Subclass of ContextItemAccessorFunction to handle number().ContextItemAccessorFunction.StringAccessor Subclass of ContextItemAccessorFunction to handle stringlength() and normalizespace().CopyOfFn XSLT 3.0 function copyof().Count Implementation of the fn:count functionCurrent Implement the XSLT current() functionCurrentGroup Implements the XSLT function currentgroup()CurrentGroupCall Implements the XSLT function currentgroup()CurrentGroupingKey Implements the XSLT function currentgroupingkey()CurrentGroupingKeyCall Implements the XSLT function currentgroupingkey()CurrentMergeGroup Implements the XSLT 3.0 function currentmergegroup()CurrentMergeKey Implements the XSLT function currentgroupingkey()CurrentOutputUri This class implements the XSLT 3.0 function currentoutputuri()Data_1 Implement XPath function fn:data() with a single argumentDateTimeConstructor This class supports the dateTime($date, $time) functionDeepEqual XSLT 2.0 deepequal() function, where the collation is already known.DistinctValues The XPath 2.0 distinctvalues() function, with the collation argument already knownDistinctValues.DistinctIterator Iterator class to return the distinct values in a sequenceDoc Implement the fn:doc() function  a simplified form of the Document functionDoc_2 Implement the saxon:doc() function  a variant of the fn:doc function with a second argument to supply option parameters.DocAvailable Implement the fn:docavailable() functionDocumentFn Implements the XSLT document() functionDocumentUri_1 This class supports the documenturi() functionDynamicContextAccessor A DynamicContextAccessor is a function that takes no arguments, but operates implicitly on the dynamic context.DynamicContextAccessor.CurrentDate DynamicContextAccessor.CurrentDateTime DynamicContextAccessor.CurrentTime DynamicContextAccessor.DefaultLanguage DynamicContextAccessor.ImplicitTimezone ElementAvailable This class supports the XSLT elementavailable function.Empty Implementation of the fn:empty functionEncodeForUri This class supports the function fn:encodeforuri()EndsWith Implements the fn:endswith() function, with the collation already fixedEnvironmentVariable Implement the XPath 3.0 fn:environmentvariable() functionError Implement XPath function fn:error()EscapeHtmlUri This class supports the function fn:escapehtmluri()ExecutableFunctionLibrary An ExecutableFunctionLibrary is a function library that contains definitions of functions for use at runtime.Exists Implementation of the fn:exists functionFloor This class implements the fn:floor() functionFoldingFunction Implementation of aggregate functions such as sum() and avg() that supply a fold() function.FormatDate Implement the formatdate(), formattime(), and formatdateTime() functions in XSLT 2.0 and XQuery 1.1.FormatInteger FormatNumber Implementation of formatnumber() function.FunctionAvailable This class implements the XSLT functionavailable functions.FunctionLibraryList A FunctionLibraryList is a list of FunctionLibraries.GenerateId_1 This class supports the generateid() function with one argumentHasChildren_1 This class implements the function fn:haschildren($node), which is a standard function in XPath 3.0HeadFn This class implements the function fn:head(), which is a standard function in XPath 3.0Idref IndexOf The XPath 2.0 indexof() function, with the collation already knownInnermost This class implements the function fn:haschildren(), which is a standard function in XPath 3.0InScopePrefixes This class implements the XPath 2.0 function fn:inscopeprefixes()InsertBefore The XPath 2.0 insertbefore() functionInsertBefore.InsertIterator Insertion iterator.IntegratedFunctionCall Expression representing a call to a userwritten extension function implemented as a subtype ofExtensionFunctionCall
IntegratedFunctionCall.ConfigurationCheckingFunction This class checks that NodeInfo objects returned by an extension function were created under the right ConfigurationIntegratedFunctionLibrary A library of integrated function calls, that is, userwritten extension functions implemented as instances of the class IntegratedFunction.IriToUri This class supports the functions encodeforuri() and iritouri()IsIdRef This class implements the saxon:isidref() extension function, which is speciallyrecognized by the system because calls are generated by the optimizer.KeyFn KeyFn.SubtreeFilter Mapping class to filter nodes that have the origin node as an ancestororselfLang LocalName_1 This class supports the localname() functionLowerCase This class implements the fn:lowercase() functionMatches This class implements the 3argument matches() function for regular expression matchingMathFunctionSet Abstract class providing functionality common to functions math:sin(), math:cos(), math:sqrt() etc; contains the concrete implementations of these functions as inner subclassesMathFunctionSet.AcosFn Implement math:acosMathFunctionSet.AsinFn Implement math:asinMathFunctionSet.Atan2Fn Implement math:atan2MathFunctionSet.AtanFn Implement math:atanMathFunctionSet.CosFn Implement math:cosMathFunctionSet.Exp10Fn Implement math:exp10MathFunctionSet.ExpFn Implement math:expMathFunctionSet.Log10Fn Implement math:log10MathFunctionSet.LogFn Implement math:logMathFunctionSet.PiFn Implement math:piMathFunctionSet.PowFn Implement math:powMathFunctionSet.SinFn Implement math:sinMathFunctionSet.SqrtFn Implement math:sqrtMathFunctionSet.TanFn Implement math:tanMinimax This class implements the min() and max() functions, with the collation argument already known.Minimax.Max Concrete subclass to define the fn:max() functionMinimax.Min Concrete subclass to define the fn:min() functionName_1 This class supports the name() function with one argumentNamespaceForPrefix This class supports the function namespaceuriforprefix()NamespaceUri_1 This class supports the namespaceuri() functionNilled_1 This class supports the nilled() functionNodeName_1 This class supports the nodename() function with a single argumentNormalizeSpace_1 Implement the XPath normalizespace() functionNormalizeUnicode Implement the XPath normalizeunicode() function (both the 1argument and 2argument versions)NotFn This class supports the XPath functions boolean(), not(), true(), and false()Number_1 Implements the XPath fn:number() function when called with one argument.OptionsParameter This class implements the rules for options parameters, as used in functions such as parsejson, serialize, jsontoXML, map:merge.Outermost This class implements the function fn:outermost(), which is a standard function in XPath 3.0ParseIetfDate This class implements the function parseietfdate(), which is a standard function in XPath 3.1ParseXml ParseXml.RetentiveErrorHandler ParseXmlFragment Path_1 Implement the fn:path function with one argumentPositionAndLast PositionAndLast.Last PositionAndLast.Position Put Implements the fn:put() function in XQuery Update 1.0.QNameFn This class supports the fn:QName() function (previously named fn:expandedQName())RegexFunction This class implements any of the functions matches(), replace(), tokenize(), analyzestring(), in the version where a flags argument is present in the argument listRegexFunctionSansFlags This class implements any of the functions matches(), replace(), tokenize(), analyzestring(), in which the final "flags" argument is omitted.RegexGroup Remove The XPath 2.0 remove() functionRemove.RemoveIterator An implementation of SequenceIterator that returns all items except the one at a specified position.Replace This class implements the replace() function for replacing substrings that match a regular expressionResolveQName This class supports the resolveQName function in XPath 2.0ResolveURI This class supports the resolveuri() function in XPath 2.0Reverse Implement XPath function fn:reverse()Root_1 Implement the XPath 2.0 root() function with one argumentRound This class implements the fn:round() functionRoundHalfToEven This class supports the roundtohalfeven() functionScalarSystemFunction A Scalar system function is a pure function that accepts a single item as its operand, returns a single atomic value as its result, typically returns an empty sequence if the argument is an empty sequence, and has no context dependencies.Serialize Implementation of fn:serialize() as defined in XPath 3.1SnapshotFn XSLT 3.0 function snapshot().Sort_1 This class implements the function fn:sort#1, which is a standard function in XPath 3.1Sort_1.ItemToBeSorted Sort_2 This class implements the function fn:sort#2, according to the new XPath 3.1 spec in bug 29792StartsWith Implements the fn:startswith() function, with the collation already knownStaticBaseUri Implement the XPath function staticbaseuri()StaticContextAccessor A StaticContextAccessor is a function that takes no arguments, but operates implicitly on the static context.StaticContextAccessor.DefaultCollation Implement the XPath function defaultcollation()StreamAvailable This class implements the XSLT 3.0 function streamavailable()String_1 Implement XPath function string() with a single argumentStringJoin fn:stringjoin(string* $sequence, string $separator)StringLength_1 Implement the XPath stringlength() functionStringToCodepoints This class supports the function stringtocodepoints()Subsequence_2 Implements the XPath 2.0 subsequence() function with two argumentsSubsequence_3 Implements the XPath 2.0 subsequence() function with three argumentsSubstring This class implements the XPath substring() functionSubstringAfter Implements the fn:substringafter() function with the collation already knownSubstringBefore Implements the fn:substringbefore() function with the collation already knownSum Implementation of the fn:sum functionSuperId The XPath id() or elementwithid() function XPath 2.0 version: accepts any sequence as the first parameter; each item in the sequence is taken as an IDREFS value, that is, a spaceseparated list of ID values.SuperId.ElementWithId SuperId.Id SystemFunction Abstract superclass for calls to functions in the standard function librarySystemProperty Implementation of the XSLT systemproperty() functionTailFn This class implements the function fn:tail(), which is a standard function in XPath 3.0Tokenize_1 This class implements the singleargument tokenize() function introduced in XPath 3.1Tokenize_3 This class implements the 3argument tokenize() function for regular expression matching.Trace This class supports the XPath 2.0 function trace().TransformFn This class implements the function transform(), which is a standard function in XPath 3.1Translate Implement the XPath translate() functionTreatFn This class supports the XPath 2.0 functions exactlyone(), oneormore(), zeroorone().TreatFn.ExactlyOne TreatFn.OneOrMore TreatFn.ZeroOrOne TypeAvailable This class supports the XSLT fn:typeavailable() function.Unordered XPath 2.0 unordered() functionUnparsedEntity Implements the unparsedentityuri() function defined in XSLT 1.0 and the unparsedentitypublicid() function defined in XSLT 2.0UnparsedEntity.UnparsedEntityPublicId UnparsedEntity.UnparsedEntityUri UnparsedText Implementation of fn:unparsedtext()  with one argument or twoUnparsedTextAvailable UnparsedTextFunction Abstract superclass containing common code supporting the functions unparsedtext(), unparsedtextlines(), and unparsedtextavailable()UnparsedTextLines UpperCase This class implements the fn:uppercase() functionUriCollection Implement the fn:uricollection() function (new in XQuery 3.0/XSLT 3.0).URIQueryParameters A set of query parameters on a URI passed to the collection() or document() functionURIQueryParameters.RegexFilter A FilenameFilter that tests file names against a regular expression 
Enum Summary Enum Description AccessorFn.Component AccumulatorFn.Phase 
Exception Summary Exception Description Error.UserDefinedXPathException