cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andre Juffer <ajuf...@sun3.oulu.fi>
Subject Re: capturing XML in forms
Date Thu, 22 Dec 2005 10:17:02 GMT
Jean-Baptiste Quenot wrote:
> * Andre Juffer:
> 
> 
>>Capturing XHTML content via forms is something I have never done
>>before (and is of course  not specific to Cocoon).  Basically, I
>>guess, one would have to parse the text and store the result for
>>instance in a  DOM document which is subsequently  stored in the
>>XML  database,  right? Or is  there  is  more simple  or  better
>>solution, maybe cocoon can handle this already?
> 
> 
> Integrated in Cocoon  there is the htmlarea  styling that displays
> the  HTMLArea  editor, and  the  htmlarea  convertor in  forms  to
> convert the text typed by the user to XHTML.  This is very similar
> to what you intend to do, especially the convertor stuff.
> 
> See the HTMLArea forms samples at
> http://cocoon.zones.apache.org/demos/release/samples/blocks/forms/htmlarea

This looks very similar to the one that I currently use, Xinha:

http://xinha.gogo.co.nz/xinha-nightly/examples/full_example-body.html

As far as I could see this editor produces valid XHTML. That is, after 
capturing the textarea content, I actually replace all &lt; and &gt; by 
a '<' and '>' and put that in a java.lang.String containing also the 
"<?xml version="1.0" ?>" and use a SAX parser to parse this String 
(place it into a StringReader first). It appears entirely valid. It 
should then be straightword to create a DOM document with cocoon's 
org.apache.cocoon.xml.dom.DOMBuilder and place this Document into the 
Session and ultimately it can be inserted into the pipeline with the 
Read DOM Session Transformer (I have not tried this part yet).

I'll have a look at HTMLArea forms samples. Thanks.

Andre

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


Mime
View raw message