[xsl] Re: The Perils of Sudden Type-Safety in XPath 2.0

Subject: [xsl] Re: The Perils of Sudden Type-Safety in XPath 2.0
From: "Charles White" <chuck@xxxxxxxxxxx>
Date: Wed, 19 Feb 2003 14:50:29 -0800
----- Original Message -----
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
> One of the critiques about XSLT 1.0 is that it's too verbose. From what I
> see about XSLT 2.0, transformations written in it may well have to be
> as verbose as their XSLT 1.0 counterpart.

It's probably not even fair for me to comment, because I've only begun to
study the spec, but from what little I've tested so far, I would think there
will be some trade offs. Using some of the key words from XPath 2.0, it
seems like I can significantly reduce some of the verbosity inherent in the
previous version of XSLT. And certainly some of the string functions will
help, like being able to use regular expressions in the replace() function.
No more of those nifty but verbose recursive string replacement functions.

On the other hand, the entirety of the spec, if you include XPath 2.0,  is
certainly more complex, and there's an awful lot of cross-referencing to be
done to grok it all. You know, go look at the XQuery function and operator
spec, then go look at XPath, then go back to the XSLT spec to see how to use
something else. The thing that will concern me is, will my old code break,
and the answer seems to be "no", and do I *have* to use data typing, and the
answer, if I understand correctly (and I still may not), seems to be no, as
long as I set my version attribute to "1.0". That part of it does seem a
little weird to me. I would think that if you set your version to 1.0, it
would support only 1.0 elements, and not provide the other functionality
available in 2.0 specs. It seems to me a better solution would be another
kind of switch, like, XPath = "1.0" and XPath = "2.0" within the stylesheet

Chuck White
Author, Mastering XSLT, Sybex Books

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

Current Thread