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

Suggestion for supporting recursive XML structures in XForms

From: Pepijn Noltes <pepijnnoltes.ml@gmail.com>
Date: Tue, 19 Sep 2006 11:29:51 +0200
Message-ID: <1177d2350609190229w32bd2cf8w1281689866407862@mail.gmail.com>
To: www-forms-editor@w3.org
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



Received on Tuesday, 19 September 2006 09:30:04 GMT

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