W3C home > Mailing lists > Public > www-forms@w3.org > January 2006

RE: empty instance generates link exception?

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Fri, 6 Jan 2006 11:40:34 -0000
Message-ID: <80AA3C05-45AC-4795-BDBD-7FA44C2AA4B0@s15.mail.x-port.net>
To: "'John Boyer'" <boyerj@ca.ibm.com>
Cc: <www-forms@w3.org>, <www-forms-request@w3.org>, "'Aaron Reed'" <aaronr@us.ibm.com>

John,

> ...because an instance must contain a well-formed XML document,
> and empty document doesn't satisfy that.

I wonder if this is out of date though, now that we have
@replace="instance"? For every instance that will hold results you have to
keep doing this:
 
  <xf:instance id="inst-response">
    <dummy-serving-no-purpose />
  </xf:instance>
 
  <xf:submission
    action...method...blah blah
    ref="inst-request"
    replace="instance" instance="inst-response"
  />

There are other situations where you need empty instances:

  * creating an instance ready to be populated by script also currently
    requires creating a dummy node and then removing it;

  * in fP we allow lazy authoring to take place at the instance level
    rather than the model. In other words, you can create an empty
    instance and then have it populated by the use of lazy authoring.
    This is not possible if exceptions are thrown.

So all in all, I see no purpose in enforcing the *presence* of an XML
document--it doesn't gain us anything. (It goes without saying that if there
is something within the xf:instance tags then it must be well-formed, etc.)

And in terms of mindset (what a new author might expect to be able to do
having used other languages), I don't see why we don't support the
equivalent of all of the following pseudo-code constructions:

  var inst = new Instance();

  var inst = new Instance("<dummy />");

  var inst = new Instance("http://example.org/data.xml");

(We currently only support the second and third.)

Regards,
 
Mark

PS Aaron--fP 1.4 does now throw the exception, as per XForms 1.0 SE...but as
you can see, we don't like it!
 

Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/

Download our XForms processor from
http://www.formsPlayer.com/
Received on Friday, 6 January 2006 11:41:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:02 GMT