W3C home > Mailing lists > Public > www-forms-editor@w3.org > September 2006

Re: Suggestion for supporting recursive XML structures in XForms

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Tue, 19 Sep 2006 12:16:17 +0100
Message-ID: <640dd5060609190416p6cfa1242ma82c394a80111dc3@mail.gmail.com>
To: "Pepijn Noltes" <pepijnnoltes.ml@gmail.com>
Cc: www-forms-editor@w3.org

Pepijn,

Some people are going to be thinking that I've paid you to say this! I
absolutely agree with you on this, and if you take the approach that
you are suggesing--allowing repeat to recurse--you can easily
implement things like tree controls. However, the tree widget is far
more flexible than traditional +/- expand/collapse controls...it would
be easy, for example, to create some of the powerful database-related
controls that are increasingly used, where a row is expanded and then
further rows of data are shown.

Regards,

Mark


On 19/09/06, Pepijn Noltes <pepijnnoltes.ml@gmail.com> wrote:
> Hi,
>
> I'm a big fan of XForms and absolutely love it for the fact that a lot of
> functionality can be achieved with a few line of XForms.
>
> But one problem I keep bumbing into is that XForms cannot handle XML
> instances
> with a recursive structure.
> I solve this by generating the XForms in XQuery , but would prefer to do
> this
> with static XForms.
>
> To clarify what I mean I developed a example (with uses XBL) for proof the
> concept.
> This example works under Firefox 1.5.0.7 (with the XForms-plugin 0.6)
> and is attached to this mail.
>
> I think this would be a great feature for XForms 1.1, but than more neatly
> like:
>
> <xf:model>
>   <xf:instance xmlns="" id="list">
>     <instance>
>       <section name="1">
>         <paragraph>a</paragraph>
>         <paragraph>b</paragraph>
>         <section name="1-1">
>           <paragraph>a</paragraph>
>           <section name="1-1-1">
>             <paragraph>b</paragraph>
>           </section>
>         </section>
>       </section>
>       <section name="2">
>         <paragraph>a</paragraph>
>       </section>
>     </instance>
>   </xf:instance>
> </xf:model>
>
> <xf:group ref="instance('list')">
>   <xf:repeat id="section-repeat" nodeset="section">
>     <div>
>       <xf:output ref="@name">
>         <xf:label>section name: </xf:label>
>       </xf:output>
>     </div>
>     <xf:repeat nodeset="paragraph">
>       <xf:output ref=".">
>         <xf:label>paragraph: </xf:label>
>       </xf:output>
>     </xf:repeat>
>     <xf:repeat recurrentRepeat="section-repeat"/>
>   </xf:repeat>
> </xf:group>
>
>
> This should work great in combination with a xf:insert with the context
> and origin parameters
>
> Of course problems like duplicated id for the xf:repeat and xf:case should
> be
> though about, IMHO solveable (reference to id works in the current "repeat
> depth")
>
> Would this be something to consider adding to the XForms specification ?
>
> Greetings,
>
>  Pepijn Noltes
>  Software Engineer
>  Topic Embedded Systems
>  The Netherlands
>
>


-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/
Received on Tuesday, 19 September 2006 11:16:33 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:15 GMT