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:
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:
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.
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.
These changes are not highlighted in the change-marked version of the specification.
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.
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.
Where appropriate, the phrase "the value of $x
" has been replaced
by the simpler "$x
". No change in meaning is intended.
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.