1 <!-- DTD for XML Schemas: Part 1: Structures -->
2 <!-- $Id: structures.dtd,v 1.1 2002-08-25 10:21:59 scop Exp $ -->
3 <!-- Note this DTD is NOT the normative structures DTD - - the
4 prose copy in the structures REC is the normative version (which
5 shouldn't differ from this one except for this comment and entity
6 expansions, but just in case -->
7 <!ENTITY % versionEntities SYSTEM "versionInfo.ent">
8 %versionEntities; <!-- get path and date entities -->
10 <!-- The the datatype element and its components
11 are defined in XML Schema: Part 2: Datatypes -->
12 <!-- Note %p is defined in datatypes.dtd -->
13 <!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
16 <!ENTITY % s ''> <!-- if %p is defined (e.g. as foo:) then you must
17 also define %s as the suffix for the appropriate
18 namespace declaration (e.g. :foo) -->
19 <!ENTITY % nds 'xmlns%s;'>
21 <!-- Define all the element names, with optional prefix -->
22 <!ENTITY % schema "%p;schema">
23 <!ENTITY % complexType "%p;complexType">
24 <!ENTITY % element "%p;element">
25 <!ENTITY % unique "%p;unique">
26 <!ENTITY % key "%p;key">
27 <!ENTITY % keyref "%p;keyref">
28 <!ENTITY % selector "%p;selector">
29 <!ENTITY % field "%p;field">
30 <!ENTITY % group "%p;group">
31 <!ENTITY % all "%p;all">
32 <!ENTITY % choice "%p;choice">
33 <!ENTITY % sequence "%p;sequence">
34 <!ENTITY % any "%p;any">
35 <!ENTITY % anyAttribute "%p;anyAttribute">
36 <!ENTITY % sic "%p;sic">
37 <!ENTITY % attribute "%p;attribute">
38 <!ENTITY % attributeGroup "%p;attributeGroup">
39 <!ENTITY % include "%p;include">
40 <!ENTITY % import "%p;import">
41 <!ENTITY % notation "%p;notation">
43 <!-- Customisation entities for the ATTLIST of each element type.
44 Define one of these if your schema takes advantage of the
45 anyAttribute='##other' in the schema for schemas -->
47 <!ENTITY % schemaAttrs ''>
48 <!ENTITY % complexTypeAttrs ''>
49 <!ENTITY % elementAttrs ''>
50 <!ENTITY % groupAttrs ''>
51 <!ENTITY % allAttrs ''>
52 <!ENTITY % choiceAttrs ''>
53 <!ENTITY % sequenceAttrs ''>
54 <!ENTITY % anyAttrs ''>
55 <!ENTITY % anyAttributeAttrs ''>
56 <!ENTITY % attributeAttrs ''>
57 <!ENTITY % attributeGroupAttrs ''>
58 <!ENTITY % uniqueAttrs ''>
59 <!ENTITY % keyAttrs ''>
60 <!ENTITY % keyrefAttrs ''>
61 <!ENTITY % includeAttrs ''>
62 <!ENTITY % importAttrs ''>
63 <!ENTITY % notationAttrs ''>
65 <!ENTITY % complexDerivationChoice "(extension|restriction|reproduction)">
66 <!ENTITY % complexDerivationSet "CDATA">
67 <!-- #all or space-separated list drawn from derivationChoice -->
68 <!ENTITY % blockSet "CDATA">
69 <!-- #all or space-separated list drawn from
70 derivationChoice + 'equivClass' and 'list' -->
72 <!ENTITY % mgs '%all; | %choice; | %sequence;'>
73 <!ENTITY % cs '%choice; | %sequence;'>
75 <!-- the duplication below is to produce an unambiguous content model
76 which allows annotation everywhere -->
77 <!ELEMENT %schema; ((%include; | %import; | %annotation;)*,
78 (%simpleType; | %complexType;
80 | %attributeGroup; | %group;
83 | %simpleType; | %complexType;
85 | %attributeGroup; | %group;
88 targetNamespace %URIref; #IMPLIED
89 version CDATA #IMPLIED
90 %nds; %URIref; #FIXED '&XMLSchemaNS;'
91 %dtnds; %URIref; #FIXED '&XMLSchemaNS;/datatypes'
92 finalDefault %complexDerivationSet; ''
93 blockDefault %blockSet; ''
96 <!-- Note the xmlns declaration is NOT in the Schema for Schemas,
97 because at the Infoset level where schemas operate,
98 xmlns(:prefix) is NOT an attribute! -->
100 <!-- The id attribute here and below is for use in external references
101 from non-schemas using simple fragment identifiers.
102 It is NOT used for schema-to-schema reference, internal or
105 <!-- a type is a named content type specification which allows attribute
109 <!ELEMENT %complexType; ((%annotation;)?,
111 ((%element;| %mgs; | %group; | %any;)*,
112 (%attribute;| %attributeGroup;)*,
113 (%anyAttribute;)?)))>
115 <!ATTLIST %complexType;
116 name %NCName; #IMPLIED
118 content (textOnly|mixed|elementOnly|empty) #IMPLIED
119 abstract %boolean; 'false'
120 final %complexDerivationSet; ''
121 block %complexDerivationSet; ''
122 derivedBy %complexDerivationChoice; #IMPLIED
123 base %QName; #IMPLIED
126 <!-- facets only if derivedBy='restriction' -->
127 <!-- (element|group|any) only if content=mixed or =elementOnly
128 and NO derivedBy at all, i.e. a root type -->
129 <!-- content defaults to base's if there is a complex base,
130 textonly if there's a simple base,
131 'mixed' if no base (because that's the urType's content)
132 and no content daughters,
133 'elementOnly' otherwise -->
134 <!-- should we replace content='empty' with content='elementOnly'
135 final='#all' plus no content? -->
137 <!-- If one top-level group, that IS the content model, otherwise
138 an implicit group obtains.
140 <sequence minOccurs='1' maxOccurs='1'>
141 unless content='mixed', in which case it's
142 <choice minOccurs='0' maxOccurs='*'> -->
144 <!-- If anyAttribute appears in one or more referenced attributeGroups
145 and/or explicitly, the intersection of the permissions is used -->
147 <!-- A text-only type with no attributes differs from a datatype with
148 the same base qualified the same way in regard to the impact on
149 attributes of anyAttribute -->
151 <!-- an element is declared by either:
152 a name and a type (either nested or referenced via the type attribute)
154 a ref to an existing element declaration -->
156 <!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
157 (%unique; | %key; | %keyref;)*)>
158 <!-- type or datatype only if no type|ref attribute -->
159 <!-- ref not allowed at top level -->
161 name %NCName; #IMPLIED
164 type %QName; #IMPLIED
165 minOccurs %non-negative-integer; '1'
166 maxOccurs CDATA #IMPLIED
167 nullable %boolean; 'false'
168 equivClass %QName; #IMPLIED
169 abstract %boolean; 'false'
170 final %complexDerivationSet; ''
172 default CDATA #IMPLIED
175 <!-- type and ref are mutually exclusive.
176 name and ref are mutually exculsive, one is required -->
177 <!-- In the absence of type AND ref, type defaults to type of
178 equivClass, if any, else the ur-type, i.e. unconstrained -->
179 <!-- maxOccurs defaults to 1 or minOccurs, whichever is greater -->
180 <!-- default and fixed are mutually exclusive -->
182 <!ELEMENT %group; (%mgs;)?>
184 name %NCName; #IMPLIED
186 minOccurs %non-negative-integer; '1'
187 maxOccurs CDATA #IMPLIED
191 <!ELEMENT %all; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
193 minOccurs %non-negative-integer; '1'
194 maxOccurs CDATA #IMPLIED
198 <!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
200 minOccurs %non-negative-integer; '1'
201 maxOccurs CDATA #IMPLIED
205 <!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
207 minOccurs %non-negative-integer; '1'
208 maxOccurs CDATA #IMPLIED
212 <!-- an anonymous grouping in a model, or
213 a top-level named group definition, or a reference to same -->
215 <!-- Note that if order is 'all', group is not allowed inside.
216 If order is 'all' THIS group must be alone (or referenced alone) at
217 the top level of a content model -->
218 <!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
219 <!-- Should allow minOccurs=0 inside order='all' . . . -->
221 <!ELEMENT %any; EMPTY>
223 namespace CDATA '##any'
224 processContents (skip|lax|strict) 'strict'
225 minOccurs %non-negative-integer; '1'
226 maxOccurs CDATA #IMPLIED
229 <!-- namespace is interpreted as follows:
230 ##any - - any non-conflicting WFXML at all
232 ##other - - any non-conflicting WFXML from namespace other
235 ##local - - any unqualified non-conflicting WFXML/attribute
236 one or - - any non-conflicting WFXML from
237 more URI the listed namespaces
240 ##targetNamespace may appear in the above list, with the
243 <!ELEMENT %anyAttribute; EMPTY>
244 <!ATTLIST %anyAttribute;
245 namespace CDATA '##any'
247 <!-- namespace is interpreted as for 'any' above -->
250 <!-- for use inside basetype to copy down corresponding content
251 model particle from the basetype's content model -->
252 <!ELEMENT %sic; EMPTY>
254 <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
255 <!ATTLIST %attribute;
256 name %NCName; #REQUIRED
257 type %QName; #IMPLIED
260 default CDATA #IMPLIED
263 <!-- default and fixed are mutually exclusive -->
264 <!-- type attr and datatype content are mutually exclusive -->
266 <!-- an attributeGroup is a named collection of attribute decls, or a
267 reference thereto -->
268 <!ELEMENT %attributeGroup; ((%annotation;)?,
269 (%attribute; | %attributeGroup;)*,
271 <!ATTLIST %attributeGroup;
272 name %NCName; #IMPLIED
275 %attributeGroupAttrs;>
277 <!-- ref iff no content, no name. ref iff not top level -->
279 <!-- better reference mechanisms -->
280 <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
281 <!ATTLIST %unique; name %NCName; #REQUIRED
285 <!ELEMENT %key; ((%annotation;)?, %selector;, (%field;)+)>
286 <!ATTLIST %key; name %NCName; #REQUIRED
290 <!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
292 name %NCName; #REQUIRED
294 refer %QName; #REQUIRED
297 <!ELEMENT %selector; (#PCDATA)>
298 <!ELEMENT %field; (#PCDATA)>
300 <!-- Schema combination mechanisms -->
301 <!ELEMENT %include; EMPTY>
302 <!ATTLIST %include; schemaLocation %URIref; #REQUIRED
305 <!ELEMENT %import; EMPTY>
306 <!ATTLIST %import; namespace %URIref; #REQUIRED
307 schemaLocation %URIref; #IMPLIED
310 <!ELEMENT %notation; EMPTY>
312 name %NCName; #REQUIRED
314 public CDATA #REQUIRED
315 system %URIref; #IMPLIED
318 <!NOTATION XMLSchemaStructures PUBLIC 'structures'
320 <!NOTATION XML PUBLIC 'REC-xml-1998-0210'
321 'http://www.w3.org/TR/1998/REC-xml-19980210' >