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

how to bind model-items to instance-data ?

From: <Dirk.Dinger@netformfive.de>
Date: Mon, 18 Jun 2001 17:54:23 +0200
To: "'www-forms@w3.org'" <www-forms@w3.org>
Message-ID: <OFF85DB904.1395BE2B-ONC1256A6F.0054FC38@netformfive>
Greetings,

According to the code-example given in section 2.5 "The XForms Model", my
interpretation is, that it is not yet clear,
how model-items and instance data are bound together ?
|--------------------------------------------------------------------------|
|    <!-- add to the cc model item the following: -->                      |
|    relevant="value('payment/@type') == 'credit'"                         |
|    required="true"                                                       |
|    datatype of "xform:string"                                            |
|    facet pattern of "\d{14,16}"                                          |
|                                                                          |
|    <!-- add to the exp model item the following: -->                     |
|    relevant="value('payment/@type') == 'credit'"                         |
|    required="true"                                                       |
|    datatype of "xform:gYearMonth"                                        |
|--------------------------------------------------------------------------|



I can't neither see a "ref" property for model items nor for instance data
elements. As far as I see it, ref is only used to connect controls to
instance data. A binding between model items and instance data could be
archieved implicitly by using the same xml structure for the model and for
the instance data. The example given below is not conform to the latest
draft, but it illustrates what I mean.

  <model>
    <group name="ship-address">
      <string name="street" required="true" minLength="6"/>
      <string name="town" required="false" minLength="2"/>
      <number name="postcode" scale="0" minInclusive="1000"
              maxInclusive="9999" required="true"/>
    </group>
    <group name="bill-address">
      <string name="street" required="true" minLength="6"/>
      <string name="town" required="false" minLength="2"/>
      <number name="postcode" scale="0" minInclusive="1000"
              maxInclusive="9999" required="true"/>
    </group>
    <boolean name="wrap"/>
  </model>

  <instance>
    <ship-address>
      <street>123 Some St.</street>
      <postcode>2001</postcode>
    </ship-address>
    <bill-address>
     <street>Suite 9456 Another Way</street>
      <town>Sometown</town>
      <postcode>2010</postcode>
    </bill-address>
  </instance>

Is this the intended way ? (I don't think so)

What am I missing here ?

Any hints welcome,
Dirk Dinger
Received on Monday, 18 June 2001 11:57:03 GMT

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