You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by br...@univ.trieste.it on 2006/03/13 13:00:48 UTC
i18n transformer doesn't translates attributes
I have a strange problem.
Out of a generator i have the following tag
...
<area id="1" name="about_area" colour="FF0000" label="about_area"
i18n:attr="label">
...
After an i18n transformer, all "<i18n:text>" tags are correctly
translated but the tag above is unchanged and the attribute "label" is
untranslated.
Any suggest?
Alberto Brosich
Cocoon 2.1.8
Jetty
Linux Debian 3.1
Kernel 2.6.15
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: i18n transformer doesn't translates attributes
Posted by br...@univ.trieste.it.
Quoting Simone Gianni <s....@thebug.it>:
> brosich@univ.trieste.it wrote:
>
>> Follow a fragment of xsp code that generate xml:
>> <xsp:page
>> language="java"
>> xmlns:xsp="http://apache.org/xsp"
>> xmlns:esql="http://apache.org/cocoon/SQL/v2"
>> xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
>> space="strip">
>> ...
>> <xsp:element name="area">
>> <xsp:attribute name="id"><esql:get-int column="pos" /></xsp:attribute>
>> <xsp:attribute name="name"><esql:get-string column="name"
>> /></xsp:attribute>
>> <xsp:attribute name="colour"><esql:get-string column="colour"
>> /></xsp:attribute>
>> <xsp:attribute name="label"><esql:get-string
>> column="name"/></xsp:attribute>
>> <xsp:attribute name="i18n:attr">label</xsp:attribute>
>> ...
>
>
> I think you should try to generate this attribute this way :
>
> <xsp:attribute name="attr" prefix="i18n"
> uri="http://apache.org/cocoon/i18n/2.1">label</xsp:attribute>
Yes! It works!
Thank you very much.
Alberto
>
> I'm not an XSP expert, but the
> /cocoon-2.1.X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl file (that transforms your xsp to a java class) apparently uses this
> parameters
> :
>
> name : is the attribute name (which is not i18n:attr, but just attr)
> prefix : is the prefix you want to map the namespace of this attribute to.
> uri : is the namespace uri
>
> Hope this helps,
> ciao,
> Simone
>
>
> --
> Simone Gianni
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: i18n transformer doesn't translates attributes
Posted by Simone Gianni <s....@thebug.it>.
brosich@univ.trieste.it wrote:
> Follow a fragment of xsp code that generate xml:
> <xsp:page
> language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
> space="strip">
> ...
> <xsp:element name="area">
> <xsp:attribute name="id"><esql:get-int column="pos"
> /></xsp:attribute>
> <xsp:attribute name="name"><esql:get-string column="name"
> /></xsp:attribute>
> <xsp:attribute name="colour"><esql:get-string column="colour"
> /></xsp:attribute>
> <xsp:attribute name="label"><esql:get-string
> column="name"/></xsp:attribute>
> <xsp:attribute name="i18n:attr">label</xsp:attribute>
> ...
I think you should try to generate this attribute this way :
<xsp:attribute name="attr" prefix="i18n"
uri="http://apache.org/cocoon/i18n/2.1">label</xsp:attribute>
I'm not an XSP expert, but the
/cocoon-2.1.X/src/blocks/xsp/java/org/apache/cocoon/components/language/markup/xsp/java/xsp.xsl
file (that transforms your xsp to a java class) apparently uses this
parameters :
name : is the attribute name (which is not i18n:attr, but just attr)
prefix : is the prefix you want to map the namespace of this attribute to.
uri : is the namespace uri
Hope this helps,
ciao,
Simone
--
Simone Gianni
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: i18n transformer doesn't translates attributes
Posted by Simone Gianni <s....@thebug.it>.
Ciao Alberto,
it should work correctly, but before further investigations, are you
sure about the following :
- i18n namespace is correctly declared in a node parent of the <area>
element
- there is a <message key="about_area">something</message> in your i18n
bundle
- the <area> element makes it thru the i18n transformer (no xsl before
the i18n transformer that could alter the area element)
could you post the sitemap fragment and some more xml lines?
Simone
brosich@univ.trieste.it wrote:
> I have a strange problem.
>
> Out of a generator i have the following tag
>
> ...
> <area id="1" name="about_area" colour="FF0000" label="about_area"
> i18n:attr="label">
> ...
>
> After an i18n transformer, all "<i18n:text>" tags are correctly
> translated but the tag above is unchanged and the attribute "label"
> is untranslated.
>
> Any suggest?
>
> Alberto Brosich
>
> Cocoon 2.1.8
> Jetty
> Linux Debian 3.1
> Kernel 2.6.15
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
Simone Gianni
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org