XSLT 2.0 implementation

The xsl:character-map and xsl:output-character elements have been implemented. See further details.

The rules attribute on saxon:collation is now implemented, allowing a fully-customized collation to be created using the syntax for the java RuleBasedCollator. {sort25}

I have added a compile-time warning message if a variable declaration has no following sibling instructions. This is permitted, but has no useful effect and probably means the user has made a mistake.

The xsl:number element now takes a select attribute to select the node to be numbered. (This anticipates a change in the next working draft). {numb23}

The xsl:sequence instruction can now have either a select attribute or child instructions, but not both. (This anticipates a change in the next working draft).

Stylesheet attributes whose value is a name, or a number, or an enumeration such as yes|no, now allow leading and trailing spaces in the value. This feature has not been tested very thoroughly.

When running with version="2.0", the xsl:value-of instruction now defaults the separator attribute to a single space. (With version="1.0", in the absence of a separator attribute, it continues to discard all but the first item in a sequence.) {seq019, seq020}

The constructs element(), element(*, T), attribute(), and attribute(*, T) are now allowed as NodeTests within a pattern. If a type is specified, the default priority is 0. If no type is specified, it is -0.5. {schema019}

The construct [xsl:]exclude-result-prefixes="#all" is now implemented. {nspc48}

Where a namespace is on the list of excluded namespaces for a literal result element, but is used in the name of the element or one of its attributes, Saxon was ignoring the request to exclude the namespace. The effect was that if more than one prefix was assigned to the namespace, unnecessary namespace declarations were output. I have changed the code so it no longer ignores the request to exclude the namespace; instead, the namespace declaration that is actually needed will be reinstated by the namespace fixup process. {nspc49}

Enhancements have been made to the number formatting in format-date(), format-dateTime(), and format-time(). The format modifier "o" can be used to request ordinal numbers (1st, 2nd, 3rd). The format modifier "a" (or "A" for uppercase) gives numbering in words (one, two, three). They can also be combined ("ao" or "Ao") to give ordinal words (first, second, third). These formats currently always produce output in English. {date068}

Ordinal numbering is also available in xsl:number. (This was implemented to underpin date formatting, but is available generally.) Use the format token 1st for the sequence 1st, 2nd, 3rd, 4th..., the format token first or FIRST for the sequence first, second, third, fourth... (in either upper or lower case). The format tokens one and ONE have always been available, though not well documented. The full list of supported formats is documented in xsl-elements.html. Note that these are available only for English; sequences for other languages can be implemented by writing a user-defined Numberer, as described in Localization. {numb24, numb25}

Sorting a set of numeric values, without specifying data-type="number", now handles NaNs correctly.