cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: How can the result of a pipeline be a parameter for a transformation in another pipeline?
Date Fri, 31 Jan 2003 15:12:35 GMT
From: "Cyril Vidal" <cyril@planetexml.com>

> Hello,
>
> I would like to retrieve the language of the user's browser, so that I
could
> call the I18n Trasnformer in the right way (by passing the locales's value
> equal to the browser's language).

Simply use the LocaleAction as it is done in i18n samples.
AFAIK, you can setup it to use only the browser's locale and not take into
account request params, session attributes or cookies. But I'm sure you'll
need to allow users to change to language on fly or retain it in a cookie on
the client side to serve the last preferred language of the user. In all
this cases LocaleAction will help you a lot.

-- Konstantin

>
> To retrieve the language set up in the browser, I've used the Request
> Generator, and applied the following simple stylesheet to it:
>
> <xsl:stylesheet version="1.0"
>
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> xmlns:req="http://xml.apache.org/cocoon/requestgenerator/2.0"
>
> >
>
> <xsl:template match="/">
>
> <xsl:value-of
> select="//req:requestHeaders/req:header[@name='accept-language']"/>
>
> </xsl:template>
>
> </xsl:stylesheet>
>
>
>
> And this is working fine. By example, for my browser, the result is 'fr'.
>
> But now, I don't know what really to do with this value: I would like to
use
> it as a parameter for a I18nTransformation in another pipeline.
>
> Do you know how this can be achieved?
>
>
>
> Thanks for your help,
>
> Cyril.
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>
>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.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