Messages

Many software developers will be familiar with the (now primitive) technique of adding 'print' statments to their programs in order to track down bugs. A similar technique is available to XSLT stylesheet developers, using the Message element. This element can be placed within a template and holds an appropriate message for display when the template is activated:

<template match="//warning/*/para">
  <message>Template //warning/*/para is activated</message>
  <apply-templates/>
</template>

This element has no effect on normal output from the stylesheet. Instead, the text content of the Message element is somehow presented to the user of the XSLT processor software. In a windows-based system, a pop-up window may appear. On a command-line ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.