<?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>3968</bug_id>
          
          <creation_ts>2006-11-10 02:38:38 +0000</creation_ts>
          <short_desc>Elements with duplicate IDs</short_desc>
          <delta_ts>2007-04-13 16:55:20 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Structures: XSD Part 1</component>
          <version>1.0/1.1 both</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>resolved</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sandy Gao">sandygao</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>12908</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2006-11-10 02:38:38 +0000</bug_when>
    <thetext>Consider an element declaration
&lt;element name=&quot;e&quot;&gt;
  &lt;complexType&gt;
    &lt;sequence&gt;
      &lt;element name=&quot;id1&quot; type=&quot;ID&quot;/&gt;
      &lt;element name=&quot;id2&quot; type=&quot;ID&quot;/&gt;
    &lt;/sequence&gt;
  &lt;/complexType&gt;
&lt;/element&gt;

And the instance
&lt;e&gt;&lt;id1&gt;abc&lt;/id1&gt;&lt;id2&gt;abc&lt;/id2&gt;&lt;/e&gt;

Many people would think the above is invalid, because there are duplicate ID values. But a careful reading of the &quot;ID/IDREF Table&quot; PSVI property suggests that the above is valid. There will only be one entry in the [binding], the element &quot;e&quot;.

Is this intended? Is this how most schema processors implemented ID/IDREF? Either way, some clarification will be helpful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12909</commentid>
    <comment_count>1</comment_count>
    <who name="Henry S. Thompson">ht</who>
    <bug_when>2006-11-10 09:31:29 +0000</bug_when>
    <thetext>No harm, no foul.  The guarantee ID provides is that no ID is attached to two distinct items.  In SGML and XML, there was also a declaration constraint which prevented items from having two IDs, but we explicitly did _not_ reconstruct this constraint except for attributes, although both parts 1 and 2 both suggest not using ID for the type of elements.

The example schema given makes it possible for an element to have multiple IDs, but then the instance doesn&apos;t exploit this.  In my view the resulting ID/IDREF table is correct -- one entry, with one binding, i.e. &apos;abc&apos; bound to the doc. element.

And I think the spec. correctly specifies that in case of an instance such as

 &lt;e&gt;&lt;id1&gt;abc&lt;/id1&gt;&lt;id2&gt;xyz&lt;/id2&gt;&lt;/e&gt;

there will be _two_ entries in the ID/IDREF table, one binding &apos;abc&apos; to the doc. elt and one binding &apos;xyz&apos; to it.  Your gun, your foot, your bullet.

In other words, no bug, no change required.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13563</commentid>
    <comment_count>2</comment_count>
      <attachid>446</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-01-15 21:27:13 +0000</bug_when>
    <thetext>Created attachment 446
Test case: schema</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13564</commentid>
    <comment_count>3</comment_count>
      <attachid>447</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-01-15 21:27:43 +0000</bug_when>
    <thetext>Created attachment 447
Test case: instance</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13567</commentid>
    <comment_count>4</comment_count>
      <attachid>448</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-01-15 21:59:14 +0000</bug_when>
    <thetext>Created attachment 448
Test case 2: schema</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13568</commentid>
    <comment_count>5</comment_count>
      <attachid>449</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-01-15 21:59:35 +0000</bug_when>
    <thetext>Created attachment 449
Test case 2: instance</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13980</commentid>
    <comment_count>6</comment_count>
      <attachid>453</attachid>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-02-13 22:58:42 +0000</bug_when>
    <thetext>Created attachment 453
Test case 3: schema document

One ID attribute, two ID (sub-)elements.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13981</commentid>
    <comment_count>7</comment_count>
      <attachid>454</attachid>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-02-13 23:00:39 +0000</bug_when>
    <thetext>Created attachment 454
Test case 3: XML instance

Three dependents of type ID with different values, all
on the same element.  Several people have said all processors
will behave the same on this, but some thing that
all processors will accept it, others that all will
reject it.

The spec is I think clear that the schema is OK and
the instance is valid against the schema.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14275</commentid>
    <comment_count>8</comment_count>
      <attachid>458</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-02-28 14:43:56 +0000</bug_when>
    <thetext>Created attachment 458
