Re: [xsl] XSLT vs Perl

Subject: Re: [xsl] XSLT vs Perl
From: David Tolpin <dvd@xxxxxxxxxxxxxx>
Date: Tue, 3 Feb 2004 21:01:55 +0400 (AMT)
> I've never liked the pointy brackets aspect of XSLT - far too heavy on the
> eyes. OTOH, once written, stylesheets stay written with very little need
> for maintenance - largely to do, I suspect, with the scoping of the
> application domain of XSLT.

The XML syntax of XSLT 1.0 is in its place. The stylesheets can actually
be generated and manipulated by XSLT 1.0, and it is a very good thing.

> To me, the XSLT 2.0 spec adds some well-needed functionality - like regexp
> - which seemed "obviously needed" in XSLT 1.0 to me once I'd gotten my head
> around style sheets.

But the way they are added is far from being perfect. The string regular
expressions of XSLT 2.0 is the only place where regular syntax is used,
XML matching is not expressed in terms of regular expresions.

Further on, the regexps in XSLT 2.0 are a mix of those from XML Schema
and perl 5, fit into the XML syntax XSLT 2.0, but without capabilities
of perl to compose and manipulate them.

While in perl one can generate, compute, concatenate and split regular
expressions, as well as manipulate their results freely, in XSLT 2.0
the operations are limited to a few built-in commands.

I understand that it is a difficult task to design a regular expression
language to match attribute values and character data; but when there is
no good solution inside XSLT, it should be left out of it -- tool chains
can be long; otherwise the glue must be powerful and flexible. XSLT does
not provide a powerful and flexible glue; it is still XML-oriented.

In RenderX XEP, an XSL FO formatter, the preprocessor is written in XSLT;
it is a complex stylesheet of moderate size, and it does what is best to
do in XML manipulation language. 

Regular parsing and type manipulations are done in a different language, 
because a different language is more suitable.

Instead of providing means for interaction, XSLT 2.0 is going to provide
inferior solutions for problems that can better be handled in other parts
of toolkits.

David Tolpin

 XSL-List info and archive:

Current Thread