Re: [XPath 2.0] XPath 1.0 Compatibility Mode doesn't cover fn:number

Dear Priscilla,
Thanks for your comments on the XPath 2.0 specification. The Query and 
XSLT working groups considered your comment and agreed that changes are 
required to the rules for function argument conversion in XPath 1.0 
compatibility mode. We believe that the changes outlined below address the 
following two comments that you posted on this subject:
http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/0081.html
http://lists.w3.org/Archives/Public/public-qt-comments/2004Feb/0082.html 

The revised rules for function argument conversion in XPath 1.0 
compatibility mode are as follows:

If XPath 1.0 compatibility mode is true and the argument is not of the 
expected type, then the following conversions are applied sequentially to 
the argument value V:
1. If the expected type calls for a single item or optional single item 
(examples: xs:string, xs:string?, xdt:untypedAtomic, xdt:untypedAtomic?, 
node(), node()?, item(), item()?), then the value V is effectively 
replaced by V[1].
2. If the expected type is xs:string or xs:string?, then the value V is 
effectively replaced by fn:string(V).
3. If the expected type is a (possibly optional) numeric type, then the 
value V is effectively replaced by fn:number(V).

Please let us know whether you agree that these changes have resolved the 
issues you raised regarding XPath 1.0 compatibility mode.

Thank you,
--Don Chamberlin




"Priscilla Walmsley" <priscilla@walmsley.com> 
Sent by: public-qt-comments-request@w3.org
02/04/2004 04:43 AM

To
<public-qt-comments@w3.org>
cc

Subject
[XPath 2.0]  XPath 1.0 Compatibility Mode doesn't cover fn:number







In Section 3.1.5, the function conversion rules in XPath 1.0 Compatibility
Mode don't cover the number() function itself, which expects
xdt:anyAtomicType?. If you pass number() a sequence of multiple values, in
XPath 1.0 Compatibility Mode, you would want only the first value to be
used.  Perhaps another bullet point should added to the list, saying:

If the expected type is xdt:anyAtomicType or xdt:anyAtomicType?, then the
given value V is effectively replaced by V[1].
 
Thanks,
Priscilla Walmsley

Received on Thursday, 29 April 2004 20:38:40 UTC