Hi people,
I'm using CForms in Cocoon 2.1.8 and I've run into a bit of a problem (I sort
of posted about this a while back so a bit of this is a repost). I was trying
to feed some HTML into the form to provide output to the user. To do this I use
a pipe that generates XML output and then I try and serialize that into the
document using the JX template stuff that looks like:
<jx:set var="xhtmlString"
value='${widget.getChild("op-list").getValue()}' />
<jx:out
value="${Packages.org.apache.cocoon.xml.StringXMLizable(xhtmlString)}" />
Unfortunately that doesn't dynamically regenerate when the op-list value has
changed (if anyone knows how to make it do that under AJAX that would be the
best solution by far).
If I go for a straight up output then I just get the <div><p>Moo</p></div> tags
displayed. I looked at serialization on the forms-field-styling.xsl, as XSLT
1.0, and therefore Xalan (AFAIK) doesn't have a serialize function I looked at
creating one that looked something like this:
<!--This is an extension script to add serialization as a function-->
<xalan:component prefix="custom" functions="serialize">
<xalan:script lang="javascript">
function serialize(xmlString)
{
var output = Packages.org.apache.cocoon.xml.StringXMLizable(xmlString);
if(output == null)
{ output = "Oh Dear"; }
return output;
}
</xalan:script>
</xalan:component>
but that just generated NULL values so I gave up on that.
I even wrote a stylesheet to convert the HTML into Text and just use output but
IE seems to ignore the line breaks on the <pre /> tag when you insert it in
dynamically (damn IE).
Any ideas on how to get the AJAX stuff to display this dynamically when the
value changes?
Thanks,
Gary
*****************************************************************
The information contained in this message may be confidential or
legally privileged and is intended for the addressee only. If you
have received this message in error or there are any problems
please notify the originator immediately. The unauthorised use,
disclosure, copying or alteration of this message is
strictly forbidden.
*****************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]