1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Xslmessage

From saxon

Jump to: navigation, search

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:
cmd /u

2. Set the font of the console to one that has glyphs in the
unicode range:
- 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:
chcp 65001

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

chcp 65001
java -Dfile.encoding=utf8 net.sf.saxon.Transform in.xml my.xsl

The Saxon patch I've issued in
https://sourceforge.net/tracker/index.php?func=detail&aid=1705811&group_id=29872&atid=397617

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

-m net.sf.saxon.event.TEXTEmitter

or by setting the MessageEmitter using the Java API

Personal tools