W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2003

Re: [xsl] An interesting angle on types in XSLT 2.0?

From: Mike Haarman <mhaarman@infinitecampus.org>
Date: Fri, 16 May 2003 14:30:30 -0500
Message-ID: <007401c31be1$9ce71f90$c70aa8c0@ic.org>
To: <xsl-list@lists.mulberrytech.com>, <public-qt-comments@w3.org>

----- Original Message ----- 
From: "W. E. Perry" <wperry@fiduciary.com>


> substitute 'interpreted' or 'expected' for 'used'). That distinction is
> fundamental:  the separation of well-formedness from validity is
> philosophically the salient point on which XML departs from its SGML ancestry.
> Therefore proliferation in the forms of validation which might be applied to
> XML (though each naturally introduces new errors of its own) is on the whole a
> good thing. Forcing any such class of errors so intimately into the core of
XML
> that the fundamental distinction of well-formedness from validation is lost or
> obscured is transgression upon XML itself.

Hey all,

I believe XSLT 2.0 implementations will be compelled to this sin by the
following language in

http://www.w3.org/TR/2003/WD-xslt20-20030502/

***

2.9 Error Handling

Certain errors are classified as type errors. A type error occurs when the value
supplied as input to an operation is of the wrong type for that operation, for
example when an integer is supplied to an operation that expects a node. If a
type error occurs in an instruction that is actually evaluated, then it must be
signaled as a dynamic error. An implementation may also, optionally, signal a
type error as a static error, even if it occurs in part of the stylesheet that
is never evaluated, provided it can establish that execution of a particular
construct would never succeed.

It is implementation-defined whether type errors are signaled statically.
For example, the following construct contains a type error, because 42 is not
allowed as an operand of the xsl:apply-templates instruction. An implementation
may optionally signal this as a static error, even though the offending
instruction will never be evaluated, and the type error would therefore never be
signaled as a dynamic error.

<xsl:if test="false()">
  <xsl:apply-templates select="42"/>
</xsl:if>

If more than one error arises, an implementation is not required to signal any
errors other than the first one that it detects. It is implementation-dependent
which of the several errors is signaled. This applies both to static errors and
to dynamic errors. An implementation is allowed to signal more than one error,
but if any errors have been signaled, it must not finish as if the
transformation were successful.

***

If the last sentence quoted is modified to:  ". . . though if any type errors
have been signaled, it *is implementation-dependent whether to* finish as if the
transformation were successful. . . .", I and many others can be satisfied that
an essential feature of the current rec is not being deprecated.

Mr. Kay has demonstrated a work-around that is not too burdensome, but a I think
a responsible, presentation-oriented implementation can and should be permitted
to treat this as a recoverable error, as defined.


sincerely,

Mike Haarman,
Developer and Information Architect,
Infinite Campus
Received on Friday, 16 May 2003 15:31:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:24 GMT