W3C home > Mailing lists > Public > xsl-editors@w3.org > October to December 1999

seconding request for xsl:exit instruction

From: Michael White <mike@cogentex.com>
Date: Mon, 04 Oct 1999 15:46:18 -0400
Message-ID: <37F9040A.9A3802B@cogentex.com>
To: xsl-editors@w3.org

Dear editors,

In Robert C. Lyons message entitled "XSLT wish list" (20 May 1999), he
included a request for an xsl:exit instruction:

> Lastly, I'd like to see an "xsl:exit" instruction added to XSLT.
> For example:
>     <xsl:if test="not(element='valid_value')">
>         <xsl:message>Error: element contains invalid value</xsl:message>
>         <!-- Abort stylesheet and cause the XSLT processor to exit with 
>              an exit code of 2. -->
>         <xsl:exit code="2"/>
>     </xsl:if>

Since there was no response in the archives, I wrote to Bob, who told me
that he received a response to part of his message, but not this part.

I would like to second Bob's request for including this instruction in a
future version of XSLT, though my intended purpose is different. 
Specifically, I'm interested in using XSLT to perform tree-matching, and
would like to use xsl:exit to return just the first match, as
illustrated in the attached file.  Currently this can be done by using a
boolean variable ($done, say) as a flag, plus a ton of xsl:if blocks,
but this workaround is not pretty.

Regards, -Mike

Received on Monday, 4 October 1999 15:45:52 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:17 UTC