RE: xforms for inhomogenous collections

Oliver, 
 
 In response to your first question, you should be able to achieve what you are thinking by using the group element with relevance.  It would be very similar to the idea you had with the switch, but it would be based on the "XPath predicate".  

 In response to your second question, the repeat element has an attribute called "number" that tells the processor how many of the collections to display at a time.  In other words, the entire collection would be available but only the number you chose would be displayed.  In most cases, this affect would be done inside a separate window with a scroll bar.  How you choose to design it, is up to you.

 I hope this all helps.

Susan 

FormFaces Developer

-----Original Message-----
From: Oliver Scholz [mailto:alkibiades@gmx.de]
Sent: Tuesday, December 16, 2003 5:12 AM
To: www-forms@w3.org
Subject: xforms for inhomogenous collections



I plan to implement an application (for GNU Emacs) which can be used
to edit XML files containing record sets in forms.  Please note that
this is not meant as a web application but as an alternative way to
edit XML files on the local disk.

Typically a user would point this application to two files, the XML
file containing the data and a configuration file, specific to this
particular XML, which specifies the forms and how they should update
the data. If you are familiar with GNU Emacs: this is basically meant
to fill the functionality of forms.el for XML files.

Obviously it seems like a good choice to base that on
XForms. Therefore I am considering to implement a subset of XForms 1.0
in Emacs Lisp. However, there are a few things that I do not yet
understand.

1. Record sets may be inhomogenous.

An made up example for a data file:

<record-set>
  <record type="author">
    <name>Rudyard Kipling</name>
    <writings>
      <book>The Jungle Book</book>
      <series>Puck</series>
    </writings>
  </record>
  <record type="book">
    <title>The Jungle Books</title>
    <author>Rudyard Kipling</author>
  </record>
  <record type="protagonist">
    <name>Mowgli</name>
    <book>The Jungle Books</book>
  </record>
</record-set>

Besides the data being inhomogenous, it should even be possible to let
the forms have a different layout based on certain properties, here
e.g. the type attribute of the `record' element.

The standard specifies explicitely that the `xforms:repeat' element
is meant to deal with homogenous data only.  My first thought was
that I could deal with this by a `switch' element within a `repeat'
until I realised that the values of the `selected' attribute of the
`case' element is *not* an XPath predicate. So I am at lost. Am I
missing something or does the standard not provide anything for
inhomogenous collections?


2. Specifying pages

I envision that it should be possible to optionally (!) display only
one record at a time on the rendering canvas with buttons to switch
forward to the next or backward to the last record or with an input
field to switch to any arbitrary record. I imagine this would be
something like a `repeat' element with a special attribute.

I can't see anything in the standard catering for this. That does
probably mean that it is not there?


Am I missing something? Or is XForms not meant for application areas
like this one? Are there better ways to get in effect what I want than
the ways I have been looking for?

I would not mind to implement extensions, if necessary.  The
alternative to XForms would be to implement my own configuration
language and I do not expect that those configuration files would
be of any use outside of my application.  So are there any working
drafts for XForms discussing or suggesting solutions for any of the
above?  If not, any recommendations on this?


    Oliver
-- 
Oliver Scholz               26 Frimaire an 212 de la Révolution
Taunusstr. 25               Liberté, Egalité, Fraternité!
60329 Frankfurt a. M.       http://www.jungdemokratenhessen.de

Tel. (069) 97 40 99 42      http://www.jdjl.org

Received on Tuesday, 16 December 2003 08:58:06 UTC