This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Currently a map cannot contain among its keys both date/time values with a timezone and date/time values without a timezone. This rule is stated in FNO, XQuery, and XDM. But I don't think the definition dm:map-get specifies what should happen if the $map argument contains keys without a timezone but the $item argument has a timezone. Consider this query: let $without_tz := xs:dateTime('2015-04-08T01:30:00') let $with_tz := adjust-dateTime-to-timezone($without_tz, implicit-timezone()) return ( $without_tz eq $with_tz, map:get( map{ $without_tz : 1 }, $with_tz ) ) I think this evaluates to (true, 1). map:get finds an entry within the map that has the same key value (based on fn:deep-equals). That is, the values are normalized using the implicit timezone on the dynamic context. However, I don't see how dm:map-get can behave this way since there is no implicit timezone. Should it raise an error or return the empty sequence?
This was discussed on the telcon today. 3 possible solutions were proposed: (a) treat the value as "not found" (b) throw an error (c) remove the accessor from the spec (no-one actually references it). Josh was inclined towards (b). Both MK and Josh felt that the accessor functions here were rather pointless. Coming to this again after the meeting, I think the accessors map:get() and map:contains() as currently defined are pointless not just because no-one currently uses them, but because they are not fit for use: they fail to define behaviour precisely enough to underpin operations in the language such as map:get(); for example they don't say anything about how equality of keys is established. One solution to this might be to have a more primitive accessor function: in place of the current three accessors, have a single accessor map:entries() which returns an array of 2-member arrays, each 2-member array being a key/value pair.
The working group decided to accept the suggestion in comment 1 to have a single accessor map:entries() which returns an array of 2-member arrays, each 2-member array being a key/value pair.