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 closely-related 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 type-checking 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 run-time 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 user-written
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() functionAbs.AbsElaborator AbstractFunction Abstract superclass (and factory class) for implementations of FunctionAccessorFn This class supports the get_X_from_Y functions defined in XPath 2.0AccessorFn.AccessorFnElaborator Elaborator for accessor functions such as hours-from-date-Time, minutes-from-durationAccessorFn.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 Non-streaming implementation of accumulator-before() and accumulator-after()AccumulatorFn.AccumulatorAfter AccumulatorFn.AccumulatorBefore Adjust_1 This class implements the XPath 2.0 functions adjust-date-to-timezone(), adjust-time-timezone(), and adjust-dateTime-timezone(), with a single argumentAdjust_2 This class implements the XPath 2.0 functions adjust-date-to-timezone(), adjust-time-timezone(), and adjust-dateTime-timezone(), with two argumentsAggregate This abstract class provides functionality common to the sum(), avg(), count(), exists(), and empty() functions.AnalyzeStringFn Implements the fn:analyze-string function defined in XPath 3.0.ApplyFn This class implements the function fn:apply(), which is a standard function in XQuery 3.1.AtomicEqual Implements the XPath 4.0 fn:atomic-equal() function.AvailableEnvironmentVariables AvailableSystemProperties Average Implementation of the fn:avg functionBaseUri_1 This class implements the fn:base-uri() function in XPath 2.0BaseUri_1.BaseUriFnElaborator Elaborator for simple string-valued properties of nodes such as name(), local-name(), namespace-uri(), and generate-id()BooleanFn This class supports the XPath function boolean()BooleanFn.BooleanFnElaborator CallableFunction A function item that wraps a CallableCeiling This class supports the ceiling() functionCeiling.CeilingElaborator CodepointEqual Implements the XPath 2.0 fn:codepoint-equal() function.CodepointsToString This class implements the function fn:codepoints-to-string()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 collation-key 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() functionConcat31 Implementation of the fn:concat() function as defined in XPath 2.0, 3.0, and 3.1ConstantFunction A ConstantFunction is a zero-argument 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 knownContains.ContainsFnElaborator Expression elaborator for a call to contains(), starts-with(), or ends-with()ContainsToken Implements the fn:contains-token() 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 string-length() and normalize-space().CopyOfFn XSLT 3.0 function copy-of().Count Implementation of the fn:count functionCount.CountFnElaborator Current Implement the XSLT current() functionCurrentGroup Implements the XSLT function current-group()CurrentGroupCall Implements the XSLT function current-group()CurrentGroupingKey Implements the XSLT function current-grouping-key()CurrentGroupingKeyCall Implements the XSLT function current-grouping-key()CurrentMergeGroup Implements the XSLT 3.0 function current-merge-group()CurrentMergeKey Implements the XSLT function current-grouping-key()CurrentOutputUri This class implements the XSLT 3.0 function current-output-uri()Data_1 Implement XPath function fn:data() with a single argumentDateTimeConstructor This class supports the dateTime($date, $time) functionDateTimeConstructor.DateTimeFnElaborator DeepEqual XSLT 2.0 deep-equal() function, where the collation is already known.DeepEqual.DeepEqualOptions DistinctValues The XPath 2.0 distinct-values() 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:doc-available() functionDocumentFn Implements the XSLT document() functionDocumentUri_1 This class supports the document-uri() 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 element-available function.Empty Implementation of the fn:empty functionEncodeForUri This class supports the function fn:encode-for-uri()EndsWith Implements the fn:ends-with() function, with the collation already fixedEnvironmentVariable Implement the XPath 3.0 fn:environment-variable() functionError Implement XPath function fn:error()EscapeHtmlUri This class supports the function fn:escape-html-uri()ExecutableFunctionLibrary An ExecutableFunctionLibrary is a function library that contains definitions of functions for use at run-time.Exists Implementation of the fn:exists functionFloor This class implements the fn:floor() functionFloor.FloorElaborator FoldingFunction Implementation of aggregate functions such as sum() and avg() that supply a fold() function.FormatDate Implement the format-date(), format-time(), and format-dateTime() functions in XSLT 2.0 and XQuery 1.1.FormatInteger FormatNumber Implementation of format-number() function.FormatNumber.SubPicture Inner class to represent one sub-picture (the negative or positive subpicture)FunctionAvailable This class implements the XSLT function-available functions.FunctionLibraryList A FunctionLibraryList is a list of FunctionLibraries.GenerateId_1 This class supports the generate-id() function with one argumentGenerateId_1.GenerateIdElaborator HasChildren_1 This class implements the function fn:has-children($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 index-of() function, with the collation already knownInnermost This class implements the function fn:has-children(), which is a standard function in XPath 3.0InScopePrefixes This class implements the XPath 2.0 function fn:in-scope-prefixes()InsertBefore The XPath 2.0 insert-before() functionInsertBefore.InsertIterator Insertion iterator.IntegratedFunctionCall Expression representing a call to a user-written 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, user-written extension functions implemented as instances of the classExtensionFunctionDefinition
.IriToUri This class supports the functions encode-for-uri() and iri-to-uri()IsIdRef This class implements the saxon:is-idref() extension function, which is specially-recognized by the system because calls are generated by the optimizer.KeyFn Lang LocalName_1 This class supports the local-name() functionLocalName_1.LocalNameElaborator LowerCase This class implements the fn:lower-case() functionLowerCase.LowerCaseFnElaborator Matches This class implements the 3-argument matches() function for regular expression matchingMatches.MatchesFnElaborator MathFunctionSet Abstract class providing functionality common to functions math:sin(), math:cos(), math:sqrt() etc; contains the concrete implementations of these functions as inner subclassesMathFunctionSet.Atan2Fn Implement math:atan2MathFunctionSet.PiFn Implement math:piMathFunctionSet.PowFn Implement math:powMathFunctionSet.TrigFn1 Generic superclass for all the arity-1 trig functionsMinimax 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 argumentName_1.NameElaborator NamespaceForPrefix This class supports the function namespace-uri-for-prefix()NamespaceUriFn_1 This class supports the namespace-uri() functionNamespaceUriFn_1.NamespaceUriFnElaborator Elaborator for the namespace-uri() functionNilled_1 This class supports the nilled() functionNodeName_1 This class supports the node-name() function with a single argumentNodeName_1.NodeNameFnElaborator Elaborator for the fn:node-name() functionNormalizeSpace_1 Implement the XPath normalize-space() functionNormalizeSpace_1.NormalizeSpaceFnElaborator NormalizeUnicode Implement the XPath normalize-unicode() function (both the 1-argument and 2-argument versions)NotFn This class supports the XPath functions boolean(), not(), true(), and false()NotFn.NotFnElaborator Number_1 Implements the XPath fn:number() function when called with one argument.Number_1.NumberFnElaborator OptionsParameter This class implements the rules for options parameters, as used in functions such as parse-json, serialize, json-to-XML, map:merge.Outermost This class implements the function fn:outermost(), which is a standard function in XPath 3.0ParseIetfDate This class implements the function parse-ietf-date(), 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.Last.LastFnElaborator PositionAndLast.Position PositionAndLast.Position.PositionFnElaborator Put Implements the fn:put() function in XQuery Update 1.0.Put.PutFnElaborator QNameFn This class supports the fn:QName() functionQNameFn.QNameFnElaborator RegexFunction This class implements any of the functions matches(), replace(), tokenize(), analyze-string(), in the version where a flags argument is present in the argument listRegexFunctionSansFlags This class implements any of the functions matches(), replace(), tokenize(), analyze-string(), 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 resolve-QName function in XPath 2.0ResolveURI This class supports the resolve-uri() function in XPath 2.0Reverse Implement XPath function fn:reverse()Reverse.ReverseListIterator Root_1 Implement the XPath 2.0 root() function with one argumentRoot_1.RootFnElaborator Round This class implements the fn:round() functionRound.RoundElaborator RoundHalfToEven This class supports the round-to-half-even() functionRoundHalfToEven.RoundHalfToEvenElaborator SaxonDeepEqual Implements the saxon:deep-equal() function, a variant of fn:deep-equal that provides additional control over how the comparison is performed.ScalarSystemFunction 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:starts-with() function, with the collation already knownStaticBaseUri Implement the XPath function static-base-uri()StaticContextAccessor A StaticContextAccessor is a function that takes no arguments, but operates implicitly on the static context.StaticContextAccessor.DefaultCollation Implement the XPath function default-collation()StreamAvailable This class implements the XSLT 3.0 function stream-available()String_1 Implement XPath function string() with a single argumentString_1.StringFnElaborator StringJoin fn:string-join(string* $sequence, string $separator)StringLength_1 Implement the XPath string-length() functionStringLength_1.StringLengthFnElaborator StringToCodepoints This class supports the function string-to-codepoints()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() functionSubstring.SubstringFnElaborator SubstringAfter Implements the fn:substring-after() function with the collation already knownSubstringAfter.SubstringAfterFnElaborator SubstringBefore Implements the fn:substring-before() function with the collation already knownSubstringBefore.SubstringBeforeFnElaborator Sum Implementation of the fn:sum functionSum.SumFnElaborator Sum.SumFold Implementation of Fold class to do the summation in push modeSuperId The XPath id() or element-with-id() 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 space-separated list of ID values.SuperId.ElementWithId SuperId.Id SystemFunction Abstract superclass for calls to functions in the standard function librarySystemProperty Implementation of the XSLT system-property() functionTailFn This class implements the function fn:tail(), which is a standard function in XPath 3.0Tokenize_1 This class implements the single-argument tokenize() function introduced in XPath 3.1Tokenize_3 This class implements the 3-argument 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() functionTranslate.TranslateFnElaborator TreatFn This class supports the XPath 2.0 functions exactly-one(), one-or-more(), zero-or-one().TreatFn.ExactlyOne TreatFn.OneOrMore TreatFn.ZeroOrOne TypeAvailable This class supports the XSLT fn:type-available() function.Unordered XPath 2.0 unordered() functionUnparsedEntity Implements the unparsed-entity-uri() function defined in XSLT 1.0 and the unparsed-entity-public-id() function defined in XSLT 2.0UnparsedEntity.UnparsedEntityPublicId UnparsedEntity.UnparsedEntityUri UnparsedText Implementation of fn:unparsed-text() - with one argument or twoUnparsedTextAvailable UnparsedTextFunction Abstract superclass containing common code supporting the functions unparsed-text(), unparsed-text-lines(), and unparsed-text-available()UnparsedTextLines UpperCase This class implements the fn:upper-case() functionUpperCase.UpperCaseFnElaborator UriCollection Implement the fn:uri-collection() 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