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

Re: [XML Schema 1.1] The <restriction> element is not declared in the DTD for XML Schema 1.1

From: C. M. Sperberg-McQueen <cmsmcq@blackmesatech.com>
Date: Fri, 3 Jul 2009 09:02:48 -0600
Cc: "C. M. Sperberg-McQueen" <cmsmcq@blackmesatech.com>, "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-Id: <DA24DD4E-DB39-4AA8-B3A5-F59E9410C34F@blackmesatech.com>
To: "Costello, Roger L." <costello@mitre.org>
Re: [XML Schema 1.1] The <restriction> element is not declared in  the  DTD for XML Schema 1.1

On 3 Jul 2009, at 06:35 , Costello, Roger L. wrote:

>
> Hi Michael,
>
> In the datatypes specification I see the ELEMENT declaration for the  
> restriction element used in simpleTypes.
>
> But I don't see in the structures specification a declaration for  
> the restriction element used in derive-by-restriction.
>
> They shouldn't be declared the same way, right?

DTDs don't have context-dependent declarations (or 'local
GI - declaration bindings' if one prefers to think of it
that way).  So (as the comment immediately following the
declaration in datatypes.dtd mentions) the same declaration
must handle both simple type restriction and complex
type restriction.

> Can you provide me the declaration for the restriction element used  
> in derive-by-restriction? I want to incorporate it into the tutorial  
> I am creating.


The declaration reads

     <!ELEMENT %restriction; ((%annotation;)?,
                              (%restriction1; |
                               ((%simpleType;)?,(%facet;)*)),
                              (%attrDecls;))>

Expanding the parameter entities for the generic identifiers
(aka 'element type names') of the elements, assuming
a namespace prefix of xsd, and removing some now-extraneous
parentheses, this is

     <!ELEMENT xsd:restriction (xsd:annotation?,
                                (%restriction1; |
                                 (xsd:simpleType?, xsd:facet*)
                                ),
                                (%attrDecls;))>

The parameter entities attrDecls and restriction1 are
declared in XMLSchema.dtd.  Expanding them to get the effective
declaration of the restrction element, and reformatting to
make the structure a little easier to read, yields:

     <!ELEMENT xsd:restriction
         ( xsd:annotation?,
           (
             (xsd:all | xsd:choice | xsd:sequence | xsd:group)?
           |
             (xsd:simpleType?, xsd:facet*)
           ),
           (xsd:attribute | xsd:attributeGroup)*,
           xsd:anyAttribute?
         )>

I hope this helps.  If you want to have a DTD formulation
of the content model used when restriction is a child of
complexContent, you'll need to eliminate the simpleType
branch (or transcribe a content model from the schema for
schema documents), which I will leave as an exercise for
the reader.

-- 
****************************************************************
* C. M. Sperberg-McQueen, Black Mesa Technologies LLC
* http://www.blackmesatech.com
* http://cmsmcq.com/mib
* http://balisage.net
****************************************************************
Received on Friday, 3 July 2009 15:03:26 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.