You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by bonekrusher <dj...@yahoo.com> on 2008/02/27 21:01:02 UTC
xsl:message for debuging
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?
Thx
Bones
--
View this message in context: http://www.nabble.com/xsl%3Amessage-for-debuging-tp15721729p15721729.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: xsl:message for debuging
Posted by Andreas Delmelle <an...@telenet.be>.
On Feb 28, 2008, at 11:32, bonekrusher wrote:
Hi
>
> Thanks for the help.
No problem. Just FYI:
>> 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().
This has been taken care of in the meantime. With FOP Trunk, your
original example would now yield:
Feb 27, 2008 1:10:22 PM org.apache.fop.cli.InputHandler warning
WARNING: END template: match="warning"
The rest, as I hinted at, can normally be omitted by fiddling with
the configuration of the logger that is used.
Cheers
Andreas
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: xsl:message for debuging
Posted by bonekrusher <dj...@yahoo.com>.
Thanks for the help.
Bones
andreas.delmelle wrote:
>
> 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: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>
>
--
View this message in context: http://www.nabble.com/xsl%3Amessage-for-debuging-tp15721729p15733652.html
Sent from the FOP - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
Re: xsl:message for debuging
Posted by Andreas Delmelle <an...@telenet.be>.
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: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org