[xsl] question with xalan, java, utf8

Subject: [xsl] question with xalan, java, utf8
From: Gail Buffington <gbuffing@xxxxxxxxxxxx>
Date: Fri, 19 Apr 2002 15:16:22 -0400
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



Current Thread