Jason Johnston escribió:
So what you're wanting is a way to take the String contents of a form
widget and have it parsed into SAX events and inserted into the SAX
stream, correct? Note that it's not as simple as just disabling escaping
of XML characters, because that's just a serialization concern, whereas
you want to actually have it parsed into SAX. AFAIK there is no way using
the standard <ft:widget> mechanism or XSLT to achieve this.
I think JXTemplate is going to be your best bet. I'm assuming you're
already using JXTemplateGenerator in your display pipeline; if you're
using FormsTemplateTransformer instead then I'd suggest switching to JX
(it's the preferred method nowadays). Then you've got a couple choices:
1) If you're using the JX implementation from the 'template' block (cocoon
2.1.9+ only), then you can use the xmlize="true" attribute of jx:out:
<jx:set var="xhtmlString"
value='${widget.getChild("myOutputWidget").getValue()}' />
<jx:out value="${xhtmlString}" xmlize="true" />
2) If you're using the old JX implementation then you should be able to do
something similar, but you have to manually create an XMLizable object
from the String value first (cocoon provides a handy StringXMLizable class
for this purpose):
<jx:set var="xhtmlString"
value='${widget.getChild("myOutputWidget").getValue()}' />
<jx:out
value="${Packages.org.apache.cocoon.xml.StringXMLizable(xhtmlString)}"
/>
Hi Jason,
I tried this second option for the old JXTemplate and I was unable to
see it working: Here is a non working test:
<jx:set var="xhtmlContentTest" value="<html> Hello <b>
world! </b> </html>"/>
<jx:out
value="${Packages.org.apache.cocoon.xml.StringXMLizable(xhtmlContentTest)}"/>
What I am doing wrong?
Best Regards,
Antonio Gallardo.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]