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

Re: Schema Question (abstract/enforce)

From: sk ask <arigapudi_s@yahoo.com>
Date: Tue, 22 Jan 2002 06:08:00 -0500 (EST)
Message-ID: <20020122110727.78752.qmail@web13506.mail.yahoo.com>
To: xmlschema-dev@w3.org
Cc: jeni@jenitennison.com
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.
Hi Jeni,
   Thanks for the response. I was thinking more like
an
abstract local element (Just to ensure that the
derived
type does have this element). The content is not known

in the base type.
   Most of our needs have all model requirements. I
figure if we do need sequence or choice, a complextype
can be made and the element can use that for its type
in the all model of the derived type.


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


=====


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
Received on Wednesday, 23 January 2002 13:41:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:26 GMT