W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2004

Re: Identity versus Equality in enumerations and fixed value constraints

From: Dave Peterson <davep@iit.edu>
Date: Fri, 3 Dec 2004 13:07:51 -0500
Message-Id: <a06110401bdd65ba202e3@[]>
To: Mary Holstege <mary.holstege@marklogic.com>, www-xml-schema-comments@w3.org
Cc: holstege@mathling.com

At 9:51 AM -0800 041203, Mary Holstege wrote:
>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 this definition:
><xs:element name="meterMin" type="xs:precisionDecimal"/>
>Somewhere in a content model:
>    <xs:element ref="meterMin" fixed="1.0"/>
>In this case <meterMin>1.00</meterMin>  and <meterMin>1</meterMin>
>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.

One question:  If you don't care about precision, why are you using
precisionDecimal?  I'm not surprised that if you use the wrong datatype
you won't get the results you want.  This just sounds like a good argument
for not losing (aPrecision) decimal.

Why do you expect to be able to specify a "fixed" attribute and then
be able to give it different values?

Your use case is certainly possible.  The use case where one *does* care
about allowing only a particular value, without allowing all other
equal-but-not-identical values, is certainly also possible, and just
as valid.  Whichever one is chosen as "the way to go", the other will
have to use subtype logic.
Dave Peterson

Received on Friday, 3 December 2004 18:07:57 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:02 UTC