[xquery-talk] range implementations -- which is correct?

Howard Katz howardk at fatdog.com
Tue Jun 21 16:48:01 PDT 2005


Informative as always. Thank you!

Each of the three implementations is indeed correct for
 
   ( <a/>, <b/>, <c/> )[ position() = 1 to 2 ]

   => <a/>,  <b/>

What's led to the revised view that EBV( atomic-sequence ) is an error?

Howard

 > -----Original Message-----
 > From: Michael Kay [mailto:mhk at mhk.me.uk] 
 > Sent: Tuesday, June 21, 2005 3:28 PM
 > To: 'Howard Katz'; talk at xquery.com
 > Subject: RE: [xquery-talk] range implementations -- which is correct?
 > 
 > Saxon is correct against the most recent working draft: the 
 > effective boolean value of a sequence of several integers is 
 > now an error. Before the most recent draft, the EBV of any 
 > sequence containing more than one item was true; so Galax 
 > was correct. There was a prehistory in which "[1 to 2]" was 
 > recognized as some kind of custom syntax to extract a 
 > subsequence - at that stage (1 to 2) wasn't a 
 > general-purpose expression that could be composed with other 
 > expressions - so MarkLogic is reflecting that history. 
 > However, this had disappeared from the language before the 
 > May 2003 draft.
 > 
 > Now try the correct syntax in each of the products:
 > 
 > ( <a/>, <b/>, <c/> )[ position() = 1 to 2 ]
 > 
 > Michael Kay
 > http://www.saxonica.com/
 > 
 > > 
 > > What's the result of invoking
 > > 
 > >        ( <a/>, <b/>, <c/> )[ 1 to 2 ]
 > > 
 > > ----------------------------
 > > 
 > > MarkLogic 3.0 (May 2003 wd) returns
 > > 
 > >      <a/>
 > >      <b/>
 > > 
 > > Galax 0.5.0 (Oct 2004 wd) returns
 > > 
 > >      <a/>
 > >      <b/>
 > >      <c/>
 > > 
 > > Saxon 8.4 (Feb 2005 wd) returns
 > > 
 > >    "Error: Effective boolean value is not defined for a sequence
 > >     of two or more items starting with an atomic value
 > > 
 > > The situation is made somewhat more confusing because each 
 > > implementation is implemented against a different version 
 > of the wd. 
 > > More precisely there are two questions:
 > > 
 > > (1) Which of the above results are correct (or incorrect) for the 
 > > version of the working draft against which they were 
 > implemented, and
 > > (2) Which are correct (or incorrect) against the most 
 > recent working 
 > > draft of April 2005?
 > > 
 > > Howard
 > > 
 > > _______________________________________________
 > > talk at xquery.com
 > > http://xquery.com/mailman/listinfo/talk
 > > 
 > 



More information about the talk mailing list