cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <gree...@hotmail.com>
Subject Re: How to implement Multiple charsets in cocoon 1.8x
Date Thu, 22 Mar 2001 16:35:14 GMT
Roberto Viana <rviana@agency.com> 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;
>
><xsp:logic>
>
>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);
>}
>
></xsp:logic>
>
>I thought this could work, unfortunately this is not the case.

At the moment you need to create 3 formatter instances in cocoon.properties, 
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 cocoon.properties.



_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message