Test case 4: schema document

When an element&apos;s simple content is of type ID and one of its attributes also has type ID, test whether the 2 IDs can have the same value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14276</commentid>
    <comment_count>9</comment_count>
      <attachid>459</attachid>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-02-28 14:44:55 +0000</bug_when>
    <thetext>Created attachment 459
Test case 4: XML instance

When an element&apos;s simple content is of type ID and one of its attributes also has type ID, test whether the 2 IDs can have the same value.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>14726</commentid>
    <comment_count>10</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2007-04-13 16:55:02 +0000</bug_when>
    <thetext>The working group discussed this issue at the 2007-03 F2F meeting. It was observed that
- Users and some specifications, as with schema itself, view elements with IDs as identifying their parents
- Users may want to use different ways (sub-elements/attributes) to identify the same element, but using the same ID value.

Based on these, the WG decided not to change the behavior in the current schema spec.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>446</attachid>
            <date>2007-01-15 21:27:13 +0000</date>
            <delta_ts>2007-02-28 14:45:57 +0000</delta_ts>
            <desc>Test case: schema</desc>
            <filename>dupIDonElement.xsd</filename>
            <type>text/xml</type>
            <size>256</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">PHNjaGVtYSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiPg0KICA8ZWxl
bWVudCBuYW1lPSJlIj4NCiAgICA8Y29tcGxleFR5cGU+DQogICAgICA8c2VxdWVuY2U+DQogICAg
ICAgIDxlbGVtZW50IG5hbWU9ImlkMSIgdHlwZT0iSUQiLz4NCiAgICAgICAgPGVsZW1lbnQgbmFt
ZT0iaWQyIiB0eXBlPSJJRCIvPg0KICAgICAgPC9zZXF1ZW5jZT4NCiAgICA8L2NvbXBsZXhUeXBl
Pg0KICA8L2VsZW1lbnQ+DQo8L3NjaGVtYT4NCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>447</attachid>
            <date>2007-01-15 21:27:43 +0000</date>
            <delta_ts>2007-01-15 21:27:43 +0000</delta_ts>
            <desc>Test case: instance</desc>
            <filename>dupIDonElement.xml</filename>
            <type>text/xml</type>
            <size>157</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">77u/PGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5j
ZSINCiAgIHhzaTpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJkdXBJRG9uRWxlbWVudC54c2Qi
Pg0KIDxpZDE+YWJjPC9pZDE+DQogPGlkMj5hYmM8L2lkMj4NCjwvZT4NCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>448</attachid>
            <date>2007-01-15 21:59:14 +0000</date>
            <delta_ts>2007-02-28 14:46:17 +0000</delta_ts>
            <desc>Test case 2: schema</desc>
            <filename>dupIDonElement2.xsd</filename>
            <type>text/xml</type>
            <size>256</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">PHNjaGVtYSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiPg0KICA8ZWxl
bWVudCBuYW1lPSJlIj4NCiAgICA8Y29tcGxleFR5cGU+DQogICAgICA8c2VxdWVuY2U+DQogICAg
ICAgIDxlbGVtZW50IG5hbWU9ImlkMSIgdHlwZT0iSUQiLz4NCiAgICAgIDwvc2VxdWVuY2U+DQog
ICAgICA8YXR0cmlidXRlIG5hbWU9ImlkMiIgdHlwZT0iSUQiLz4NCiAgICA8L2NvbXBsZXhUeXBl
Pg0KICA8L2VsZW1lbnQ+DQo8L3NjaGVtYT4NCg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>449</attachid>
            <date>2007-01-15 21:59:35 +0000</date>
            <delta_ts>2007-01-15 21:59:35 +0000</delta_ts>
            <desc>Test case 2: instance</desc>
            <filename>dupIDonElement2.xml</filename>
            <type>text/xml</type>
            <size>155</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">77u/PGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5j
ZSINCiAgIHhzaTpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJkdXBJRG9uRWxlbWVudDIueHNk
Ig0KICAgaWQyPSJhYmMiPg0KIDxpZDE+YWJjPC9pZDE+DQo8L2U+DQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>453</attachid>
            <date>2007-02-13 22:58:42 +0000</date>
            <delta_ts>2007-02-13 22:58:42 +0000</delta_ts>
            <desc>Test case 3: schema document</desc>
            <filename>dupIDonElement3.xsd</filename>
            <type>text/xml</type>
            <size>285</size>
            <attacher name="C. M. Sperberg-McQueen">cmsmcq</attacher>
            
              <data encoding="base64">PHNjaGVtYSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiPgogIDxlbGVt
ZW50IG5hbWU9ImUiPgogICAgPGNvbXBsZXhUeXBlPgogICAgICA8c2VxdWVuY2U+CiAgICAgICAg
PGVsZW1lbnQgbmFtZT0iaWQxIiB0eXBlPSJJRCIvPgogICAgICAgIDxlbGVtZW50IG5hbWU9Imlk
MiIgdHlwZT0iSUQiLz4KICAgICAgPC9zZXF1ZW5jZT4KICAgICAgPGF0dHJpYnV0ZSBuYW1lPSJp
ZCIgdHlwZT0iSUQiLz4KICAgIDwvY29tcGxleFR5cGU+CiAgPC9lbGVtZW50Pgo8L3NjaGVtYT4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>454</attachid>
            <date>2007-02-13 23:00:39 +0000</date>
            <delta_ts>2007-02-13 23:00:39 +0000</delta_ts>
            <desc>Test case 3: XML instance</desc>
            <filename>dupIDonElement3.xml</filename>
            <type>text/xml</type>
            <size>162</size>
            <attacher name="C. M. Sperberg-McQueen">cmsmcq</attacher>
            
              <data encoding="base64">PGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5jZSIK
ICAgeHNpOm5vTmFtZXNwYWNlU2NoZW1hTG9jYXRpb249ImR1cElEb25FbGVtZW50Mi54c2QiCiAg
IGlkPSJhYmMiPgogPGlkMT5kZWY8L2lkMT4KIDxpZDI+Z2hpPC9pZDI+CjwvZT4K
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>458</attachid>
            <date>2007-02-28 14:43:56 +0000</date>
            <delta_ts>2007-02-28 14:46:27 +0000</delta_ts>
            <desc>Test case 4: schema document</desc>
            <filename>dupIDonElement4.xsd</filename>
            <type>text/xml</type>
            <size>281</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">PHNjaGVtYSB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEiPg0KICA8ZWxl
bWVudCBuYW1lPSJlIj4NCiAgICA8Y29tcGxleFR5cGU+DQogICAgICA8c2ltcGxlQ29udGVudD4N
CiAgICAgICAgPGV4dGVuc2lvbiBiYXNlPSJJRCI+DQogICAgICAgICAgPGF0dHJpYnV0ZSBuYW1l
PSJpZCIgdHlwZT0iSUQiLz4NCiAgICAgICAgPC9leHRlbnNpb24+DQogICAgICA8L3NpbXBsZUNv
bnRlbnQ+DQogICAgPC9jb21wbGV4VHlwZT4NCiAgPC9lbGVtZW50Pg0KPC9zY2hlbWE+DQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>459</attachid>
            <date>2007-02-28 14:44:55 +0000</date>
            <delta_ts>2007-02-28 14:44:55 +0000</delta_ts>
            <desc>Test case 4: XML instance</desc>
            <filename>dupIDonElement4.xml</filename>
            <type>text/html</type>
            <size>143</size>
            <attacher name="Sandy Gao">sandygao</attacher>
            
              <data encoding="base64">77u/PGUgeG1sbnM6eHNpPSJodHRwOi8vd3d3LnczLm9yZy8yMDAxL1hNTFNjaGVtYS1pbnN0YW5j
ZSINCiAgIHhzaTpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJkdXBJRG9uRWxlbWVudDQueHNk
Ig0KICAgaWQ9ImFiYyI+DQogYWJjDQo8L2U+DQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>