XSL Stylesheet Error Handling using xsl:message
You can use the xsl:message element in your XSL stylesheet to troubleshoot problems. The XSLT processor sends xsl:message output to standard output. You must activate the Java Console to see xsl:message output.
You can activate the Java Console in the following ways:
• Calling the java_console function.
<xsl:template name="process.image">
<!-- When this template is called, the current node should be -->
<!-- a graphic, inlinegraphic, imagedata, or videodata. All -->
<!-- those elements have the same set of attributes, so we -->
<!-- can handle them all in one place. -->
<xsl:param name="tag" select="'img'"/>
<xsl:param name="alt"/>
<xsl:variable name="input-filename">
<xsl:choose>
<xsl:when test="@entityref">
<xsl:value-of select="unparsed-entity-uri(@entityref)"/>
</xsl:when>
<xsl:when test="@fileref">
<xsl:value-of select="@fileref"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:text>Expected @entityref or @fileref on
</xsl:text>
<xsl:value-of select="name(.)"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>