cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <kpiroum...@apache.org>
Subject Re: strange output when i use i18n transformation
Date Fri, 27 Dec 2002 07:11:08 GMT
From: "Cocoon User" <cocoon@eng.gr>

> hello people
>
> i have a very strange output when i use i18n
> when i use
> <element>
> <i18n:text>something</i18n:text>
> </element>
>
> and i ask <xsl:value-of select="//element" disable-output-escaping="yes"/>
> i get in output:
>
>
%0D%0A%09%09%09%09%09%09%09%0D%0A%09%09%09%09%09%09%09%09something%0D%0A%09%
09%09%09%09%09%09%0D%0A%09%09%09%09%09%09%09%09
>
> its very strange because when i remove the i18n element and try with
>
> <element>
> something
> </element>
>
> i get in output
> the "something" string

The string you get consists of CR/LF and Tab characters in URL encoded form.
Probably, you have those characters in your dictionary file, e.g.:
<message>[CR][LF]
[tab][tab]something[CR][LF]
</message>

and they come out as-is.

The other possible source of those characters is the XSLT. Try to use:
<xsl:value-of select="normalize-space(./osm:text)"
disable-output-escaping="yes"/>

Regards,
  Konstantin

>
> this hapend only when i get the elements value and i put it into a
> parameter look at xsl code that follow
>
>
> a part of my xml code
> ---------------------
> <osm:hlink id="" class="mainlink" hclass="hmainlink" outerclass="">
> <targetURL>sitebuilder.Services</targetURL>
> <osm:linkparam name="locale">
> <osm:paramvalue>en</osm:paramvalue>
> </osm:linkparam>
> <osm:text>..: <i18n:text
i18n:key="hmn_services">article_text1</i18n:text></osm:text>
> </osm:hlink>
>
>
> <osm:hlink id="" class="mainlink" hclass="hmainlink" outerclass="">
> <targetURL>sitebuilder.Activities</targetURL>
> <osm:linkparam name="locale">
> <osm:paramvalue>
> <i18n:text i18n:key="locale_lang">locale_lang</i18n:text>
> </osm:paramvalue>
> </osm:linkparam>
> <osm:text>..: <i18n:text
> i18n:key="hmn_activities">article_text1</i18n:text></osm:text>
> </osm:hlink>
>
>
> the xsl part that make the trasformation
> ----------------------------------------
> <xsl:template match="osm:hlink">
> <span>
> <xsl:attribute name="class"><xsl:value-of
select="@outerclass"/></xsl:attribute>
> <a onmouseover="changeUp(this)" onmouseout="changeOut(this)">
> <xsl:attribute name="href">
> <xsl:value-of select="./targetURL"/>?<xsl:call-template
name="osm:linkparam"/>
> </xsl:attribute>
> <xsl:attribute name="class"><xsl:value-of
select="@class"/></xsl:attribute>
> <xsl:attribute name="oclass"><xsl:value-of
select="@class"/></xsl:attribute>
> <xsl:attribute name="hclass"><xsl:value-of
select="@hclass"/></xsl:attribute>
> <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
> <xsl:value-of select="./osm:text" disable-output-escaping="yes"/>
> </a>
> </span>
> </xsl:template>
>
> <xsl:template name="osm:linkparam">
> <xsl:value-of
>       select="./osm:linkparam/@name"
>       disable-output-escaping="yes"/>=<xsl:value-of
> select="./osm:linkparam/osm:paramvalue" disable-output-escaping="yes"/>
> </xsl:template>
>
>
> and the output in browser source
> --------------------------------
> <span xmlns:fo="http://www.w3.org/1999/XSL/Format" class="">
> <a onmouseout="changeOut(this)"
>    onmouseover="changeUp(this)"
>    href="sitebuilder.Services?locale=en"
>    class="mainlink"
>    oclass="mainlink"
>    hclass="hmainlink"
>    name="">..: services
> </a>
> </span>
>
>
> <span xmlns:fo="http://www.w3.org/1999/XSL/Format" class="">
> <a onmouseout="changeOut(this)"
>    onmouseover="changeUp(this)"
>
>
href="sitebuilder.Activities?locale%0D%0A%09%09%09%09%09%09%09%0D%0A%09%09%0
9%09%09%09%09%09en%0D%0A%09%09%09%09%09%09%09%0D%0A%09%09%09%09%09%09"
>
>
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>    here is the problem ..... why i get this very strange string:
>    %0D%0A%09%09%09%09%09%09%09%0D%0A%09%09%09%09%09%09%09%09
>    between locale and en
>
>
============================================================================
============================
>
>    class="mainlink"
>    oclass="mainlink"
>    hclass="hmainlink"
>    name="">..: activities
> </a>
> </span>
>
>
> my browser display this string as one space
>
> any idea?
>
> thanx
>
> Stavros Kounis
>
>
>
> ---------------------------------------------------------------------
> 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