W3C home > Mailing lists > Public > www-forms@w3.org > May 2001

Redundancy in XForms ?

From: Maxime Levesque <cecmax@yahoo.com>
Date: Thu, 10 May 2001 12:46:30 -0700 (PDT)
Message-ID: <20010510194630.56890.qmail@web13703.mail.yahoo.com>
To: www-forms@w3.org

 The two following examples seem to suggest redundancy
in XForms :

  Example1 :
  <!-- from XForms User Interfaces chapter 7.3.6 -->

  <exclusiveSelect ref="icecream/flavor">
    <caption>Flavor</caption>
    <item value="a">Vanilla</item>
    <item value="b">Strawberry</item>
    <item value="c">Chocolate</item>
  </exclusiveSelect>

  Example2 :
  <!-- from XForms Model section 5.3.2 (Enumerated
Datatype) -->

  <xsd:element name="foo" enum="closed">
    <xsd:complexType>
      <xsd:restriction base="xform:string">
        <xsd:enumeration value="Mastercard"/>
        <xsd:enumeration value="Diner's Club"/>
        <xsd:enumeration value="American Express"/>
      </xsd:restriction>
    </xsd:complexType>
  </xsd:element>

 An enumeration can be defined in the model *as well
as
 in the widget declaration*.

 Assuming that this is redundancy (and not a
misunderstanding on my part), the question would be :
how do we elimintate it ?
 Should an enumeration be defined only in the XForm
Model or

 in the XForm UI ?

 My opinion is that it belongs in the Model, here's
why :

 - It would eliminate the need for dynamically
generating XForms UIs.
  It seems that an XForms UI could be statically
defined
  if it was not for cases like  Example1, i.e. most
non trivial
  applications will need to populate enumerations for
selection widgets
  dynamically (ex.: from a database). This seems to be
the
  only part of an XForms UI that would require dynamic
  generation. The assumption here is that the more
that can
  be defined statically (i.e. in a flat file) the
better,
  i.e. writing an xml expression in a flat file is
more declarative
  of a task than generating it with a program (ex.: a
servlet)...
 
  Also, there seems to be a hook in XForms model for
obtaining
  dynamic enumerations from an external method
invocation:

  Example3
  <!-- from section 5.3.2 (Simple Syntax with Dynamic
Choices): -->
  <xform:string name="foo" enum="closed"
choices="getCreditCardList()"/>



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Received on Thursday, 10 May 2001 15:46:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:49 GMT