cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Arbogast <>
Subject [I18N] [Samples] [XSLT] Something I don't understand in I18N samples
Date Mon, 16 May 2005 23:07:51 GMT

I'm trying to add some locale chooser widget to my user interface
using an auto-submit select element instead of the simple links showed
in I18N samples.
The problem I came to is the value of the URL to point towards to
change the locale: in
cocoon-2.1.7\build\webapp\samples\i18n\simple2page.xsl on line 112,
the href attribute of a is given the value '{@href}' and I had never
seen this syntax before in XSLT. Could someone explain to me what this
means and possibly what link I should use to make the current page
reloaded in the new language ?

I already have all the code :


    <locale code="fr_FR" label="Fran├žais (France)" flag="fr_FR.gif"/>
    <locale code="en_US" label="English (US)" flag="en_US.gif"/>


<xsl:stylesheet xmlns:xsl="" version="1.0" 
    <xsl:param name="current_locale" select="'fr_FR'"></xsl:param>
    <xsl:template match="/locales">
        <form action="" >
            <select size="1" name="locale" id="locale_chooser"
    <xsl:template match="locale">
            <xsl:if test="$current_locale = @code">
                <xsl:attribute name="selected">
                    <xsl:value-of select="'selected'"/>
            <xsl:attribute name="value">
                <xsl:value-of select="@code"/>
            <xsl:value-of select="@label"/>
    <xsl:template match="node()|@*" priority="-1">
            <xsl:apply-templates select="@*"/>

And everything is displayed fine. I just miss what I should put
instead of "[......]".

Thx in advance.
Sebastien ARBOGAST

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

View raw message