meaning and usefulness of block and blockDefault

I am trying to understand how constraining 'block' is, when used on
schema types, compared to 'final'. I know 'final' is used to prevent
derivation altogether, whereas 'block' prevents only the usage of an
instance of the newly derived type.

 From "XML Schema Part 1: Structures ", about 'block' in a complex type:

{prohibited substitutions} determine whether an element declaration
appearing in a · content model· is prevented from additionally ·validating·
element items with an xsi:type (§2.6.1) attribute that identifies a complex
type definition derived by extension or restriction from this definition, or
element items in a substitution group whose type definition is similarly
derived: If {prohibited substitutions} is empty, then all such substitutions
are allowed, otherwise, the derivation method(s) it names are disallowed.

Let's say schema A states blockDefault="#all". In schema B , which imports
schema A, I can create types derived from the complex types exposed by this
schema.
I am wondering what is the use of these derived types if I cannot
instantiate an element
of those types...Is there a namespace subtlety I am missing here?
Can I have elements declared in a different namespace that use those derived
types
or not at all? What is the point of a block="#all" then as opposed to
final="#all"?

--
Alain

Received on Thursday, 14 August 2003 09:03:36 UTC