<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25375</bug_id>
          
          <creation_ts>2014-04-17 10:09:12 +0000</creation_ts>
          <short_desc>[xslt 3.0] Maps and the implicit timezone</short_desc>
          <delta_ts>2015-10-29 09:50:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XSLT 3.0</component>
          <version>Last Call drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Kay">mike</reporter>
          <assigned_to name="Michael Kay">mike</assigned_to>
          <cc>jonathan.robie</cc>
    
    <cc>sca.w3c</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>104024</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-04-17 10:09:12 +0000</bug_when>
    <thetext>We say that two keys (in a map) are &quot;the same key&quot; if deep-equal(K1, K2, $UCC) holds, where $UCC is the Unicode codepoint collation. We have therefore tried to make the definition context-independent as far as collations are concerned. However, deep-equal() still has a dependency on the dynamic context when it comes to comparisons of date/time values with no explicit timezone.

The effect is that maps as currently defined cannot &quot;cross timezone boundaries&quot;; a map that is perfectly OK in one (implicit) timezone may become invalid, because of duplicate keys, when used in a dynamic context with a different implicit timezone.

The complications become worse when maps are treated as functions, because we now get all the issues concerned with higher-order functions that carry context information in their closure.

Possible solutions:

(A) disallow maps from containing (as keys) date/time values with no timezone. This can be done in several ways:

(A.1) using a timezoneless date/time value as a key is an error

(A.2) a timezoneless date/time value is converted to a value with timezone using the implicit timezone at the point where the entry is added to the map.

(A.3) a timezoneless date/time value is converted to a value with timezone by assuming UTC.

(B) treat values-with-timezone as being always not-equal to values-without-timezone. The disadvantage of this is that it introduces yet another equality operator to the system, and people would want other ways of making use of this flavour of equality matching.

The least disruptive solution is probably A.2. But I would prefer a solution in which map:get() is deterministic and context-independent, so that you never get the situation where map:get() may or may not find something depending on the context. I&apos;m therefore going to propose A.3. Essentially, functions that accept a key value (such as map:get() and map:new()) treat any timezoneless date/time as being UTC; functions that return keys (such as map:keys()) always return dates/times with a timezone.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104029</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-04-17 11:30:31 +0000</bug_when>
    <thetext>Another little consequence of this problem: we say that in a MapExpr it&apos;s a static error if two keys are the same, but we cannot determine whether two keys are the same until we know the implicit timezone, and this is part of the dynamic context.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109057</commentid>
    <comment_count>2</comment_count>
    <who name="Sharon Adler">sca.w3c</who>
    <bug_when>2014-07-17 14:45:28 +0000</bug_when>
    <thetext>This bug needs to be discussed in the context of the Joint meeting.  MKay sent note to Joint chairs requesting that this bug be put on the Agenda for the Joint F2F in Hursley.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109472</commentid>
    <comment_count>3</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2014-07-29 09:04:31 +0000</bug_when>
    <thetext>The Working Group decided to resolve this bug as follows:

You can&apos;t mix dates/times with timezones and dates/times without timezones in the same map - an error [err:DONTDOTHAT] is raised if an attempt is made to add a key that does not obey this rule. For equality matching, the implicit timezone is used, per the current language specification.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>109764</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2014-08-01 19:58:52 +0000</bug_when>
    <thetext>The XSLT 3.0 spec has been updated to apply this rule. (Work remains to be done on the 3.1 specifications).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120860</commentid>
    <comment_count>5</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2015-06-09 22:34:33 +0000</bug_when>
    <thetext>Subsequently to this decision, bug #28632 was raised, and the decision on that bug overturned this decision. The effect is that option (B) has been adopted.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>