cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wouter.DERU...@cec.eu.int
Subject RE: Cdata section in xsp
Date Tue, 30 Mar 2004 12:18:06 GMT
We're trying to migrate our existing application to cocoon. This application
supports multiple languages so we stored the text in a DB. However the text
in the DB can contain html tags like  " this is <b>bold</b> " for English
and " celui-ci c'est <b>gras</b> " for French.  Now we want to use i18n to
translate our pages. Therefor we were trying to generate our catalogue with
XSP .  As such we are looking to generate for instance:

For English

<catalogue xml:lang="en">
	<message key="test"><![CDATA[this is <b>bold</b> ]]></message>

</catalogue>

For French

<catalogue xml:lang="fr">
	<message key="test"><![CDATA[celui-ci c'est <b>gras</b>]]></message>

</catalogue>

So that's why we need a CDATA section. If I can't generate cdata my xsp will
generate a catalogue like this:

<catalogue xml:lang="en">
	<message key="test">this is &lt;b&gt;bold&lt;/b&gt;</message>

</catalogue>

However , struggling with this example  ,I experienced another problem with
i18n. Suppose I have a static catalogue (not generated with xsp this time)
who looks like:

<catalogue xml:lang="en">
	<message key="test"><![CDATA[this is <b>bold</b> ]]></message>

</catalogue>


 When I know apply a i18n transformation I see that the <b>bold</b> has
become &lt;b&gt;bold&lt;/b&gt; in the resulting html ... Or to say it in
xslt terms : when selecting the actual translation,  the i18n
transformation applied a <xsl:value-of select="."/> instead of a
<xsl:value-of select="." disable-output-escaping="yes"/>.  So I'm afraid
that in our case the i18n transformer is useless, unless someone has an idee
?




-----Original Message-----
From: Marc Portier [mailto:mpo@outerthought.org] 
Sent: Tuesday, March 30, 2004 12:23
To: users@cocoon.apache.org
Subject: Re: Cdata section in xsp




Wouter.DERUYCK@cec.eu.int wrote:

> I want to dynamically generate an xml catalogue for I18n using XSP. If my
> translations contain certain characters like '>' or '<'  my catalogue xml
> file will not be valid unless I put every translation text in an CDATA
> section.
> 

Joerg's point is that &lt; and &gt; will do as well to insert those in 
the characterstream...

whatever you put in originally as <![CDATA[ will go through the 
sax-stream as characters, and not as elementsl

but the serializer will not recreate cdata sections for those since it 
doesn't now about those any more and more importantly having them or not 
is just a syntactical-sugar thing

the serializer will however inject the chars by using the correct 
character-entities

bottom line
you don't get cdata but you don't need them, do you?

-marc=

> -----Original Message-----
> From: Joerg Heinicke [mailto:joerg.heinicke@gmx.de] 
> Sent: Tuesday, March 30, 2004 11:29
> To: users@cocoon.apache.org
> Subject: Re: Cdata section in xsp
> 
> 
> On 30.03.2004 11:00, Wouter.DERUYCK@cec.eu.int wrote:
> 
> 
>>Hello,
>>
>>How can I output a cdata section in an XSP ?  I need the disable output
>>escaping feature of xslt. 
> 
> 
> First, please do not response to mails from other threads when starting 
> new threads as this breaks thread view in thread-aware browsers.
> 
> Second, what exactly do you need it for? Every "normal" character in 
> cdata can be added escaped as normal text and you will have the same at 
> the end. And how shall "disable output escaping feature of xslt" stand 
> in relation to this?
> 
> Joerg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 

-- 
Marc Portier                            http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at                http://blogs.cocoondev.org/mpo/
mpo@outerthought.org                              mpo@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message