<?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>29857</bug_id>
          
          <creation_ts>2016-09-22 08:04:06 +0000</creation_ts>
          <short_desc>[FO31] Uniqueness scope for generate-id()</short_desc>
          <delta_ts>2016-12-16 19:55:23 +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>Functions and Operators 3.1</component>
          <version>Candidate Recommendation</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>
          
          
          <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>127495</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-22 08:04:06 +0000</bug_when>
    <thetext>We say under generate-id():

An implementation is under no obligation to generate the same identifiers each time a document is transformed or queried.

This is a very informal way of saying that the uniqueness rule is scoped to a single execution scope. It casually implies that there is a concept of node identity (&quot;a document&quot;) that transcends execution scope, which formally speaking is not the case (although XQuery Update might suggest otherwise). And it raises questions about situations where a transformation or query can involve multiple execution scopes, for example when fn:transform() is called, or when XSLT static expressions are used.

I propose the following slightly more formal statement. After

&quot;In other cases, the function returns a string that uniquely identifies a given node.&quot;

add

&quot;More formally, it is guaranteed that within a single *execution scope*, codepoint-equal(generate-id($N), generate-id($M)) is true if and only if ($M is $N) is true.&quot; 

and move the sentence

&quot;An implementation is under no obligation to generate the same identifiers each time a document is transformed or queried.&quot;

to the (non-normative) notes, since its meaning depends on informal notions of identity.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127496</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-22 08:11:49 +0000</bug_when>
    <thetext>Anticipating WG approval, I have applied the suggested changes to the spec.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>127569</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2016-09-27 21:02:48 +0000</bug_when>
    <thetext>The WG agreed the changes, which are already in the spec.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>