Another way(*) you could do this is
<xsl:message use-when="contains(system-property('xslt.debug'), 'A')">message</xsl:message>
allowing you to control which xsl:message instructions are active by setting Java system properties.
Michael Kay
(*) Martin, if you haven't see the other responses you can find them on

From: [] On Behalf Of
Sent: 18 March 2008 16:08
Subject: [saxon] getting variable debug

 is there a way to switch on or off the xsl:message output?  I was rather hoping for a commons logging equivalent that would allow types of messages to get set?