Causes a message to be displayed.
Permitted parent elements: any XSLT element whose content model is sequence-constructor; any literal result element
The content of the message may be specified
using either or both of the
If the value is set to
New in XSLT 3.0. Specifies the error
code associated with the message. The effective value should be an EQName. The
Notes on the Saxon implementation
From Saxon 9.5 the new feature of text value templates is implemented,
which is particularly useful with
xsl:message. For example:
expand-text="yes" can appear on any ancestor element
to enable the feature.
By default the message is displayed on the standard error output stream. You can
supply your own message receiver if you want it handled differently. This must
be a class that implements the Receiver interface. The content of
the message is in general an XML fragment. You can supply the
Receiver using the
-m option on the command line,
setMessageEmitter() method of the Controller class.
The sequence of calls to this
Receiver is as follows: there is a
open() call at the start of the transformation, and a single
close() call at the end; and each evaluation of an
xsl:message instruction starts with a
startDocument() call and ends with
startDocument() event has a
terminate="yes" was specified, and the
locationId on calls such as
characters() can be used to identify the location in the
stylesheet where the message data originated (this is achieved by passing the
locationId in a call to
getLineNumber() on the same object).
Select the class MessageWarner to have
xsl:message output notified to the
ErrorListener, as described in the JAXP documentation.