Re: [xsl] transforming XSLT files to use XSLT3 features

Subject: Re: [xsl] transforming XSLT files to use XSLT3 features
From: "John Lumley john@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 11 Feb 2023 11:56:59 -0000
On 11/02/2023 11:34, Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx wrote:
The approach is limited by its use of template matches and regular expressions. For some reason, I donbt feel inclined to write an XPath grammar parser in XSLT. But still, some low-hanging fruit can be obtained.

Have a look at Gunther Rademacher's REx Parser Generator https://www.bottlecaps.de/rex/


It can be used to generate an XSLT parser for XPath 2. (I've used it extensively in the past for analysing XPath 3 expressions.)

An alternative, if your XSLT platform supports it, is to use an InvisibleXML parser https://invisiblexml.org/
There is an iXML grammar forB XPath3.1 available (https://github.com/invisibleXML/ixml/tree/master/samples/XPath) which will also parse XPath2. You may be able to experiment with this using Martin Honnen's XSLT3 Fiddle (https://martin-honnen.github.io/xslt3fiddle/) which supports invisibleXML parsing functions.



John Lumley


Current Thread