RE: [xsl] Using or ignoring Types in XSLT 2.0 / XPath 2.0

Mike Haarman wrote:
> 
> In the current toolset, if I ask for substring($date, 4, 1) I 
> get it whether it is junk or not.  The stylesheet doesn't 
> fail.  I appreciate why many consider this a problem.  I feel 
> that it is a significant factor in XSL's success.

There are indeed a range of views on this. This is reflected in the frequent
use in XSLT 1.0 (still retained to a lesser extent in 2.0) of the phrase "it
is an error ... the processor may signal the error, or may recover...".

My understanding is that the original intent of making errors silently
recoverable was to meet the requirements of client-side transformation. This
has been less prominent in the requirements this time around, and the
emphasis has switched to a "safer" mode of operation, in which errors get
reported so that they can be corrected.

I think that the silent recovery from errors makes it difficult for users to
debug their stylesheets. For example, use of xsl:value-of with a node-set,
where nodes after the first are ignored, is a common and very bewildering
mistake for novices. Although our error handling facilities still leave
something to be desired, I think the less permissive approach in XSLT 2.0
will make it easier for users to develop correct code.

Thanks for your comments and responses.

Michael Kay

Received on Friday, 16 May 2003 00:27:27 UTC