- From: John Boyer <boyerj@ca.ibm.com>
- Date: Wed, 6 Dec 2006 12:44:28 -0500
- To: Steve K Speicher <sspeiche@us.ibm.com>
- Cc: www-forms@w3.org, www-forms-request@w3.org
- Message-ID: <OFD7854CFB.E803E55C-ON8525723C.005E36C5-8525723C.00617536@ca.ibm.com>
Hi Steve,
Based on a resolution of and action item from the working group, I
recently wrote an erratum (E36) that covers this issue. The updated
errata document should be public on Friday. Meanwhile, member only access
is available at
http://www.w3.org/MarkUp/Forms/Group/Drafts/REC-xforms-10-ongoing/errata/REC-xforms-10-2ndEdition-errata-diff.html
Because it was not clear that a data binding restriction means that an
xforms-binding-exception should occur if the binding restriction is
violated, erratum E36 states that "If a form control violates its data
binding restriction, an xforms-binding-exception must occur." For further
clarity, the statement about form controls that read simple content and
bind to element ndoes was amended to add: "If element child nodes are
present, then an xforms-binding-exception must occur."
The bind restriction is interpreted as a restriction on the actual
content, not what the content should be in order to be schema valid. If
an element *should* be simple content according to schema, but it actually
contains complex content, then it is still a violation of the binding
restriction. Similarly, if there is no schema information, but the bound
node contains complex content, it is still a violation of the restriction
to simple content. Finally, if the element content is simple, then a
"simple content" form control should be able to bind to the element
regardless of what the schema says is necessary for the node to become
schema valid as we already have a mechanism for detecting and reporting
schema violations, and a form control is allowed to be bound to a node
that is schema invalid.
The rule about choosing the 'first text node' was meant to resolve the
problem of having PI nodes or comment nodes infesting the simple content
of an element. The rationale appears to have been that the node is still
simple content, so it is schema valid and hence we have to define *some*
reasonable behavior. However, that decision has caused quite a bit of
trouble. But hindsight is known for being remarkably clear, and the
erratum at least helps to fix this latest problem that has arisen due to
the 'first text node' rule.
In any case, it is easy to understand that many implementations do not
currently enforce the binding restriction as described by the erratum
because it is a recent erratum based on a resolution in November, so it
will take a bit of time to show up in implementations. However, in the
meantime, it is recommended to amend existing content that may rely on
violation of the data binding restrictions as the content violates the
restrictions whether or not the implementations currently enforce the
restrictions. This can be done by changing the UI bindings to refer to
the actual first text node. This is a useful change to make for
consistency of truly processing mixed content anyway since it means the
author identifies the text nodes of mixed content in all cases, rather
than all cases except when the text node happens to be the first child of
the element.
Best regards,
John M. Boyer, Ph.D.
STSM: Workplace Forms Architect and Researcher
Co-Chair, W3C Forms Working Group
Workplace, Portal and Collaboration Software
IBM Victoria Software Lab
E-Mail: boyerj@ca.ibm.com http://www.ibm.com/software/
Blog: http://www.ibm.com/developerworks/blogs/page/JohnBoyer
Steve K Speicher <sspeiche@us.ibm.com>
Sent by: www-forms-request@w3.org
12/05/2006 07:51 AM
To
www-forms@w3.org
cc
Subject
Question regarding TestCase 8.1.4.b and simpleContent binding restriction
In looking at test case 8.1.4.b [1] which deals with testing that
<xforms:textarea> can not bind to non-simple content (aka complex content)
[2], I have some questions.
Say a sample data instance (with no associated schema) is:
<message>Mixed content data BEFORE body_<body>
<name>-Name-</name>
<title />
</body>_Mixed content data AFTER body</message>
With this textarea:
<xf:textarea ref="/message" />
The above works in formsPlayer, X-Smiles and Mozilla XForms. Though this
is clearly not simpleContent.
Some questions:
1) Is the content model solely determined by the associated type
information? For example, the above sample doesn't have a schema and can
be inferred to be complex, or more appropriately, mixed content.
2) What should the failure indication be? xforms-binding-exception
dispatched, control disabled/hidden, ???
3) Should the mixed content be allowed, without binding to specific text
nodes (see example above)? As stated, this works in multiple
implementations (they bind to the first text node)
My only concern, with enforcing this restriction, is that I know of quite
a few deployed forms that rely on mixed content and the implicit binding
to the first text node.
For the time being, I'm going to consider the test case 8.1.4.b [1] to be
invalid until I hear otherwise.
Regards,
Steve Speicher
[1]
http://www.w3.org/MarkUp/Forms/Test/XForms1.0/Edition2/Chapt8/8.1/8.1.4/8.1.4.b.xhtml
[2] http://www.w3.org/TR/xforms/slice8.html#ui-processing
[3]
http://lxr.mozilla.org/seamonkey/source/extensions/xforms/nsXFormsUtils.cpp#762
[4] https://bugzilla.mozilla.org/show_bug.cgi?id=356190
Received on Wednesday, 6 December 2006 17:44:47 UTC