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)}"
/>

Hope that helps
--Jason


> Thanks for your answer. But I found out that the contents of the fields
> are already escaped before the stylesheets get applied. So the problem
> is somewhere else.
>
> Werner
>
>
> Jeroen Reijn wrote:
>
>> Hi Werner,
>>
>> i'm not sure, but you could modify the xsl that applies the output
>> widget and add something like:
>>
>> <xsl:value-of select="fi:value" disable-output-escaping="yes"/>
>>
>> I hope this helps.
>>
>> Regards,
>>
>> Reijn
>>
>>
>> werner wrote:
>>
>>> Dear Mailinglist!
>>>
>>> I know this has been asked before, but I could not find a clean
>>> solution. How can I display HTML in a output widget and prevent
>>> escaping? i.e. <br/> should not be converted to &lt;br/&gt;
>>>
>>> Thanks you
>>> Werner
>>>
>>> ---------------------------------------------------------------------
>>> 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]
>>
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to