how to bind model-items to instance-data ?

Dirk,

I'm surely not the authority on this, but I imagine that the XForms model
defintion items will be associated with instance data in roughly (if not
exactly) the same way XML Schema definition items are associated to Instance
Data. It is a fairly complex method of association based on the node's
namespace uri and name, or relative location.

For more info, check out the Schema Recommendation.

- Ryan

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org]On
Behalf Of Dirk.Dinger@netformfive.de
Sent: Monday, June 18, 2001 11:54 AM
To: 'www-forms@w3.org'
Subject: how to bind model-items to instance-data ?


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 Thursday, 21 June 2001 20:43:50 UTC