This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
question with xalan, java, utf8
- From: Gail Buffington <gbuffing at keithley dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Fri, 19 Apr 2002 15:16:22 -0400
- Subject: [xsl] question with xalan, java, utf8
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
I'm trying to output HTML using UTF-8 characters. When I use Instant
Saxon with my xml and xsl file, all if well. But if I try to do this
through Java I've had multiple problems!
FileWriter output = new FileWriter("/tmp/testlog");
// StringWriter output = new StringWriter();
StreamResult result = new StreamResult(output);
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF8");
transformer.transform(xmlSource, result);
xmlSource was created from a UTF8 file using:
StreamSource xmlSource = fileStreamSource(xmlSourceFile);
the transformer was created using:
transformer = tFactory.newTransformer(xslSource);
xslSource was created the same way as xslSource only no UTF-8
characters.
The resulting output has garbled UTF-8 characters.
Can anyone help?
Thanks!
Gail Buffington
Keithley Instruments
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list