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="" xmlns:onion="" version="1.0">
<xsl:template match="/">
<xsl:variable name="pages""Number">5</xsl:variable>
<xsl:variable name="currentPage""Number">6</xsl:variable>
<xsl:if test="$currentPage > $pages">
<xsl:value-of select="c.throwException('Index out of range')" />
Aborting the current calculation