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 12:13:58 +0000
Message-ID: <51162098945.20020122121358@jenitennison.com>
To: sk ask <arigapudi_s@yahoo.com>
CC: xmlschema-dev@w3.org
Hi Shyam,

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

I think that we might be misunderstanding each other due to
terminology here. An abstract local element (by which I take it you
mean a local element declaration whose abstract attribute is set to
true) essentially makes the content model unworkable - the element
can't have any instances itself, and it can't be the head of a
substitution group (i.e. have other elements swapped in) because it
isn't a global element.

Perhaps you mean a local element with an abstract type? If so, then
yes, you can do that - make the abstract type a global type. You can
then either use xsi:type to point to the derived type that you want to
use for the content of the element in the instance document; or you
can derive (by restriction) other types from the type containing the
element, each declaring a different content for that element (as long
as the derivations from the abstract type were restrictions).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 22 January 2002 07:14:00 GMT

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