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

|  |
These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.
|  |
| |
 |
 |
 |