You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Philippe Guillard <pg...@citycita.net> on 2005/07/16 11:37:27 UTC

Non XML String

Hi,

I want to diplay a non XML String with XSP (That string containing HTML 
code retrieved from text/blob field in database). Sure i could escape it 
but i'd like to render the style, so transfom that String into XHTML.
I don't know how to deal with this, any idea?. I usually use JTidy in 
HTMLGenerator when i want to get some external file. But in that case  i 
would need to transform that String at the point to render it.

Example below, works as long as the HTML code is hopefully well formed :

<xsp:logic>String bodytag= <![CDATA[ "<root>" + postBean.getPostBody() + 
"</root>" ]]></xsp:logic>
<!-- No xsp:expr to avoid escaping -->
<p><util:include-expr expr="bodytag"/></p>

Phil

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


Re: Non XML String

Posted by Philippe Guillard <pg...@citycita.net>.
Hum, sorry i didn't check the archives enough...
Solution is to escape the code <xsp:expr>postBean.getPostBody()</xsp:expr>
Then in XSL   <xsl:value-of select="." disable-output-escaping="yes"/> !

Phil


Philippe Guillard wrote:

> Hi,
>
> I want to diplay a non XML String with XSP (That string containing 
> HTML code retrieved from text/blob field in database). Sure i could 
> escape it but i'd like to render the style, so transfom that String 
> into XHTML.
> I don't know how to deal with this, any idea?. I usually use JTidy in 
> HTMLGenerator when i want to get some external file. But in that case  
> i would need to transform that String at the point to render it.
>
> Example below, works as long as the HTML code is hopefully well formed :
>
> <xsp:logic>String bodytag= <![CDATA[ "<root>" + postBean.getPostBody() 
> + "</root>" ]]></xsp:logic>
> <!-- No xsp:expr to avoid escaping -->
> <p><util:include-expr expr="bodytag"/></p>
>
> Phil
>
> ---------------------------------------------------------------------
> 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