cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Max Pfingsthorn <max.pfingsth...@gmail.com>
Subject Re: New Xml files with CForm bindings
Date Fri, 26 Aug 2005 08:29:01 GMT
Hi!

Well, your result xml has to be well-formed, so I guess it makes up a
root element by itself.  Try saying path="/Package" in the root
context instead of path="/" and drop the extra context inside.

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

  <fb:set-attribute name="Package" value="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>

max

On 8/26/05, Victoria Vitaver <victoria@tt.com.au> wrote:
> 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
> 
>

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


Mime
View raw message