cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victoria Vitaver <victo...@tt.com.au>
Subject New Xml files with CForm bindings
Date Fri, 26 Aug 2005 07:37:29 GMT
Hi,

I am trying to create an input form, which upon 'submit' gets saved as an XML file.

I have successfully been able to get the XML file with all info bar the root node.
The root node of my new XML file appears as '<unknown>' with all other info/nodes inside.

Any hints on what I am doing wrong will be appreciated.

Thanks,

Vica

------------
My bindings are as follows:

<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
path="/">

   <fb:set-attribute name="Package" value="Package"/>
   <fb:context path="Package">
	<fb:set-attribute name="packageCode" value="packageCode"/>
	<fb:set-attribute name="company" value="company"/>
	
	<fb:repeater id="grouping" parent-path="grouping" row-path="section1">
	    <fb:identity>
		<fb:value id="id" path="@id">
		    <fd:convertor datatype="integer"/>
		</fb:value>
	    </fb:identity>
	    <fb:on-bind>
		<fb:value id="section1" path="grouping/section1"/>
	    	<fb:value id="section2" path="grouping/section2"/>
	    </fb:on-bind>
	</fb:repeater>
   </fb:context>
</fb:context>

and my template file looks like :


<?xml version="1.0" encoding="UTF-8"?>
<div id="body">
   <ft:form-template
     xmlns:ft="http://apache.org/cocoon/forms/1.0#template" 
     xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" 
     action="#{$continuation/id}.continue?lenya.usecase=registration" method="POST">
	  
     	<ft:continuation-id/>
	  <fi:group>
	    <fi:hint>packageDetails</fi:hint> 
	    <fi:styling layout="columns"/>
	    <fi:items>
	      <ft:widget id="packageCode"/>
	      <ft:widget id="company"/>
	      <ft:widget id="grouping"/>
	      <ft:widget id="heading"/>
	      <ft:widget id="information"/>
	      <ft:widget id="searchDescription"/>
	      <ft:widget id="validity"/>
	      <ft:widget id="images"/>
	      <input type="submit"/>
	    </fi:items>
	  </fi:group>
   </ft:form-template>
</div>


the result file : 

<?xml version="1.0" encoding="UTF-8"?><unknown><packageCode>134234</packageCode><company>ay</company><grouping><item
position="0"><id/><section1>Something</section1><section2>Group</section2></item><item
position="1"><id/><section1>aldkfjaldskjf</section1><section2>laaldsjfl</section2></item></grouping><heading>heading
aof lakdsjf</heading><information><item position="0"><subHeading>info1</subHeading><description>info2</description></item></information><searchDescription>search
description of sorts</searchDescription><validity><item position="0"><fromPrice/><startSaleDate/><endSaleDate/></item></validity><images><item
position="0"><image/></item></images></unknown>


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


Mime
View raw message