Re: Abstract types in substitution groups

On 8 Feb 2007, at 05:38 , Pete Cordell wrote:

>
> So does the abstractness of the type become a property of the  
> element?  i.e.
>
> <xs:element name='myElement' type='abstractType'/>
>
> is equivalent to:
>
>
> <xs:element name='myElement' type='abstractType' abstract='true'/>
> ?

Not quite.  They do have at least one consequence
in common, but they do not produce the same set of
schema components. In the one case, it's the type that's
marked abstract; in the other, it's the element.

And concretely, as Mike Kay's description implies, the two declarations
have different consequences for the document instance.  Neither
allows an element instance like

   <myElement>...</myElement>

but  if the schema defines 'concreteType' as a concrete type derived
from abstractType, then the first declaration allows

   <myElement xsi:type="concreteType">...</myElement>

to appear in the document -- it is the type which is abstract, not
the element.  The second declaration, by contrast, does not allow
such an element instance.

--C. M. Sperberg-McQueen

Received on Thursday, 8 February 2007 13:19:19 UTC