and its also a good idea to prepend valid xml / xhtml signature:
mytext =
'<?xml version="1.0" encoding="UTF-8"?>'+
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' +
'<div>'+mytext+'</div>';
cocoon.sendPage('my.jx',{ mytext : new
Packages.org.apache.cocoon.xml.StringXMLizable( mytext ) });
if your server has no internet access for dtd resolving setup a simple
EntityResolver
hth
Thomas
Am 28.05.2010 07:42, schrieb Thomas Markus:
> Hi,
>
> StringXMLizable is a good starting point. Your missing a root element
> for xml parsing.
>
> in flow script try:
>
> var mytext = 'an html <b>text <i>with</i> content</b>.';
>
> call jx with
> cocoon.sendPage('my.jx',{ mytext : new
> Packages.org.apache.cocoon.xml.StringXMLizable('<div>'+mytext+'</div>') });
>
> an an your jx simply include:
> ${mytext}
>
> thats all
>
> outside of flowscript create a simple Transformer for this.
>
> regards
> Thomas
>
>
>
> ---------------------------------------------------------------------
> 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]