Simon Collins wrote:
Hi all,
When using Cocoon forms I've noticed that when writing out the form contents to an XML file (via the form.save(document) method), the root namespace declaration does not get written out.
I saw this first in an application I'm writing but then verified that it also occurs in the Forms GUI sample. For example this is a snippet of the output from that sample (form_model_gui_data-result.xml):
<!-- license etc removed before here --> <fd:form> <fd:widgets> <fd:action id="samp-action"><fd:label>Sample Action</fd:label></fd:action> <fd:aggregatefield id="samp-aggregatefield"><fd:label>Sample AggregateField</fd:label><fd:widgets> <fd:field id="samp-aggregate-field-1" required="true"><fd:label>Sample Aggregate Field 1</fd:label></fd:field> <fd:field id="samp-aggregate-field-2" required="true"><fd:label>Sample Aggregate Field 2</fd:label></fd:field> </fd:widgets></fd:aggregatefield>
<!-- stuff in between deleted --> </fd:form>
The namespace definition for prefix "fd" is not written out. I suspect that this omission occurs when saving the form model to the DOM doc
I find that hard to imagine, but I'ld have to agree that suspecting the serialization is even weirder :-)
rather than when serialising the DOM doc to file but I could be wrong.
Has anyone else had this problem? I'm running the nightly build of 2.1 from 6/4/04 on JDK1.4.2_04b05 under Tomcat 4.1.27
Simon,
I just tested the gui sample and result but cannot see what you are refering to (I'm on the shipped jetty/w2k/jdk1.4.2_04)
maybe there is a special case under which things occur, could you double-check, and describe your testprocedure?
I tried to create the same structure you pasted in the mail
In the result there are a lot of dangling new-lines in the file (I suspect them to come from old text-nodes), but the comment as well as the root node and it's namespace declarations fd and i18n were preserved correctly.
Apart from this minor issue the form stuff is excellent - saving me a lot of time and effort so congratulations to all involved in it.
thx chap, we're planning to make it even better, so stay tuned and keep your comments coming!
-marc= -- Marc Portier http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center Read my weblog at http://blogs.cocoondev.org/mpo/ [EMAIL PROTECTED] [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
