<?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>2746</bug_id>
          
          <creation_ts>2006-01-20 21:26:28 +0000</creation_ts>
          <short_desc>wd-20: Identity vs. Equality in enumerations and fixed value constraints</short_desc>
          <delta_ts>2006-01-20 21:27:49 +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>Datatypes: XSD Part 2</component>
          <version>1.1 only</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</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="Mary Holstege">holstege</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>7910</commentid>
    <comment_count>0</comment_count>
    <who name="Mary Holstege">holstege</who>
    <bug_when>2006-01-20 21:26:28 +0000</bug_when>
    <thetext>In the call today we decided to use identity for value constraints, just as we 
do for enumeration, on the logic that a fixed value constraint is like an 
enumeration with a single value.

Noah and I expressed a certain discomfort with identity in both these cases, 
especially with respect to precision decimal. Consider:
&lt;xs:simpleType name=&quot;u2numbers&quot;&gt; &lt;xs:restriction base=&quot;xs:precisionDecimal&quot;&gt; 
&lt;xs:enumeration value=&quot;1.0&quot;/&gt; &lt;xs:enumeration value=&quot;2.0&quot;/&gt; &lt;xs:enumeration 
value=&quot;3.0&quot;/&gt; &lt;xs:enumeration value=&quot;14.0&quot;/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt;

We accepted that &quot;1&quot; and &quot;1.00&quot; would not be valid against this enumeration on 
the grounds that enumerations of decimals were not used in practice, so this 
infelicity was unlikely to bite anyone. The work-around would be to enumerate a 
sufficient range of precisions to cover the most likely cases to turn up in 
practice:
&lt;xs:simpleType name=&quot;u2numbers&quot;&gt; &lt;xs:restriction base=&quot;xs:precisionDecimal&quot;&gt; 
&lt;xs:enumeration value=&quot;1&quot;/&gt; &lt;xs:enumeration value=&quot;1.0&quot;/&gt; &lt;xs:enumeration 
value=&quot;1.00&quot;/&gt; &lt;xs:enumeration value=&quot;2&quot;/&gt; &lt;xs:enumeration value=&quot;2.0&quot;/&gt; &lt;xs:
enumeration value=&quot;2.00&quot;/&gt; &lt;xs:enumeration value=&quot;3&quot;/&gt; &lt;xs:enumeration value=&quot;3.
0&quot;/&gt; &lt;xs:enumeration value=&quot;3.00&quot;/&gt; &lt;xs:enumeration value=&quot;14&quot;/&gt; &lt;xs:enumeration 
value=&quot;14.0&quot;/&gt; &lt;xs:enumeration value=&quot;14.00&quot;/&gt; &lt;/xs:restriction&gt; &lt;/xs:
simpleType&gt;

Painful in practice, impossible in the general case (although I suppose you 
could enumerate to the limits of precision supported by your processor, urgh.)

Or you put in a pattern facet instead, which can also be painful.

Consider this definition:
&lt;xs:element name=&quot;meterMin&quot; type=&quot;xs:precisionDecimal&quot;/&gt;

Somewhere in a content model:
&lt;xs:element ref=&quot;meterMin&quot; fixed=&quot;1.0&quot;/&gt;

In this case&lt;meterMin&gt;1.00&lt;/meterMin&gt; and &lt;meterMin&gt;1&lt;/meterMin&gt; would be 
rejected.

Here, however, there is no workaround that allows you the simplicity of using 
the fixed attribute: you have to change the type. If you wanted to have 
different fixed values for different uses of the element meterMin in your 
schema, you have to jump through some rather painful hoops using local 
definitions that have nasty enumerations or patterns in them: the type of each 
use of meterMin would have to be different.I still question the wisdom of using 
identity in either of these cases. Most types do not distinguish identity and 
equality, and in those cases that do, the results are unhelpful, as shown.

Request concerning
Part 1
Transition history

raised on 3 Dec 2004 by Mary Holstege (http://lists.w3.org/Archives/Public/www-
xml-schema-comments/2004OctDec/0026.html)
declined on 3 Dec 2004 (http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/
2004Dec/0002.html)

RESOLVED No consensus to change status quo.

Acknowledgment cycle
announced by group on 3 Nov 2004 (http://lists.w3.org/Archives/Member/w3c-xml-
schema-ig/2004Nov/0002.html)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>