W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2012

What's the difference between equality and identity?

From: Costello, Roger L. <costello@mitre.org>
Date: Wed, 18 Jul 2012 12:30:02 +0000
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <B5FEE00B53CF054AA8439027E8FE17751922A13B@IMCMBX04.MITRE.ORG>
Hi Folks,

In section "3.2.1 The Attribute Declaration Schema Component" of the structures specification it discusses attribute default and fixed values. 

It contains this sentence:

    Note that it is values that are checked, not strings, 
    and that the test is for either equality or identity.

What is a test for "identity?"

Suppose I declare an attribute:

    <attribute name="number" type="integer" fixed="1" />

And in an XML instance I use the attribute:

    number="1.0"

Is 1.0 equal to 1, but not identical?

The sentence says "the test is for either equality or identity."  Does that mean one schema validator implementation can elect to test for equality while another implementation can elect to test for identity? 

Will 

    number="1.0" 

be schema valid with one implementation and schema invalid with another?

/Roger

P.S. At the beginning of that paragraph it says:

    The {value constraint} property reproduces ...

I believe it should say:

    The {variety} property reproduces ...
Received on Wednesday, 18 July 2012 12:30:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 18 July 2012 12:30:29 GMT