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/