cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: How to implement Multiple charsets in cocoon 1.8x
Date Thu, 22 Mar 2001 16:35:14 GMT
Roberto Viana <> wrote:
>I'm trying to code my (XSP & XSL)cocoon pages in a way that they will
>support multiple languages.
>This is an example of what I have in my XSP pages:
>for example if I want to support 3 languages;
>if(languageCode.equals("cs")) {
>	String charset = "somecharset1";
>	response.setContentType("text/xhtml; charset="+ somecharset1);
>	}
>// Russian charset
>if(languageCode.equals("ru")) {
>	String charset = "KOI8-R";
>	response.setContentType("text/xhtml; charset="+ charset);
>	}
>else {
>	//Set default language-charset
>	String charset = "defaultcharset";
>	response.setContentType("text/xhtml; charset=" + charset);
>I thought this could work, unfortunately this is not the case.

At the moment you need to create 3 formatter instances in, 
one for each language. Then select the one to use using <xsp:pi> to create a 
cocoon-format processing instruction. In fact you should almost never touch 
the response object directly.

The idea of this separation of concerns is that Cocoon can change the way it 
outputs things in future (as it indeed it has recently) and user code won't 
be affected at all. Of course it doesn't always work in reality. ;)

However I've just added to the todo list a request to make this easier by 
letting you put parameters in the PI as well as in

Get Your Private, Free E-mail from MSN Hotmail at

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message