This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

question with xalan, java, utf8


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]