W3C home > Mailing lists > Public > public-forms@w3.org > April 2012

Binding to text nodes

From: Erik Bruchez <ebruchez@orbeon.com>
Date: Mon, 23 Apr 2012 16:56:36 -0700
Message-ID: <CAAc0PEV6hc47BXW7h9MqBvh-YresFq1Fuf12Q=mQi0zetNgB_A@mail.gmail.com>
To: public-forms@w3.org
All,

I could swear that we had covered this a long time ago, but I can't
find something very clear in XForms 1.1 on this.

The scenario is the following:

<xf:instance>
  <foo>bar</foo>
</xf:instance>

<xf:input ref="text()">

If this is allowed, upon initialization, <xf:input> binds to the text
node, and reads "the string-value of the node" [1]. But if the user
changes the value to the empty string, then as per setvalue, "the text
node is eliminated if the new value is the empty string" [2]. This
means the control loses its binding at the next refresh.

But do we actually disallow it, or warn about it? I can't find whether
that's the case.

Controls like <xf:input> have a "data binding restriction", which says
that they must bind to "simpleContent". What's not clear to me is
whether this term, which comes from XML Schema, encompasses binding to
text nodes. As usual deciphering XML Schema is difficult!

In short, I am asking:

- whether we made a decision on whether binding <xf:input> etc. to
text nodes is allowed
- if not, we should make such a decision
- if we decide(d) against allowing such bindings, we should make the
spec clearer
- if we decide(d) for allowing such bindings, we should make the spec
clearer and warn of the scenario above

Thanks,

-Erik

[1] http://www.w3.org/TR/xforms11/#ui-processing
[2] http://www.w3.org/TR/xforms11/#action-setvalue
Received on Monday, 23 April 2012 23:57:25 UTC

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