W3C home > Mailing lists > Public > public-forms@w3.org > December 2008

Latest XForms for HTML spec: 2 Questions on Form containment and multiple models generations

From: Thomas Ling <nkling@gmail.com>
Date: Wed, 3 Dec 2008 10:41:27 -0500
Message-ID: <884121640812030741i44ff018dm48c0a65820ff1881@mail.gmail.com>
To: public-forms@w3.org

Hi All,

I have 2 questions regarding the latest XForms for HTML spec.
It is not clear to me what shouldbe  the exact behavior in XForms for
HTML for the following scenarios.

1. Orphan control outside of  Form containment, if I have the following markup:

<body>
 <form name="person" >
   <input name ="name" datatype="string" value="thomas" />
.....
</form>

<!--- orphan control -->
 <input name ="address" datatype="string" value="100 Main St." />
</body>

from my understanding XForms for HTML would expand to something similar to this:

<body>
 <form name="person" id="person">
    <xf:model>
       <xf:instance>
       <person>
           <name>thomas</name>
       </person>
       </xf:instance>
    <xf:model>
    <input name ="name" datatype="string" value="thomas" />
.....
</form>

<!--- orphan control -->
<input id="a1" name ="address" datatype="string" value="100 Main St." />
</body>

My question is should XForm for HTML process the address input control
"a1" and how does it get processed?
Following the logic of lazy authoring from the XForms 1.1 spec. The
"address" node would be inserted to the
default model of the default instance document.. but it's not very
clear to me whether a default model would be created
in this case for the orphan control? or
the address node will be inserted and bind to the first existing model
of the document which is the model under
form "person".

2. Does cross forms bind allow in XForms for HTML?
  Can an orphan control bind and  do calculation to a node in more
than a model/form?
  If an orphan control is allowed, should it allow to bind to more
than one form?

<body>
<form name="f1">
   <input id="principal" name="principal" datatype="double"
value="10000"  constraint=". &gt;= 1000 and . &lt;= 100000" />
</form>
<form name="f2">
   <input id="interestrate" name="interestrate" datatype="double"
value="5" constraint=". &gt;= 5 and . &lt;= 60" />
   <input id="duration" name="duration" datatype="integer" value="12"
constraint=". &gt; 0 and . &lt;= 84" />
</form>

<!--- orphan control -->
<input id="total-output" name="totalpayout"
calculate="form('f1')/principal + (125 * form('f2')/interestrate *
(form('f2')/duration * 0.1)))" />
</body>

I am curious about the possibilities of the above scenario since it
does seem like something an HTML author might try.

Let me know what you think.

Thanks


Best Regards

Thomas
Received on Wednesday, 3 December 2008 15:42:02 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 October 2013 22:06:49 UTC