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

sec 4.2.2/lazy authoring

From: Aaron Reed <mozillaxforms@yahoo.com>
Date: Sun, 29 May 2005 22:33:49 +0000 (UTC)
To: www-forms@w3.org
Message-ID: <loom.20050529T233756-28@post.gmane.org>

While trying to implement sec 4.2.2 of the spec, I ran into issues that I didn't
know the answer to.  Take this form, for example:

<?xml version="1.0" encoding="ASCII"?>
<html xmlns:xforms="http://www.w3.org/2002/xforms"
      @namespace xforms url("http://www.w3.org/2002/xforms");
      /* Should be pseudoelement |::value| instead of |input|,
       * and pseudoclass |:invalid| instead of |[invalid]|
      xforms|*[invalid] input {
        background-color: red;
      /* Should be pseudoclass, |:disabled| instead of |[disabled]| */
      xforms|*[disabled] {
        display: none;
    <title>xforms-model-construct-done testcase</title>
      <xforms:instance xmlns="">
    <xforms:model id="emptyModel">
      <xforms:submission id="emptySubmission" method="post"
action="http://xformstest.org/cgi-bin/echo.sh" />

    <h2> When you click on submit, empty values should be
         properly submitted inside an root instance node named
    <h3> Exercises sec. 4.2.2 of the spec </h3>
        <xforms:output model="emptyModel"
          <xforms:label>label for output: </xforms:label>
        <xforms:output model="emptyModel" value="emptyValue2">
          <xforms:label>label for output: </xforms:label>
        <xforms:submit model="emptyModel" submission="emptySubmission">
          <xforms:label>Click to submit</xforms:label>

When I try this in a variety of processors and click on the submit element, I
get different results.  What I would EXPECT from reading the spec to have
submitted an instance document that looks like this:


And after document load and during xforms-model-construct-done processing, the
processors would have created an instance element (invisible to the DOM) with
id="emptyinstance" under the model with id="emptyModel", a child called
'instanceData' and grandchildren called 'emptyValue' and 'emptyValue2'.

Or am I missing something?

Other questions I have, assuming for each that there is an empty model similar
to the example above:
1) should all calls to instance('xxx') that fail to find an instance element
with id='xxx' cause the creation of such an instance element?  Or just the
single node binding attributes (@bind and @ref)?
2) if it is just SNB attrs, then a xf:bind that references a non-existant
instance creates the instance document in all cases, or just when that xf:bind
is actually referenced by a control?  I would think the latter, right? 
3) what if expression looks like ref="instance('emptyinstance1')/codes/group[
<at> code=instance('emptyinstance2')/category]/name"?  Will this one expression
cause the creation of two instance documents with the id's of emptyinstance1 and
4) Does the creation of 'instance data nodes' as mentioned in the spec include
creation of attributes on nodes?  So in the binding expression in #3, would it
create a node called 'group' with an attribute called 'code'?
5) am I right to assume that if there is an emtpy model like the example above
and I have a control with ref="/values/value" that the control will be
'disabled' because the root would have to be 'instanceData' and not 'values'?
6) Should I be able to have a ref="instance('emptyinstance')/emptyValue" on my
xf:submission element if I connect it up with a lazy authored emptyValue
reference on a control later in the document?

While well intentioned, this lazy authoring is confusing to implement! :=)

Any help appreciated,
Received on Sunday, 29 May 2005 22:37:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:15 UTC