[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: using xsl:message with UTF-8 characters
On 20/04/07, Michael Kay <mike@xxxxxxxxxxxx> wrote:
isBy 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 why I reverted to use of ASCII characters only in Saxon error messages. A bit disappointing in this day and age. I'm using win2000 and Java version 1.5.0_10. In my example I did not specify an output file so both, the output from xsl:message and the output doc are displayed in the command shell. Isn't this proof that at least the command shell can handle the characters as expected ? 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? I would like the error msg stream to be sent to the shell in the same way as the output document was sent there. In testing, my output doc is normally set to go to a disc file so it would not be mixed up with the error messages. I've seen the -m classname parameter in your documentation, but after reading the description I still have no idea what to specify - most likely my ignorance in java. Manfred > -----Original Message----- > From: Manfred Staudinger [mailto:manfred.staudinger@xxxxxxxxx] > Sent: 20 April 2007 21:12 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: 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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|