http://www.w3.org/1999/XSL/Transform

c.throwException (message : string) : void

The method “throwException” causes an exception error with the indicated error message. The calculation of the current transformation result is abruptly terminated by this.

The following example is intended to illustrate how an error is caused by visiting a page 6 of 5.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:onion="http://onionworks.net/2004/data" version="1.0">
<xsl:template match="/">
<xsl:variable name="pages" c.as="Number">5</xsl:variable>
<xsl:variable name="currentPage" c.as="Number">6</xsl:variable>
<xsl:if test="$currentPage > $pages">
<xsl:value-of select="c.throwException('Index out of range')" />
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Aborting the current calculation