[Bug 5400] Clarification of deref() needed

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5400

           Summary: Clarification of deref() needed
           Product: SML
           Version: unspecified
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: cmsmcq@w3.org
        ReportedBy: cmsmcq@w3.org
         QAContact: public-sml@w3.org


In section 4.2.6, the deref() function is defined.  Part of the definition 
reads:

 2. If the implementation recognizes R as using N supported schemes, 
    then deref() is not required to attempt to resolve all N schemes. 
    Its behavior in this case is implementation-defined and the set 
    of schemes that are actually attempted may be any subset of the 
    recognized schemes. This is subject to the following constraints:

    a. If deref() doesn't attempt to resolve any scheme or if none 
       of the attempted schemes resolves, then no target is returned.

I believe that the idea is that the deref() implementation performs a
nested iteration over all references in the input node set and over
all the schemes of each reference.  

First, the idea of iteration might possibly be expressed more directly;
this is an editorial issue and I'll defer to the sense of the editors
on it.

Second, the description needs to be clearer about where the subrules
(a) through (e) of item (2) apply:  when they say what is returned,
do they mean returned for each scheme (on a given input reference element),
or for each reference element (in the given input node set), or for
the call to deref()?  In oral discussion today, Sandy Gao suggested that
the subrules apply to each reference element.  We saw two ways to make
that fact clearer:  either add "for each reference" or "for each reference
element in the input node set" to each of the subrules (a) through (e), 
e.g. 

    a. If deref() doesn't attempt to resolve any scheme or if none 
       of the attempted schemes resolves, then no target is returned
       for the reference element.

or alternatively put some equivalent phrase into the introductory prose
of item (2) so that it's clear that it applies to the five subrules.

Third, there was also some surprise in the discussion today at the claim that
if one passes seven reference elements in, each of which successfully resolves
to exactly one target element, one might get six elements, or just one 
element, back.  An example or two might be useful to make clear to the reader
that the word "set" here is used in a strict sense, and not as a synonym for
"bunch" or "bag".  

Fourth, note that the concept of node sets in XPath 1.0 has been replaced, in
XPath 2.0, by the concept of sequences.  If we wish to avoid de-duping, we
should consider describing deref as returning a sequence, not a set.  (And
if so, we need to be clear how the sequence is determined.)

Received on Tuesday, 22 January 2008 16:19:04 UTC