RE: XForms CR - A further departure from XPath 1.0?

Hi Andrew,

The interpretation of / within XForms expressions that reference instance data is perfectly in keeping with XPath 1.0.  As is clearly stated in our definition of the instance element (Section 3.3.2), the content of the instance element is treated as *opaque data* that is disconnected from the original containing document.  

We form a valid ***separate*** XPath data model over a disconnected ***copy*** of the content of the instance element.  I do not think you will find any spec (much less XPath) that says one is not allowed to take some content from an XML element and put it out to disk then read the separated data with an XML processor.  In XForms, we are careful to say that the instance element can only have one element child so that the ***disconnected copy*** of the content is a well-formed XML document whose resultant XPath data model has a root node wrapped around the root element.  It is this root node that the / operates from.

Although I am taking great pains to explain this, I do not understand why this is so hard to understand given that this is exactly what XSLT does.  In XSLT you have numerous XPath expressions that are not references to the document that contains them but rather they are references to the XPath data model of a ***separate*** XML document (the one being transformed by the XSLT that contains the XPath expressions).

P.S. Since I agree with Sebastian that Tim Bray likely not listening to this thread, I have removed him from the cc list.  Since this is a public email, however, you can freely forward it as necessary.

John Boyer, Ph.D.
Senior Product Architect
PureEdge Solutions Inc.



-----Original Message-----
From: AndrewWatt2001@aol.com [mailto:AndrewWatt2001@aol.com]
Sent: Wednesday, November 13, 2002 1:15 PM
To: www-forms@w3.org; www-forms-editor@w3.org; Xforms@yahoogroups.com
Cc: tbray@textuality.com
Subject: XForms CR - A further departure from XPath 1.0?




Earlier today I raised the issue of how the XForms CR seemed to me to depart 
from the XPath 1.0 semantics in how it proposes to use an initial forward 
slash character in what are claimed to be XPath 1.0 location paths.

It seems to me that, if I understand the CR correctly, there is a further 
departure from XPath 1.0 semantics.

Let me illustrate.

If we have a code snippet as follows:
<xforms:model>
 <xforms:instance>
  <my:someElement/>
 </xforms:instance>
</xforms:model>

then the XForms CR proposes that the <my:someElement> element node can be 
accessed/bound using the location path /my:someElement.

Does that fairly represent the CR's intent?

But where is the root node situated?

If the <xforms:model> element is the document element that corresponds to the 
supposed root node then the XPath 1.0 location path should be 
/xforms:model/xforms:instance/my:someElement.

If the <xforms:instance> element is the document element that corresponds to 
the supposed root node then the XPath 1.0 location path should be
/xforms:instance/my:someElement.

At best this is poorly explained in the XForms CR.

If the <xforms:instance> element is, in some way, outside of the root node 
then what kind of "root node" is this that potential implementors and users 
of XForms are being asked to swallow?

As far as I can see there is no adequate definition of how these supposed 
"root nodes" are to be understood. Nor where, precisely, they are located or 
visualised as being located. This seems to me to be an unacceptable omission 
in a W3C Candidate Recommendation.

The alternative interpretation is that the XForms CR is simply muddled about 
how this works and how it does or does not correspond to the XPath 1.0 
Recommendation.

This interpretation of lack of clarity is supported by, for example, 12.2.2 
where the <xforms:model> element is said to be the root element of a 
fragment, implying that (at least in 12.2.2) the root node lies *outside* the 
<xforms:model> element.

I suggest that the XForms WG invest significant effort into examining the 
credibility and compliance to XPath 1.0 of the approach they propose to take. 
Additionally, I suggest that if they decide to pursue the proposed course 
that they provide a suitably detailed and clear explanation in any subsequent 
Working Draft of the XForms specification.

Andrew Watt

Received on Wednesday, 13 November 2002 18:10:16 UTC