Hi.
I'm using
java servlets which use XSL files to convertXML data into html (xalan and xerces packages).
It works fine with regular ascii based files, but when I use a file saved in a UTF-8 encoding, I
get a non ascii character at the begining of the
XSL
doc. even if I remove this character, the non ascii characters display in the browser as question marks.
The code:
XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
XSLTInputSource input = new XSLTInputSource(document);
InputStreamReader ir = new InputStreamReader(new FileInputStream(filePath),"UTF8");
XSLTInputSource styleSheet = new XSLTInputSource(ir);
Writer out = response.getWriter();
response.setContentType("text/html");
PrintWriter output = new PrintWriter(out ,true);
processor.process(input, styleSheet, new XSLTResultTarget(output));
Does anyone have an idea?