XML Schema equivClass.

Jeff Lowery jlowery at scenicsoft.com
Thu Feb 3 02:13:01 GMT 2000

> 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.

The intent appears to be the divorcement of type definitions based on
exemplars ( "is-like") from instance equivalence based on an inherited base
class ("is-a"). In other words, I may want to define a new type that's like
an existing type, but is not a substitute for that type.

For example:
I may want to define a type Cat from an existing exemplar called Dog. Why?
because they both have hair, eyes, long canines, etc. That doesn't mean a
Cat is-a Dog, it's just that the types are similar, and therefore easy to
define one based on the other.

Now that idea is powerful or potentially messy, or both.

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