Configuring xsl:message output
Getting Unicode output on the Windows console
When running Saxon from the Windows console, the following steps ensure that Unicode message output is displayed correctly:
1. Trigger the unicode support for all pipe etc (default is
cp1252 sometimes known as "ansi") with the command:
2. Set the font of the console to one that has glyphs in the
- go to console system menu (Alt-Space)
- select Properties > Font
- select "Lucida Sans" (MS will automatically select
"Lucida Sans Unicode" when it is needed and when it is
available on your system)
3. Change the codepage of the console screen to use Unicode
(default is IBM 437) with the command:
4. Call your commands *without* using a batch file (won't
work anymore...). You can put your command in an environment
variable for convenience.
5. Set the Java system property -Dfile.encoding=utf8 on the command line for example
java -Dfile.encoding=utf8 net.sf.saxon.Transform in.xml my.xsl
The Saxon patch I've issued in
isn't then needed: this only has the effect of giving better fallback behaviour when the output destination doesn't support Unicode.
Thanks to Abel Braaksma and Andrew Welch for this information.
Escaping of xsl:message output
If you don't want special characters such as "<" and ">" to be escaped in the output of xsl:message, consider using the text output method rather than the XML output method. You can select this from the command line using
or by setting the MessageEmitter using the Java API