Re: Feedback on 1.1: instance src attribute broken

Hi Mark,

To keep this short, I think that it's fine for XHTML2 to add a src 
attribute everywhere and to have the semantic it has.

However, the semantic categorically does not fit the problem I described, 
so a separate attribute is needed by XForms.

I will use the new attribute I propose to provide an example.  If I have 
an instance like this:

<instance resource="http://www.example.org/defaultData.xml"/>

Then, I expect that the instance data will come from the external 
resource, as follows:

<instance resource="http://www.example.org/defaultData.xml">
   <my xmlns="">
      <name></name>
   </my>
</instance>

Now suppose an input is bound to name, and I run this form and enter my 
name.  Then, because I have a save feature, I save the document to disk. 
This is what it contains:

<instance resource="http://www.example.org/defaultData.xml">
   <my xmlns="">
      <name>John</name>
   </my>
</instance>

Now I reload this document.  I expect to see that the name John is 
preserved.  This is because I want the resource attribute to only be 
evaluated if the instance is empty.  Since it isn't empty, the data in it 
takes precedence over data that could be obtained from the resource URI.

Note that if I change the above example from using @resource to @src, my 
expectation is not met because the src attribute overrides the content and 
gets a new blank copy of the default data.

Since XHTML already has a src attribute, and most current implementations 
of XForms that don't use XHTML as a host language are document-centric, 
this says two things:
1) there seems to be demand for document-based XForms that should maybe 
find its way into XHTML
2) we really have to fix this for the non-XHTML host languages.

Cheers,
John M. Boyer, Ph.D.
Senior Product Architect/Research Scientist
Co-Chair, W3C XForms 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





"Mark Birbeck" <mark.birbeck@x-port.net> 
Sent by: w3c-forms-request@w3.org
09/11/2006 06:21 AM
Please respond to
mark.birbeck@x-port.net


To
John Boyer/CanWest/IBM@IBMCA
cc
www-forms@w3.org, www-forms-editor@w3.org
Subject
Re: Feedback on 1.1: instance src attribute broken








Hi John,

> [...]
>
> The one place it still appears is on the instance element.  Here I am 
going
> to argue that the semantic of src inherited from HTML is also broken for
> instance, so we either need to change it or rename the attribute so we 
can
> change the semantics.
>
> The problematic behavior is that the content of the instance is 
*overridden*
> by content obtained from a URI given by src.  The behavior should be 
that
> the src URI is used to obtain *default* content for the instance if it 
is
> empty.
>
> [...]

I also looked at this issue a while ago, but came to a different 
conclusion!

XHTML 2 now allows @src anywhere, and its use is that an attempt is
made to load the resource referred to, and if it fails, the content of
the element is used as a 'fallback'. This is actually the same
behaviour as for <object> with previous versions of XHTML--the new
version just generalises this to all elements.

In my view this would be reasonable behaviour for XForms' instance
element, and I think fits the situation you describe--if there is a
@src attribute use it, and if the load fails, use the inline content
of the instance. See:

  <http://skimstone.x-port.net/node/334>

for a discussion on this.

Regards,

Mark

-- 
Mark Birbeck
CEO
x-port.net Ltd.

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

Download our XForms processor from
http://www.formsPlayer.com/

Received on Monday, 18 September 2006 22:57:40 UTC