In XSL you can solve this with "output-escaping". Don't know whether it can be done with XSP.
Anyway, it doesn't matter that XSP is generating <bold> right ???
You only need the < and > in your html.

On 30 Mar 2004, at 14:18, [EMAIL PROTECTED] wrote:

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:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 12:23
To: [EMAIL PROTECTED]
Subject: Re: Cdata section in xsp




[EMAIL PROTECTED] 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:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 11:29
To: [EMAIL PROTECTED]
Subject: Re: Cdata section in xsp


On 30.03.2004 11:00, [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Met vriendelijke groeten,
Bien à vous,
Kind regards,

Yves Vindevogel
Implements

Mail: [EMAIL PROTECTED] - Mobile: +32 (478) 80 82 91

Kempische Steenweg 206 - 3500 Hasselt - Tel-Fax: +32 (11) 43 55 76
Markt 18c - 9700 Oudenaarde - Tel: +32 (55) 30 55 76

Web: http://www.implements.be
<x-tad-smaller>
First they ignore you. Then they laugh at you. Then they fight you. Then you win.
Mahatma Ghandi.</x-tad-smaller>

Reply via email to