XML Schema equivClass.

Michael Anderson michael at research.canon.com.au
Thu Feb 3 00:52:21 GMT 2000


Hello,
Thank you for the replies to my first set of questions.  Which have, of
course, led to some more questions.  The main point I would like
clarified is
the statement in a reply [ht].

> The two hierarchies (complex type and
> equivalence class) go together.

Normally in object oriented systems if a class (or type) B is derived
from a
class A then an instance of B can substitute an instance of A purely on
the
basis of the defined inheritance.  That is, inheritance implies
subclassing.
So if I have a schema that contains the following:

<element name="A" type="Atype"/>

<element name="B" type="Btype"/>
<type name="Btype" source="Atype" derivedBy="extension">
   <element name="notimportant"/>
</type>

<element name="C" >
   <type>
      <element ref="A"/>
   </type>
</element>

I now expect that it is okay to declare in the document instance:
<C>
  <B> B stuff in here </B>
</C>

This should be okay as Btype extends Atype and the content model was
expecting A (with Atype) but got B (with Btype).  The WD however, states
that
it is necessary in the schema to declare equivClass to say B is a
subclass of
A:

<element name="B" type="Btype" equivClass="A" />

If it is necessary to declare equivClass then what exactly is
equivClass's
role other than to facilitate the subclassing?  The WD states that
equivClass
elements must have types derived from the exemplar type so this use of
extended/restricted types may as well incorporate the subclassing.
Help on this issue would be much appreciated.
Michael.




xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev at ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions and unsubscriptions
are  now ***CLOSED*** in preparation for list transfer to OASIS.





More information about the Xml-dev mailing list