Internal changes

The new code introduced in Saxon 8.7 for converting floating point numbers to strings was found to be unsatisfactory, and has been completely rewritten using a different algorithm.

An optimization used by the schema validator while constructing finite state machines to implement the schema grammar was found to be unsound in a very small number of cases; the optimization has therefore been removed. Unfortunately this means that compiling a schema is now a little slower.

In xsl:analyze-string, a check is now made for error XTDE1150 (regex matches a zero-length string) in the case where the regex is not known until run-time.

In XSLT, the attribute stable="yes" or stable="no" is now permitted on xsl:sort. It currently has no effect (sorting is always stable in Saxon). This is conformant behaviour, because the effect of stable="no" is implementation-dependent.

In XQuery, when a ModuleURIResolver is set on the StaticQueryContext for a main module, it is now also used for resolving module imports contained in any transitively-imported library modules.

The "tiny forest" mechanism, whereby a single TinyTree structure is used to hold multiple trees (root nodes) in a sequence, was found not to be working reliably in Saxon 8.7, and has been redesigned to make it more robust. Generally speaking, this mechanism reduces the number of objects that are allocated but increases their size; this may affect the performance profile of some applications.

The XSLT xsl:number instruction now recognizes non-BMP digits in its format string. (This works best with JDK 1.5; there are some restrictions under JDK 1.4)

The TypeHierarchy object, which holds a cache of type information, is now held as part of the Configuration and no longer as part of the NamePool. This is to avoid memory leaks in cases where one long-lived NamePool was used with many transient Configuration objects. (This happened with the schema-aware product only, because user-defined types held in the TypeHierarchy hold a reference to the Configuration under which they were created.)

A change has been made to the way in which XSLT current template rule is maintained. This is to implement the rule that when a template is defined using a union pattern, it is treated as a set of template rules with potentially different priorities. The xsl:next-match instruction can therefore invoke the same template more than once. To implement this, the currentTemplate maintained in the context is now a Rule object rather than a Template object.

In schema-aware processing, improvements have been made to the type inferencing. The type of a path expresssion starting with a variable whose static type is document-node(schema-element(x)) is now inferred more precisely, and the cardinality of an expression using the child axis is also now inferred more precisely. This enables better compile-time detection of type errors, and in some cases better optimization.

On .NET, Saxon 8.7.1 is built using IKVM 0.26. The associated version of GNU Classpath fixes a number of bugs, including a serious one involving decimal arithmetic.

The component extraction functions get-years-from-duration(), get-months-from-duration(), etc, now operate on any xs:duration value, not only on an xdt:yearMonthDuration or xdt:dayTimeDuration value. (W3C Bugzilla 2934)

The type names dayTimeDuration, yearMonthDuration, untypedAtomic, untyped, and anyAtomicType are now recognized in the xs namespace http://www.w3.org/2001/XMLSchema as well as in the previous xdt namespace (in fact several versions of the xdt namespace are recognized. This situation is transitional: eventually only the XMLSchema namespace will be allowed.

The functions encode-for-uri() and iri-to-uri() have been modified according to the changes agreed in W3C Bugzilla 2457

Casting from a derived type to a supertype is no longer a no-op. Although I believe that the language specification permits the previous behavior, it was controversial, and it seems better to do something that causes fewer surprises even if it is slower.

In schema-aware XQuery with multiple modules, error XQST0036 (an imported function or variable uses an unknown type) is now reported only if the function or variable is actually referenced in the importing module. See W3C Bugzilla 2546.

XSLT and XQuery error codes have been added for most validation errors. I have also started the process of incorporating XML Schema error codes as mandated by Appendix C of XML Schema Part 1.