Re: source-identity and components (Re: How to scope the note about D and override(E,D))

On Mar 14, 2011, at 2:09 PM, Henry S. Thompson wrote:
> 
> 
> C. M. Sperberg-McQueen writes:
> 
>> ...
>> Your suggestion that source identity be taken as a basis
>> for deciding the issue may run into a similar problem:  is
>> it possible to prove from the infoset spec that there are 
>> two distinct elements in the fragment you've given above?
>> I don't think so; I think claiming that there are two elements
>> and claiming that there is one element are both compatible
>> with the infoset spec.  
>> 
>> Am I missing something?
> 
> We've been reminded recently that treating the infoset as a
> specification of a data model is both going beyond its intent, and
> liable to get one into trouble. . .
> 
> But I think it does: 
> 
> [children] An ordered list of child information items, in document
> order. This list contains element, processing instruction, unexpanded
> entity reference, character, and comment information items, _one for
> each element_, processing instruction, reference to an unprocessed
> external entity, data character, and comment appearing immediately
> within the current element. If the element is empty, this list has no
> members. [emphasis added]
> 
> I presume we have to discharge words such as 'element' in the above by
> reference to the XML spec., where I think there is no doubt that there
> are indeed three elements in this document:
> 
> <d>
>  <element name="foo"/>
>  <element name="foo"/>
> </d>


On the contrary, there is certainly room for doubt here.

The XML spec does not define element identity criteria.  It might
have been better had it done so, but the decision was entirely
a conscious one on the part of at least some of the WG members.

For further discussion see

  http://cmsmcq.com/mib/?p=966

and if further background or discussion is desired see also

  http://cmsmcq.com/mib/?p=947
  http://cmsmcq.com/mib/?p=955
  http://cmsmcq.com/mib/?p=980


> 
> In any case, if we look at either the DOM (at least level 3, not sure
> about earlier versions) (which is admittedly an API, not a data model)
> or the XDM (not sure about XPath 1), I think we do get a definite
> 'yes' answer.

Certainly not for the definition of the model in XPath 1.0.

I have not yet had the nerve to look at XDM to see whether it does a
better job than XPath 1.0 in defining the model it wants.  So I don't
know for sure.  

> But I do agree the spec. refers to the Infoset and not one of
> those. . .
> 
> Do you at least agree that count(d/*) = 2 and d/*[1] and d/*[2] are
> distinct nodes (have different node identities, in the XDM's
> terminology)?

It's clear that that is the expected result in XPath 2.0 as it is in
XPath 1.0. Whether it follows from the definition of the model I
do not yet know.

Michael

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com 
* http://cmsmcq.com/mib                 
* http://balisage.net
****************************************************************

Received on Monday, 14 March 2011 21:01:46 UTC