On Feb 27, 2008, at 21:01, bonekrusher wrote:

Hi

I use the following XSL-FO to output messages to the console (windows).

<xsl:if test="$output-comments = 'yes'">
  <xsl:message>END template: match="warning"</xsl:message>
</xsl:if>

I want it to display:

END template: match="warning"

But it displays this:

Feb 27, 2008 1:10:22 PM org.apache.fop.cli.InputHandler warning
WARNING: javax.xml.transform.TransformerException: END template:
match="warning"

This is happening with any xsl:message. Is there a way to disable this?

Or am I doing soething wrong?

You're not doing anything wrong, but mind that the behavior of xsl:message basically depends on the XSLT processor. From XSLT 1.0: "The xsl:message instruction sends a message in a way that is dependent on the XSLT processor." (read: you might see it on the console, which is probably the most intuitive, but strictly speaking the implementation could just as well decide to send them to a file...)

The only thing that is guaranteed is that the message will be sent, and will possibly terminate the transformation, if so specified.

In practice, what happens here is that FOP's InputHandler is also the javax.xml.transform.ErrorListener for the XSLT transform. The XSLT processor, upon encountering the xsl:message, calls InputHandler.warn(), passing it the content of the message wrapped in a TransformerException. FOP itself does no more than send this warning to the default log implementation. The only thing we could (should?) get rid of on the FOP-side is the substring "javax.xml.transform.TransformerException: ", by using Exception.getMessage() instead of Exception.toString(). The header line and the prefix on the second line are controlled by the concrete logger in use, which FOP knows nothing about.

If you know how to configure the format of the log-messages on your end, xsl:message can be made to work as you would expect.


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to