W3C home > Mailing lists > Public > xsl-editors@w3.org > April to June 2002

RE: Add assert element

From: Werner Donné <werner.donne@re.be>
Date: Tue, 11 Jun 2002 11:07:34 -0400
To: "Kay, Michael" <Michael.Kay@softwareag.com>, xsl-editors <xsl-editors@w3.org>
Message-ID: <3D063F99@mailandnews.com>

Indeed. I didn't expect the terminate attribute in the message element.

Werner.

>===== Original Message From "Kay, Michael" <Michael.Kay@softwareag.com> =====
>A nice-to-have, but you can achieve the same effect today with
>
><xsl:if test="not(assertion)">
>  <xsl:message terminate="yes">Failed here!</xsl:message>
></xsl:if>
>
>Michael Kay
>
>> -----Original Message-----
>> From: Werner Donné [mailto:werner.donne@re.be]
>> Sent: 11 June 2002 13:17
>> To: xsl-editors@w3.org
>> Subject: Add assert element
>>
>>
>>
>> Hi,
>>
>> In order to prevent fatal errors from passing by unnoticed it
>> would be
>> interesting to
>> have an "assert" element with a "test" attribute, just like
>> with the "if" and
>> "when"
>> elements. The contents of the element could be anything that
>> generates a
>> message.
>> Whenever the evaluation of the test would fail, processing
>> would stop after
>> producing
>> the error message. For example:
>>
>> <xsl:template name="foo">
>>   <xsl:param name="par"/>
>>   <xsl:assert test="number($par) > 0">
>>     <xsl:text>Parameter par of template foo has value </xsl:text>
>>     <xsl:value-of select="$par"/>
>>     <xsl:text>, while it must be a strictly positive
>> number.</xsl:text>
>>   </xsl:assert>
>>   ...
>> </xsl:template>
>>
>> Regards,
>>
>> Werner.
>>
>> --
>> Werner Donné  --  Re BVBA
>> Engelbeekstraat 8
>> B-3300 Tienen
>> tel: (+32) 486 425803   e-mail: werner.donne@re.be
>>

--
Werner Donné  --  Re BVBA
Engelbeekstraat 8
B-3300 Tienen
tel: (+32) 486 425803   e-mail: werner.donne@re.be
Received on Tuesday, 11 June 2002 11:08:08 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:53 GMT