You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Abbas Mousavi <ab...@yahoo.com> on 2007/01/27 15:29:14 UTC

Storing XML fragments in form fields

Hi
I have a simple application and use loadXML, showForm, saveXml to geting some data from user and
saving it in eXist, Can I save an xml fragment as one of the fields of the form?
(I have a javascript tree editor in a textarea and want to save the resulting xml tree in one field of the form)
 Is there any XML data type for field? if not, what should I do?
 
---------------------------------
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.

Re: Storing XML fragments in form fields

Posted by Mark Lundquist <lu...@gmail.com>.
Hi Abbas,

On Jan 27, 2007, at 6:29 AM, Abbas Mousavi wrote:

>  Is there any XML data type for field?

Unfortunately not.  It sounds like it might be a good idea though, you 
should submit a feature request via JIRA

If you decide to make an xml datatype, follow the patterns you find in 
package org.apache.cocoon.forms.datatype.typeimpl and cocoon.xconf.  
You may find the classes in package org.apache.cocoon.xml (e.g. 
XMLUtils, StringXMLizable, etc.) to be helpful in implementing your 
datatype.

Otherwise, just keep the datatype="string" and don't bind it to your 
XML document, but instead parse the string to a Node in your flowscript 
and insert/replace it in the document.  Will that work?

HTH,
—ml—


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