RE: [XQuery] MS-XQ-LC1-065

> Section 3.2.2 Predicates	
> Technical	
> 
> The current dispatch rules for predicates is problematic 
> since one often has to defer to runtime whether an index or 
> an effective Boolean value is calculated, even if one does 
> static type inferencing, and since float/double imprecision 
> can lead to unexpected/wrong results. 
> 
> Instead of doing position and fn:boolean() do the following for E[$x]:
>  
> if $x instance of xs:decimal=> do position as described (note 
> no float/double due to precision issues), 
> if $x instance of node()* then fn:boolean($x), 
> if instance of xs:boolean then $x, 
> otherwise type error (may also add xs:string as an option).
>

Note that this is actually an XPath comment rather than an XQuery
comment.

Since xs:double is the "default" numeric type produced by many
expressions such as (@offset+1), this suggestion would be serious
backwards incompatibility.

Michael Kay 

Received on Monday, 16 February 2004 06:25:26 UTC