RE: [xsl] XSLT vs Perl

Subject: RE: [xsl] XSLT vs Perl
From: "Willink, Ed" <Ed.Willink@xxxxxxxxxxxxxxx>
Date: Wed, 4 Feb 2004 18:23:18 -0000
Hi Jeni, David

> It's good to see some specific comments on XSLT 2.0's weaknesses.
> 
> > But string manipulation is not convenient in XSLT 2.0. It is as
> > messy as in perl, just without the rest of perl to compensate for
> > the mess (I am only mentioning perl because the working draft for
> > XSLT 2.0 does).
> 
> String manipulation in XSLT 2.0 is certainly inadequate for some of
> the up-translations that you might want to do, such as parsing
> non-regular languages such as HTML or LaTeX (both of which might
> reasonably appear embedded within an XML document). In these cases,
> using Perl (or another language) to pre-parse the embedded language
> into XML structures seems a very reasonable way to proceed.

Following on, the original criticism is correct but inappropriate.

XSLT is primarily an XML to XML transformation language. It happens
to support other output formats but not very well, and it is in this area
that its limitations are apparent.

There is a fundamental design choice for a text formatting language:

Either
	program text
or
	literal text
is given special status in the programming language.

Consequently when program text is the natural presentation as in C, or Java,
it is
necessary to use "..." to escape literal text.

Conversely where literal text is the natural presentation as in make, or
ANT, it
is necessary to use ${...} to escape program text.

Since XSLT is primarily a programming language, it opts for the former and
the
latter suffers.

Major XML to text stylesheets should be programmed in another language,
possibly prefixed by an XML to XML restructuring in XSLT to avoid the
need for the subsequent XML to text to have to do any computation.

	Regards
			
		Ed Willink

------------------------------------------------------------------------
E.D.Willink,                             Email: mailto:EdWillink@xxxxxxx
Thales Research and Technology (UK) Ltd, Tel:  +44 118 923 8278 (direct)
Worton Drive,                            or  +44 118 986 8601 (ext 8278)
Worton Grange Business Park,             Fax:  +44 118 923 8399
Reading,   RG2 0SB
ENGLAND          http://www.computing.surrey.ac.uk/personal/pg/E.Willink
------------------------------------------------------------------------


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread