Re: [xsl] Upgrade from XSLT1

Subject: Re: [xsl] Upgrade from XSLT1
From: "Liam R E Quin liam@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 27 May 2014 17:56:13 -0000
On Tue, 2014-05-27 at 17:26 +0000, Vasudev Kandhadai
vasu.kandhadai@xxxxxxxxx wrote:

> I am assuming that the coding paradigm is slightly different in XSLT3.. The
> approach on how to write templates, the restrictive xpaths etc , could be
> backwards incompatible etc..

In most cases your XSLT 1 stylesheets will work in an XSLT 2 processor
unchanged. They should also work in an XSLT 3 processor, but since XSLT
3 is a draft (albeit in last call for comments) there are, strictly
speaking, not yet any conformant XSLT  processors as the spec isn't
finished.

So start by making a test suite. E.g. take a large set of documents, run
them through XSLT 1 and then again through the newer Saxon, and compare
the results.

Then you can try changing version="1" to version="2" on the
xsl:stylesheet element and test again.

After that, one approach would be to rewrite only code you change;
another would be to profile and work on any performance issues; another
would be to do larger changes. Adding "as=" attributes to xsl:param and
xsl:varaible will often find bugs and may give noticeable performance
improvements.

> With XSLT3, we may consider removing the SAX splitters, as it may no longer
> be used. XSLT3 will probably take care of the memory issues with HUge XML
> files.
It's possible, it depends on the value of "huge" :)

One difference with XSLT 3 is that you'll be able to pass around
"function items" e.g. as a param to a template, which gives a different
way to override functionality.

Liam


-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
The barefoot typographer

Current Thread