# Package net.sf.saxon.functions

This package provides implementations of all the core functions available for use in XPath expressions.

See: Description

- Interface Summary
  Interface | Description
  --- | ---
  ExtensionFunctionFactory | This is a marker interface representing an abstract superclass of JavaExtensionFunctionFactory and DotNetExtensionFunctionFactory.
  FunctionLibrary | A FunctionLibrary handles the binding of function calls in XPath (or XQuery) expressions.

- Class Summary
  Class | Description
  --- | ---
  Abs | This class supports the abs() function
  Adjust | This class implements the XPath 2.0 functions adjust-date-to-timezone(), adjust-time-timezone(), and adjust-dateTime-timezone().
  Aggregate | This abstract class provides functionality common to the sum(), avg(), count(), exists(), and empty() functions.
  Available | This class supports the XSLT element-available, function-available, and type-available functions.
  Average | Implementation of the fn:avg function
  BaseURI | This class implements the fn:base-uri() function in XPath 2.0
  BooleanFn | This class supports the XPath function boolean()
  Ceiling | This class supports the ceiling(), floor(), round(), and round-to-half-even() functions, and also the abs() function
  CodepointEqual | Implements the XPath 2.0 fn:codepoint-equal() function.
  CodepointsToString | This class implements the function fn:codepoints-to-string()
  CollatingFunction | Abstract superclass for all functions that take an optional collation argument
  Collection | Implement the fn:collection() function.
  Compare | This class implements the XPath 2.0 fn:compare() function
  CompileTimeFunction | Abtract class representing a function call that is always rewritten at compile time: it can never be executed
  Component | This class supports the get_X_from_Y functions defined in XPath 2.0
  Concat | Implementation of the fn:concat() function
  ConstructorFunctionLibrary | The ConstructorFunctionLibrary represents the collection of constructor functions for atomic types.
  Contains | Implements the fn:contains() function
  Count | Implementation of the fn:count function
  Current | Implement the XSLT current() function
  CurrentDateTime | This class implements the XPath 2.0 functions current-date(), current-time(), and current-dateTime(), as well as the function implicit-timezone().
  CurrentGroup | Implements the XSLT function current-group()
  CurrentGroupingKey | Implements the XSLT function current-grouping-key()
  Data | Implement XPath function fn:data()
  DateTimeConstructor | This class supports the dateTime($date, $time) function
  DeepEqual | XSLT 2.0 deep-equal() function.
  DefaultCollation | Implement the XPath 2.0 default-collation() function
  DistinctValues | The XPath 2.0 distinct-values() function
  DistinctValues.DistinctIterator | Iterator class to return the distinct values in a sequence
  Doc | Implement the fn:doc() function - a simplified form of the Document function
  DocAvailable | Implement the fn:doc-available() function
  DocumentFn | Implements the XSLT document() function
  DocumentUriFn | This class supports the document-uri() function
  ElementAvailable | This class supports the XSLT element-available and function-available functions.
  Empty | Implementation of the fn:exists function
  EndsWith | Implements the fn:ends-with() function
  Error | Implement XPath function fn:error()
  EscapeURI | This class supports the functions encode-for-uri() and iri-to-uri()
  ExecutableFunctionLibrary | An ExecutableFunctionLibrary is a function library that contains definitions of functions for use at run-time.
  Exists | Implementation of the fn:exists function
  False | Implement the XPath function fn:false()
  Floor | This class supports the ceiling(), floor(), round(), and round-to-half-even() functions, and also the abs() function
  FormatDate | Implement the format-date(), format-time(), and format-dateTime() functions in XSLT 2.0 and XQuery 1.1.
  FormatNumber | XSLT 2.0 implementation of format-number() function - removes the dependence on the JDK.
  FunctionAvailable | This class supports the XSLT element-available and function-available functions.
  FunctionLibraryList | A FunctionLibraryList is a list of FunctionLibraries.
  GenerateId | This class supports the generate-id() function
  Id | 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.
  Idref |
  IndexOf | The XPath 2.0 index-of() function
  IndexOf.IndexIterator | Iterator to return the index positions of selected items in a sequence
  InScopePrefixes | This class supports fuctions get-in-scope-prefixes()
  Insert | The XPath 2.0 insert-before() function
  Insert.InsertIterator | Insertion iterator.
  IntegratedFunctionCall | Expression representing a call to a user-written extension function implemented as a subtype of `ExtensionFunctionCall`
  IntegratedFunctionLibrary | A library of integrated function calls, that is, user-written extension functions implemented as instances of the class IntegratedFunction.
  IsWholeNumber | This class implements the saxon:is-whole-number() extension function, which is specially-recognized 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 ancestor-or-self
  Lang |
  Last | Implement the XPath 2.0 function fn:last()
  LocalNameFn | This class supports the local-name() function
  LowerCase | This class implements the fn:lower-case() function
  Matches | This class implements the matches() function for regular expression matching
  Max | Implementation of the fn:max() function with 1 or 2 arguments
  Min | Implementation of the fn:min() function with 1 or 2 arguments
  Minimax | This class implements the min() and max() functions
  NameFn | This class supports the name() function
  NamespaceForPrefix | This class supports the function namespace-uri-for-prefix()
  NamespaceUriFn | This class supports the namespace-uri() function
  Nilled | This class supports the nilled() function
  NodeNameFn | This class supports the node-name() function
  NormalizeSpace_0 | Implement the XPath normalize-space() function with zero arguments
  NormalizeSpace_1 | Implement the XPath normalize-space() function
  NormalizeUnicode | Implement the XPath normalize-unicode() function
  NotFn | This class supports the XPath functions boolean(), not(), true(), and false()
  NumberFn | Implements the XPath number() function.
  Position |
  Put | Implements the fn:put() function in XQuery Update 1.0.
  QNameFn | This class supports the fn:QName() function (previously named fn:expanded-QName())
  RegexGroup |
  Remove | The XPath 2.0 remove() function
  Remove.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 expression
  ResolveQName | This class supports the resolve-QName function in XPath 2.0
  ResolveURI | This class supports the resolve-uri() functions in XPath 2.0
  Reverse | Implement XPath function fn:reverse()
  Root | Implement the XPath 2.0 root() function
  Round | This class supports the round() functions
  RoundHalfToEven | This class supports the round-to-half-even() function
  StandardFunction | This class contains static data tables defining the properties of standard functions.
  StandardFunction.Entry | An entry in the table describing the properties of a function
  StartsWith | Implements the fn:starts-with() function
  StaticBaseURI | This class supports the static-base-uri() function in XPath 2.0.
  StaticContextForSystemFunctions | An implementation of the StaticContext interface, holding those parts of the static context that can be used by system functions.
  StringFn | Implement XPath function string()
  StringJoin | xf:string-join(string* $sequence, string $separator)
  StringLength | Implement the XPath string-length() function
  StringToCodepoints | This class supports the function string-to-codepoints()
  Subsequence | Implements the XPath 2.0 subsequence() function
  Substring | This class implements the XPath substring() function
  SubstringAfter | Implements the fn:substring-after() function
  SubstringBefore | Implements the fn:substring-before() function
  Sum | Implementation of the fn:sum function
  SystemFunctionCall | Abstract superclass for calls to functions in the standard function library
  SystemFunctionLibrary | The SystemFunctionLibrary represents the collection of functions in the fn: namespace.
  SystemProperty | Implementation of the XSLT system-property() function
  Tokenize | This class implements the tokenize() function for regular expression matching.
  Trace | This class supports the XPath 2.0 function trace().
  Translate | Implement the XPath translate() function
  TreatFn | This class supports the XPath 2.0 functions exactly-one(), one-or-more(), zero-or-one().
  True | Implement the XPath function fn:true()
  TypeAvailable | This class supports the XSLT element-available and function-available functions.
  Unordered | XPath 2.0 unordered() function
  UnparsedEntity | Implements the unparsed-entity-uri() function defined in XSLT 1.0 and the unparsed-entity-public-id() function defined in XSLT 2.0
  UnparsedText |
  UnparsedTextAvailable |
  UpperCase | This class implements the fn:upper-case() function
  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() function
  URIQueryParameters.RegexFilter | A FilenameFilter that tests file names against a regular expression
  VendorFunctionLibrary | The VendorFunctionLibrary represents specially-recognized functions in the Saxon namespace.

## Package net.sf.saxon.functions Description

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.

Michael H. Kay
Saxonica Limited
9 February 2005

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.