F Changes since version 3.1 (Non-Normative)

F.1 New Functions

A number of new functions have been defined:

A number of functions are included in the draft specification but have not yet been reviewed or accepted:

F.2 Changes to Existing Functions

  1. The keywords used for parameter names have been changed. Previously these names were of no significance, but in 4.0 they can be used with keyword := value argument syntax in function calls.

The following changes are present in this draft, but have not been agreed by the community group:

  1. The third argument of fn:format-number can now be supplied as an xs:QName instead of as a string that can be converted to a QName. Using a xs:QName, especially in the (rare) cases when the value is supplied dynamically, avoids the need to maintain the static namespace context at execution time.

  2. The function fn:xml-to-json accepts an additional option: number-formatter allows the user to control the formatting of numeric values, for example by preventing the use of exponential notation for large integers.

F.3 Editorial Changes

These changes are not highlighted in the change-marked version of the specification.

  1. The operator mapping table has been simplified so all the value comparison operators are now defined in terms of two functions (for each data type): op:XX-equal, and op:XX-less-than. The entries for op:XX-greater-than have therefore been removed.

  2. The names of arguments appearing in function signatures have been changed. This is to reflect the introduction of keyword arguments in XPath 4.0; the names chosen for arguments are now more consistent across the function library.

  3. Where appropriate, the phrase "the value of $x" has been replaced by the simpler "$x". No change in meaning is intended.

  4. The formal specifications of array functions have been rewritten to use two new primitives: op:A2S which converts an array to a sequence of zero-arity functions, and op:S2A which does the inverse. This has enabled many of the functions to be specified more concisely, and with less duplication between similar functions for sequences and arrays.

F.4 Changes to Operators

  1. Comparison of numeric values is now transitive, and is consistent with op:same-key. This is achieved by changing the rules for comparing xs:decimal and xs:double so that the type conversion is done without any loss of precision.