W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

Re: Schema Question (abstract/enforce)

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 22 Jan 2002 09:11:46 +0000
Message-ID: <1151167066.20020122091146@jenitennison.com>
To: "Arigapudi, Shyam" <Shyam.Arigapudi@ugs.com>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi Shyam,

> Have a master type that is abstract. However, it needs to make sure
> that some element definitions are present in the derived items (pure
> virtual if you will)?

If you mean that there are some elements that must be present in
instances of all the derived types, then you can include those
elements in the base type definition, in the same way as you can
include elements in a non-abstract type definition. They will be
inherited by the types that derive from them.

I'd advise you to arrange those elements in a xs:sequence or xs:choice
rather than an xs:all, because if you use an xs:all then the derived
types cannot add their own elements to the content model (when
deriving by extension).

If you allow derivation by restriction, then you should be careful
that the common elements aren't optional, because if they are then a
derived type could validly leave them out.



Jeni Tennison
Received on Tuesday, 22 January 2002 04:11:48 UTC

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