Re: [xsl] Re: Spam:[xsl] RE: String manipulation in XSLT

Subject: Re: [xsl] Re: Spam:[xsl] RE: String manipulation in XSLT
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 20 Oct 2005 13:42:42 -0400
At 01:26 PM 10/20/2005, Jay wrote:
XSLT 1 doesn't have much support for string manipulation, because XSLT 1
is really about manipulating XML and no one perceived much need for string
manipulation. XSLT 2 has far greater string manipulation ability because
it became apparent that those features were useful to a lot of people.

I wasn't (quite :-) present at the creation either, but I do think Jay rather overstates the point: it's not really true that "no one perceived much need for string manipulation". Rather, it was envisioned that there'd be other tools (Perl, anyone?) better suited to that. XSLT 1.0 was supposed to be a clean, lean and mean subset and optimization of *some* of the things that made its predecessor, DSSSL, so powerful, while fixing those things about DSSSL (the syntax) that made it impossible for most people.


Jay is correct that requirements for upconversion (the kind of transformation for which string manipulation is generally essential) were explicitly left out of XSLT 1.0 (look at the Rec). Its assumption was that your XML was already clean and well-designed, and all you were calling XSLT to do was downconvert it, probably for presentation. It was never supposed that that is all you'd ever want to do with your XML, or that there aren't also problems in how you get the good XML to begin with. These were (are) smart people who assumed there'd be more than one tool in your box.

Then too, XSLT 1.0 was deployed with mechanisms to allow vendor extension functions to fill these gaps, and provide a pathway forward where 1.0's minimalism clearly fell short.

The designers of XSLT 1.0, I'm sure, have been surprised by many things. But the fact that people need to do upconversions, but XSLT 1.0 doesn't do them well, isn't one of them. One surprise has perhaps been the degree to which the market has succumbed to the Golden Hammer effect ("I need to code a routine to square a circle: let's use XSLT!") -- and it's probably true that the expansion of XSLT's scope in 2.0 has a lot to do with that.

Jeni Tennison wrote a whole book about using XSLT 1.0 for Things For Which It Wasn't Intended. "XSLT On the Edge". I recommend it -- both to see what can be done, and to see what perhaps shouldn't be.

Cheers,
Wendell

Current Thread