<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html>
   <head>
      <this-is section="xsl-elements" page="message" subpage=""/>
      <!--
           Generated at 2010-10-29T18:20:48.427+01:00--><title>Saxonica: XSLT and XQuery Processing: xsl:message</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: xsl:message"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>xsl:message</h1>
      <p>The <code>xsl:message</code> element causes a message to be displayed. The message
is the contents of the <code>xsl:message</code> element.</p>
      <p>There is an optional attribute <code>terminate</code> with permitted values 
<code>yes</code> and <code>no</code>; the default is no. If the
value is set to yes, processing of the stylesheet is terminated after issuing the message. This
attribute may be supplied as an attribute value template.</p>
      <p>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 <code>net.sf.saxon.event.Receiver</code> 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, or the
setMessageEmitter() method of the <code>Controller</code> class.</p>
      <p>The sequence of calls to this Receiver is as follows: there is a single <code>open()</code> call at
the start of the transformation, and a single <code>close()</code> call at the end; and each evaluation of an <code>xsl:message</code>
instruction starts with a <code>startDocument()</code> call and ends with <code>endDocument()</code>. The <code>startDocument()</code>
event has a <code>properties</code> argument indicating whether <code>terminate="yes"</code> was specified, and the
<code>locationId</code> on calls such as <code>startElement()</code> and <code>characters()</code> can be used to identify
the location in the stylesheet where the message data originated (this is achieved by passing the supplied <code>locationId</code>
in a call to <code>getPipelineConfiguration().getLocator().getSystemId(locationId)</code>, or to <code>getLineNumber()</code>
on the same object).</p>
      <p>Select the class <code>net.sf.saxon.event.MessageWarner</code> to have <code>xsl:message</code> output
notified to the JAXP <code>ErrorListener</code>, as described in the JAXP documentation.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="namespace.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>