<xsl:message terminates=”yes” | “no” > </xsl:message>
The xsl:message element is primarily used to report errors by displaying a text message and related information of interest in the output. This element can contain almost any other XSL element.
For example, you can use the xsl:text element to add literal text to the xsl:message element and you can use the xsl:value-of element to display values.
Exactly how the text contained in the xsl:message element (and any associated stylesheet error messages) will be displayed in the output will be determined by the XSL processor.
This element also provides a mechanism that gives you the choice to quit the XSL processor (terminate the process) when an error is encountered or to allow the process to continue (the default).
Alternatively, the xsl:comment element can be used to debug errors. This is not a self-closing element. The separate closing element is mandatory.
terminates=”yes” | “no”
The optional terminates attribute provides the choice of quitting the process or continuing the process if an error is encountered. If set to no, the error in the stylesheet is reported and the process continues. This is the default. If set to yes, the error in the stylesheet is reported and the process terminates.
In this example, we test to see if a [department-sub] is the empty string in case department of [TECHNICAL] department. If yes, we exit and display a message.
Scroll to Top