cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: i18n:text stored in an xsl:variable
Date Thu, 27 Mar 2008 04:51:13 GMT
On 20.03.2008 13:29, Rainer Koschnick wrote:

> It seems that the results of a <i18n:text/> translation cannot be stored 
> in a <xsl:variable/>.

That has nothing to do with i18n. What you are trying to do just does 
not work with XSLT 1.0.

> <xsl:template match="paramText">
>     <xsl:variable name="param0">
>         <i18n:text key="{@param0}"/>
>     </xsl:variable>
>     <span>
>         <i18n:translate>
>             <i18n:text key="{text()}" />
>                 <i18n:param>
>                     <xsl:value-of select="$param0" />
>                 </i18n:param>
>             </i18n:text>
>         </i18n:translate>
>     </span>
> </xsl:template>
> But in the output $param0 is not shown (since it's empty).

It's not empty, but it contains only a more or less unusable result tree 
fragment in it. You can only access it with <xsl:copy-of 
select="$param0"/>. That's why XSLT processors usually provide an 
extension function to convert a RTF into a nodeset (on which you can 
operate again as usually).

This does not help with your problem, but it seems you figured out 
yourself to get what you want.


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

View raw message