Re: Identity versus Equality in enumerations and fixed value constraints

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
SGMLWorks!

davep@iit.edu

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