RE: [xsl] using xsl:message with UTF-8 characters

Subject: RE: [xsl] using xsl:message with UTF-8 characters
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 20 Apr 2007 21:50:40 +0100
By default the output from xsl:message in Saxon goes to System.err, and the
handling of special characters therefore depends partly on the Java IO
library and partly on the operating system (perhaps even on which command
shell you are using within the operating system). I've generally found that
a number of shells are unable to display even iso-8859-1 correctly, which is
why I reverted to use of ASCII characters only in Saxon error messages. A
bit disappointing in this day and age.

It's easy enough to tell Saxon to send the message somewhere else where it
won't be mangled, but the question is, where do you actually want it?

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Manfred Staudinger [mailto:manfred.staudinger@xxxxxxxxx]
> Sent: 20 April 2007 21:12
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] using xsl:message with UTF-8 characters
>
> Using XSLT 2.0 with Saxon 8.9.0.3J I would like to use
> xsl:message much more, but I don't know how to get
> UTF-8 chars displayed correctly. Here is what I get when I
> invoke test.xsl with saxon from the command line:
>
> >java net.sf.saxon.Transform dummy.xml test.xsl
> a or ?that's the question  <---- I replaced a square by a true ?
> <doc>a or d, that's the question</doc>>Exit code: 0
>
> The square stands for x'E4 AC A0' (which would triggers
> base64 encoding in gmail by the way) and the text has not
> only lost the "d"
> (x'C3 A4') but also the next 2 bytes ", " (x'C2 20').
>
> Any idea how to get xsl:message working ?
>
> Manfred
>
> test.xsl
> <?xml version="1.0" encoding="UTF-8" ?>
> <xsl:stylesheet version="2.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> <xsl:output omit-xml-declaration="yes"/> <xsl:template
> match="/"> <doc>
>   <xsl:message select="'a or d, that''s the question'"/>
>   <xsl:value-of select="'a or d, that''s the question'"/>
> </doc> </xsl:template> </xsl:stylesheet>

Current Thread