[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] New XSLT 3.0 Working Draft

Subject: [xsl] New XSLT 3.0 Working Draft
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Tue, 10 Jul 2012 18:20:11 +0100

There's a new Working draft of XSLT 3.0 - the first new public draft for 2 years - at http://www.w3.org/TR/xslt-30/.

There's an enormous amount of new material here.

Big features:

- Streaming -

The analysis of streamability has been greatly simplified: it no longer requires any complex data flow analysis. This is achieved largely by not allowing variables to be bound to the nodes in a streamed document. Apart from that, most of the new features introduced for the benefit of streaming, such as xsl:iterate and xsl:stream, are largely intact.

A major innovation is the introduction of "accumulators", values associated with nodes that can be computed during a streaming pass of a document; they have the usability of mutable variables while being defined in a purely functional way, and are sufficiently constrained that they don't inhibit optimization.

- Packages -

Intended for independent compilation of stylesheet components: they allow stylesheets to distinguish which components are internal and which are visible to the outside world. Gives general software engineering benefits by separating interface from implementation; allows constraining of what can be overridden/customized and makes overriding type-safe.

- Maps -

A new data type, similar to the dictionaries or associative arrays in other languages. The keys in the map can be any atomic value; the associated value can be any value whatsoever. A particular motivation for maps was that with streaming, you only get to see each thing in a document once, so you need to remember what you've seen for use later (for example, in an accumulator); so you need a richer data structure for holding this data. Maps also provide a useful mechanism for importing/exporting data to/from JSON format (for which there are new functions).

- Higher-order functions -

More an XPath feature than an XSLT one, functions are now first-class values and can be passed as parameters to functions, returned by functions, held in maps, etc etc.

Other things include:

* xsl:try/catch

* xsl:evaluate

* xsl:assert

Current Thread