Hi,
I think the following is a mistake in the doc, but before changing the wiki, I wanted to double-check.
The documentation for map:get says, "If the supplied key is the xs:float or xs:double value NaN, the function returns an empty sequence." BaseX 8.1 returns the value that corresponds to the NaN key (if present). The software behavior seems correct to me. For example:
INPUT let $mymap := map:entry(xs:double('NaN'),'abc') return map:get($mymap,xs:double('NaN'))
OUTPUT abc
Thanks, Amanda
Hi Amanda,
You are right, our documentation is out-dated. In a recent version of XQuery 3.1, the behavior of map:get and map:contains has been changed, so the current behavior of BaseX is correct.
Thanks for updating our Wiki, Christian
On Tue, Jun 9, 2015 at 3:53 PM, Amanda Galtman Amanda.Galtman@mathworks.com wrote:
Hi,
I think the following is a mistake in the doc, but before changing the wiki, I wanted to double-check.
The documentation for map:get says, “If the supplied key is the xs:float or xs:double value NaN, the function returns an empty sequence.” BaseX 8.1 returns the value that corresponds to the NaN key (if present). The software behavior seems correct to me. For example:
INPUT
let $mymap := map:entry(xs:double('NaN'),'abc')
return map:get($mymap,xs:double('NaN'))
OUTPUT
abc
Thanks,
Amanda
basex-talk@mailman.uni-konstanz.de