Initial Commit
[packages] / xemacs-packages / psgml-dtds / etc / structures.dtd
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 -->
9
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' >
14 %xs-datatypes;
15
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;'>
20
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">
42
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 -->
46
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 ''>
64
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' -->
71
72 <!ENTITY % mgs '%all; | %choice; | %sequence;'>
73 <!ENTITY % cs '%choice; | %sequence;'>
74
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;
79                      | %element;
80                      | %attributeGroup; | %group;
81                      | %notation; ),
82                     (%annotation;
83                      | %simpleType; | %complexType;
84                      | %element;
85                      | %attributeGroup; | %group;
86                      | %notation; )* )>
87 <!ATTLIST %schema;
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;             ''
94      id                 ID                     #IMPLIED
95      %schemaAttrs;>
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! -->
99  
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
103      external. -->
104
105 <!-- a type is a named content type specification which allows attribute
106      declarations-->
107 <!-- -->
108
109 <!ELEMENT %complexType; ((%annotation;)?,
110                  ((%facet;)*|
111                   ((%element;| %mgs; | %group; | %any;)*,
112                    (%attribute;| %attributeGroup;)*,
113                    (%anyAttribute;)?)))>
114
115 <!ATTLIST %complexType;
116           name      %NCName;                        #IMPLIED
117           id        ID                              #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
124           %complexTypeAttrs;>
125
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? -->
136
137 <!-- If one top-level group, that IS the content model, otherwise
138      an implicit group obtains.
139      This is
140        <sequence minOccurs='1' maxOccurs='1'>
141      unless content='mixed', in which case it's
142        <choice minOccurs='0' maxOccurs='*'> -->
143
144 <!-- If anyAttribute appears in one or more referenced attributeGroups
145      and/or explicitly, the intersection of the permissions is used -->
146
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 -->
150
151 <!-- an element is declared by either:
152  a name and a type (either nested or referenced via the type attribute)
153 or:
154  a ref to an existing element declaration -->
155
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 -->
160 <!ATTLIST %element;
161             name        %NCName;               #IMPLIED
162             id          ID                     #IMPLIED
163             ref         %QName;                #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; ''
171             block       %blockSet;             ''
172             default     CDATA                  #IMPLIED
173             fixed       CDATA                  #IMPLIED
174             %elementAttrs;>
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 -->
181
182 <!ELEMENT %group; (%mgs;)?>
183 <!ATTLIST %group; 
184           name        %NCName;               #IMPLIED
185           ref         %QName;                #IMPLIED
186           minOccurs   %non-negative-integer; '1'
187           maxOccurs   CDATA                  #IMPLIED
188           id          ID                     #IMPLIED
189           %groupAttrs;>
190
191 <!ELEMENT %all; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
192 <!ATTLIST %all;
193           minOccurs   %non-negative-integer; '1'
194           maxOccurs   CDATA                  #IMPLIED
195           id          ID                     #IMPLIED
196           %allAttrs;>
197
198 <!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
199 <!ATTLIST %choice;
200           minOccurs   %non-negative-integer; '1'
201           maxOccurs   CDATA                  #IMPLIED
202           id          ID                     #IMPLIED
203           %choiceAttrs;>
204
205 <!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
206 <!ATTLIST %sequence;
207           minOccurs   %non-negative-integer; '1'
208           maxOccurs   CDATA                  #IMPLIED
209           id          ID                     #IMPLIED
210           %sequenceAttrs;>
211
212 <!-- an anonymous grouping in a model, or
213      a top-level named group definition, or a reference to same -->
214
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' . . . -->
220
221 <!ELEMENT %any; EMPTY>
222 <!ATTLIST %any;
223             namespace       CDATA                  '##any'
224             processContents (skip|lax|strict)      'strict'
225             minOccurs       %non-negative-integer; '1'
226             maxOccurs       CDATA                  #IMPLIED
227             %anyAttrs;>
228
229 <!-- namespace is interpreted as follows:
230                   ##any      - - any non-conflicting WFXML at all
231
232                   ##other    - - any non-conflicting WFXML from namespace other
233                                   than targetNamespace
234
235                   ##local    - - any unqualified non-conflicting WFXML/attribute
236                   one or     - - any non-conflicting WFXML from
237                   more URI        the listed namespaces
238                   references
239
240                   ##targetNamespace may appear in the above list, with the
241                    obvious meaning -->
242
243 <!ELEMENT %anyAttribute; EMPTY>
244 <!ATTLIST %anyAttribute;
245             namespace    CDATA   '##any'
246             %anyAttributeAttrs;>
247 <!-- namespace is interpreted as for 'any' above -->
248
249
250 <!-- for use inside basetype to copy down corresponding content
251      model particle from the basetype's content model -->
252 <!ELEMENT %sic; EMPTY>
253
254 <!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
255 <!ATTLIST %attribute;
256           name      %NCName;      #REQUIRED
257           type      %QName;       #IMPLIED
258           maxOccurs (0|1)         '1'
259           minOccurs (0|1)         '0'
260           default   CDATA         #IMPLIED
261           fixed     CDATA         #IMPLIED
262           %attributeAttrs;>
263 <!-- default and fixed are mutually exclusive -->
264 <!-- type attr and datatype content are mutually exclusive -->
265
266 <!-- an attributeGroup is a named collection of attribute decls, or a
267      reference thereto -->
268 <!ELEMENT %attributeGroup; ((%annotation;)?,
269                        (%attribute; | %attributeGroup;)*,
270                        (%anyAttribute;)?) >
271 <!ATTLIST %attributeGroup;
272                  name       %NCName;       #IMPLIED
273                  id         ID             #IMPLIED
274                  ref        %QName;        #IMPLIED
275                  %attributeGroupAttrs;>
276
277 <!-- ref iff no content, no name.  ref iff not top level -->
278
279 <!-- better reference mechanisms -->
280 <!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
281 <!ATTLIST %unique; name     %NCName;       #REQUIRED
282                    id       ID             #IMPLIED
283                    %uniqueAttrs;>
284
285 <!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
286 <!ATTLIST %key;    name     %NCName;       #REQUIRED
287                    id       ID             #IMPLIED
288                    %keyAttrs;>
289
290 <!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
291 <!ATTLIST %keyref;
292                    name     %NCName;       #REQUIRED
293                    id       ID             #IMPLIED
294                    refer    %QName;        #REQUIRED
295                    %keyrefAttrs;>
296
297 <!ELEMENT %selector; (#PCDATA)>
298 <!ELEMENT %field; (#PCDATA)>
299
300 <!-- Schema combination mechanisms -->
301 <!ELEMENT %include; EMPTY>
302 <!ATTLIST %include; schemaLocation %URIref; #REQUIRED
303                     %includeAttrs;>
304
305 <!ELEMENT %import; EMPTY>
306 <!ATTLIST %import; namespace      %URIref; #REQUIRED
307                    schemaLocation %URIref; #IMPLIED
308                    %importAttrs;>
309
310 <!ELEMENT %notation; EMPTY>
311 <!ATTLIST %notation;
312                  name        %NCName;    #REQUIRED
313                  id          ID          #IMPLIED
314                  public      CDATA       #REQUIRED
315                  system      %URIref;    #IMPLIED
316                  %notationAttrs;>
317
318 <!NOTATION XMLSchemaStructures PUBLIC 'structures'
319            '&XSP1.URI;.xsd' >
320 <!NOTATION XML PUBLIC 'REC-xml-1998-0210'
321                'http://www.w3.org/TR/1998/REC-xml-19980210' >