[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Abstract types in substitution groups

From: C. M. Sperberg-McQueen <cmsmcq@acm.org>
Date: Thu, 8 Feb 2007 06:19:43 -0700
Message-Id: <BB87A262-3DD0-4E3F-9463-8A1C9CD5EB33@acm.org>
Cc: "C. M. Sperberg-McQueen" <cmsmcq@acm.org>, "Michael Kay" <mike@saxonica.com>, <xmlschema-dev@w3.org>
To: "Pete Cordell" <petexmldev@tech-know-ware.com>
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.