the
increasing page size does not concern me (:-) because the serializer should
write directly to the response.getPrintWriter(). Then again, the serializer does
not flush before the end of the page, so users must wait till the page is
finished.
when
it comes to the missing characters. you could try to create your own serializer,
let's take a look at the code for the HTMLSerializer
(org.apache.cocoon.serialization.XMLSerializer);
the
method for the outputstream uses javax.xml to set the transformers
properties
public void
setOutputStream(OutputStream out)
{
try { super.setOutputStream(out); this.handler = getTransformerFactory().newTransformerHandler(); format.put(OutputKeys.METHOD,"xml"); handler.setResult(new StreamResult(this.output)); handler.getTransformer().setOutputProperties(format); this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { getLogger().error("XMLSerializer.setOutputStream()", e); throw new RuntimeException(e.toString()); } } if you
here force the transformer to use your encoding like this;
public void
setOutputStream(OutputStream out)
{
try { super.setOutputStream(out); this.handler = getTransformerFactory().newTransformerHandler(); format.put(OutputKeys.METHOD,"xml");
format.put(OutputKeys.ENCODING,"SHIFT_JIS"); <----- add
this!!!!
handler.setResult(new
StreamResult(this.output)); handler.getTransformer().setOutputProperties(format); this.setContentHandler(handler); this.setLexicalHandler(handler); } catch (Exception e) { getLogger().error("XMLSerializer.setOutputStream()", e); throw new RuntimeException(e.toString()); } } and
then recompile cocoon, now try to your page and tell me what happens. please
also read this note from the xalan faq
mvh
karl øie
|
- urgent encoding problem... Arun.N
- Re: urgent encoding problem... Arun.N
- RE: urgent encoding problem... Karl Øie
- Re: urgent encoding problem... Arun.N
- RE: urgent encoding problem... Karl Øie
- RE: urgent encoding problem... Karl Øie
- Re: urgent encoding problem... Arun.N
- RE: urgent encoding problem... Karl Øie