Project

Profile

Help

How to connect?
Download (15.7 KB) Statistics
| Branch: | Tag: | Revision:

he / latest10 / hej / net / sf / saxon / data / w3c / xmlschema10 / XMLSchema.dtd @ 02f8308b

1
<!-- DTD for XML Schemas: Part 1: Structures
2
     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
3
     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
4
<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
5
<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
6
<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
7
<!-- (which shouldn't differ from this one except for this -->         <!--d-->
8
<!-- comment and entity expansions, but just in case) -->              <!--d-->
9
<!-- With the exception of cases with multiple namespace
10
     prefixes for the XML Schema namespace, any XML document which is
11
     not valid per this DTD given redefinitions in its internal subset of the
12
     'p' and 's' parameter entities below appropriate to its namespace
13
     declaration of the XML Schema namespace is almost certainly not
14
     a valid schema. -->
15

    
16
<!-- The simpleType element and its constituent parts
17
     are defined in XML Schema: Part 2: Datatypes -->
18
<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
19

    
20
<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
21
                         schema document to establish a different
22
                         namespace prefix -->
23
<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
24
                         also define %s as the suffix for the appropriate
25
                         namespace declaration (e.g. :foo) -->
26
<!ENTITY % nds 'xmlns%s;'>
27

    
28
<!-- Define all the element names, with optional prefix -->
29
<!ENTITY % schema "%p;schema">
30
<!ENTITY % complexType "%p;complexType">
31
<!ENTITY % complexContent "%p;complexContent">
32
<!ENTITY % simpleContent "%p;simpleContent">
33
<!ENTITY % extension "%p;extension">
34
<!ENTITY % element "%p;element">
35
<!ENTITY % unique "%p;unique">
36
<!ENTITY % key "%p;key">
37
<!ENTITY % keyref "%p;keyref">
38
<!ENTITY % selector "%p;selector">
39
<!ENTITY % field "%p;field">
40
<!ENTITY % group "%p;group">
41
<!ENTITY % all "%p;all">
42
<!ENTITY % choice "%p;choice">
43
<!ENTITY % sequence "%p;sequence">
44
<!ENTITY % any "%p;any">
45
<!ENTITY % anyAttribute "%p;anyAttribute">
46
<!ENTITY % attribute "%p;attribute">
47
<!ENTITY % attributeGroup "%p;attributeGroup">
48
<!ENTITY % include "%p;include">
49
<!ENTITY % import "%p;import">
50
<!ENTITY % redefine "%p;redefine">
51
<!ENTITY % notation "%p;notation">
52

    
53
<!-- annotation elements -->
54
<!ENTITY % annotation "%p;annotation">
55
<!ENTITY % appinfo "%p;appinfo">
56
<!ENTITY % documentation "%p;documentation">
57

    
58
<!-- Customisation entities for the ATTLIST of each element type.
59
     Define one of these if your schema takes advantage of the
60
     anyAttribute='##other' in the schema for schemas -->
61

    
62
<!ENTITY % schemaAttrs ''>
63
<!ENTITY % complexTypeAttrs ''>
64
<!ENTITY % complexContentAttrs ''>
65
<!ENTITY % simpleContentAttrs ''>
66
<!ENTITY % extensionAttrs ''>
67
<!ENTITY % elementAttrs ''>
68
<!ENTITY % groupAttrs ''>
69
<!ENTITY % allAttrs ''>
70
<!ENTITY % choiceAttrs ''>
71
<!ENTITY % sequenceAttrs ''>
72
<!ENTITY % anyAttrs ''>
73
<!ENTITY % anyAttributeAttrs ''>
74
<!ENTITY % attributeAttrs ''>
75
<!ENTITY % attributeGroupAttrs ''>
76
<!ENTITY % uniqueAttrs ''>
77
<!ENTITY % keyAttrs ''>
78
<!ENTITY % keyrefAttrs ''>
79
<!ENTITY % selectorAttrs ''>
80
<!ENTITY % fieldAttrs ''>
81
<!ENTITY % includeAttrs ''>
82
<!ENTITY % importAttrs ''>
83
<!ENTITY % redefineAttrs ''>
84
<!ENTITY % notationAttrs ''>
85
<!ENTITY % annotationAttrs ''>
86
<!ENTITY % appinfoAttrs ''>
87
<!ENTITY % documentationAttrs ''>
88

    
89
<!ENTITY % complexDerivationSet "CDATA">
90
      <!-- #all or space-separated list drawn from derivationChoice -->
91
<!ENTITY % blockSet "CDATA">
92
      <!-- #all or space-separated list drawn from
93
                      derivationChoice + 'substitution' -->
94

    
95
<!ENTITY % mgs '%all; | %choice; | %sequence;'>
96
<!ENTITY % cs '%choice; | %sequence;'>
97
<!ENTITY % formValues '(qualified|unqualified)'>
98

    
99

    
100
<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
101

    
102
<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
103

    
104
<!-- This is used in part2 -->
105
<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
106

    
107
%xs-datatypes;
108

    
109
<!-- the duplication below is to produce an unambiguous content model
110
     which allows annotation everywhere -->
111
<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
112
                    ((%simpleType; | %complexType;
113
                      | %element; | %attribute;
114
                      | %attributeGroup; | %group;
115
                      | %notation; ),
116
                     (%annotation;)*)* )>
117
<!ATTLIST %schema;
118
   targetNamespace      %URIref;               #IMPLIED
119
   version              CDATA                  #IMPLIED
120
   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
121
   xmlns                CDATA                  #IMPLIED
122
   finalDefault         %complexDerivationSet; ''
123
   blockDefault         %blockSet;             ''
124
   id                   ID                     #IMPLIED
125
   elementFormDefault   %formValues;           'unqualified'
126
   attributeFormDefault %formValues;           'unqualified'
127
   xml:lang             CDATA                  #IMPLIED
128
   %schemaAttrs;>
129
<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
130
     because at the Infoset level where schemas operate,
131
     xmlns(:prefix) is NOT an attribute! -->
132
<!-- The declaration of xmlns is a convenience for schema authors -->
133
 
134
<!-- The id attribute here and below is for use in external references
135
     from non-schemas using simple fragment identifiers.
136
     It is NOT used for schema-to-schema reference, internal or
137
     external. -->
138

    
139
<!-- a type is a named content type specification which allows attribute
140
     declarations-->
141
<!-- -->
142

    
143
<!ELEMENT %complexType; ((%annotation;)?,
144
                         (%simpleContent;|%complexContent;|
145
                          %particleAndAttrs;))>
146

    
147
<!ATTLIST %complexType;
148
          name      %NCName;                        #IMPLIED
149
          id        ID                              #IMPLIED
150
          abstract  %boolean;                       #IMPLIED
151
          final     %complexDerivationSet;          #IMPLIED
152
          block     %complexDerivationSet;          #IMPLIED
153
          mixed (true|false) 'false'
154
          %complexTypeAttrs;>
155

    
156
<!-- particleAndAttrs is shorthand for a root type -->
157
<!-- mixed is disallowed if simpleContent, overriden if complexContent
158
     has one too. -->
159

    
160
<!-- If anyAttribute appears in one or more referenced attributeGroups
161
     and/or explicitly, the intersection of the permissions is used -->
162

    
163
<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
164
<!ATTLIST %complexContent;
165
          mixed (true|false) #IMPLIED
166
          id    ID           #IMPLIED
167
          %complexContentAttrs;>
168

    
169
<!-- restriction should use the branch defined above, not the simple
170
     one from part2; extension should use the full model  -->
171

    
172
<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
173
<!ATTLIST %simpleContent;
174
          id    ID           #IMPLIED
175
          %simpleContentAttrs;>
176

    
177
<!-- restriction should use the simple branch from part2, not the 
178
     one defined above; extension should have no particle  -->
179

    
180
<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
181
<!ATTLIST %extension;
182
          base  %QName;      #REQUIRED
183
          id    ID           #IMPLIED
184
          %extensionAttrs;>
185

    
186
<!-- an element is declared by either:
187
 a name and a type (either nested or referenced via the type attribute)
188
 or a ref to an existing element declaration -->
189

    
190
<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
191
                     (%unique; | %key; | %keyref;)*)>
192
<!-- simpleType or complexType only if no type|ref attribute -->
193
<!-- ref not allowed at top level -->
194
<!ATTLIST %element;
195
            name               %NCName;               #IMPLIED
196
            id                 ID                     #IMPLIED
197
            ref                %QName;                #IMPLIED
198
            type               %QName;                #IMPLIED
199
            minOccurs          %nonNegativeInteger;   #IMPLIED
200
            maxOccurs          CDATA                  #IMPLIED
201
            nillable           %boolean;              #IMPLIED
202
            substitutionGroup  %QName;                #IMPLIED
203
            abstract           %boolean;              #IMPLIED
204
            final              %complexDerivationSet; #IMPLIED
205
            block              %blockSet;             #IMPLIED
206
            default            CDATA                  #IMPLIED
207
            fixed              CDATA                  #IMPLIED
208
            form               %formValues;           #IMPLIED
209
            %elementAttrs;>
210
<!-- type and ref are mutually exclusive.
211
     name and ref are mutually exclusive, one is required -->
212
<!-- In the absence of type AND ref, type defaults to type of
213
     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
214
<!-- default and fixed are mutually exclusive -->
215

    
216
<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
217
<!ATTLIST %group; 
218
          name        %NCName;               #IMPLIED
219
          ref         %QName;                #IMPLIED
220
          minOccurs   %nonNegativeInteger;   #IMPLIED
221
          maxOccurs   CDATA                  #IMPLIED
222
          id          ID                     #IMPLIED
223
          %groupAttrs;>
224

    
225
<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
226
<!ATTLIST %all;
227
          minOccurs   (1)                    #IMPLIED
228
          maxOccurs   (1)                    #IMPLIED
229
          id          ID                     #IMPLIED
230
          %allAttrs;>
231

    
232
<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
233
<!ATTLIST %choice;
234
          minOccurs   %nonNegativeInteger;   #IMPLIED
235
          maxOccurs   CDATA                  #IMPLIED
236
          id          ID                     #IMPLIED
237
          %choiceAttrs;>
238

    
239
<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
240
<!ATTLIST %sequence;
241
          minOccurs   %nonNegativeInteger;   #IMPLIED
242
          maxOccurs   CDATA                  #IMPLIED
243
          id          ID                     #IMPLIED
244
          %sequenceAttrs;>
245

    
246
<!-- an anonymous grouping in a model, or
247
     a top-level named group definition, or a reference to same -->
248

    
249
<!-- Note that if order is 'all', group is not allowed inside.
250
     If order is 'all' THIS group must be alone (or referenced alone) at
251
     the top level of a content model -->
252
<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
253
<!-- Should allow minOccurs=0 inside order='all' . . . -->
254

    
255
<!ELEMENT %any; (%annotation;)?>
256
<!ATTLIST %any;
257
            namespace       CDATA                  '##any'
258
            processContents (skip|lax|strict)      'strict'
259
            minOccurs       %nonNegativeInteger;   '1'
260
            maxOccurs       CDATA                  '1'
261
            id              ID                     #IMPLIED
262
            %anyAttrs;>
263

    
264
<!-- namespace is interpreted as follows:
265
                  ##any      - - any non-conflicting WFXML at all
266

    
267
                  ##other    - - any non-conflicting WFXML from namespace other
268
                                  than targetNamespace
269

    
270
                  ##local    - - any unqualified non-conflicting WFXML/attribute
271
                  one or     - - any non-conflicting WFXML from
272
                  more URI        the listed namespaces
273
                  references
274

    
275
                  ##targetNamespace ##local may appear in the above list,
276
                    with the obvious meaning -->
277

    
278
<!ELEMENT %anyAttribute; (%annotation;)?>
279
<!ATTLIST %anyAttribute;
280
            namespace       CDATA              '##any'
281
            processContents (skip|lax|strict)  'strict'
282
            id              ID                 #IMPLIED
283
            %anyAttributeAttrs;>
284
<!-- namespace is interpreted as for 'any' above -->
285

    
286
<!-- simpleType only if no type|ref attribute -->
287
<!-- ref not allowed at top level, name iff at top level -->
288
<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
289
<!ATTLIST %attribute;
290
          name      %NCName;      #IMPLIED
291
          id        ID            #IMPLIED
292
          ref       %QName;       #IMPLIED
293
          type      %QName;       #IMPLIED
294
          use       (prohibited|optional|required) #IMPLIED
295
          default   CDATA         #IMPLIED
296
          fixed     CDATA         #IMPLIED
297
          form      %formValues;  #IMPLIED
298
          %attributeAttrs;>
299
<!-- type and ref are mutually exclusive.
300
     name and ref are mutually exclusive, one is required -->
301
<!-- default for use is optional when nested, none otherwise -->
302
<!-- default and fixed are mutually exclusive -->
303
<!-- type attr and simpleType content are mutually exclusive -->
304

    
305
<!-- an attributeGroup is a named collection of attribute decls, or a
306
     reference thereto -->
307
<!ELEMENT %attributeGroup; ((%annotation;)?,
308
                       (%attribute; | %attributeGroup;)*,
309
                       (%anyAttribute;)?) >
310
<!ATTLIST %attributeGroup;
311
                 name       %NCName;       #IMPLIED
312
                 id         ID             #IMPLIED
313
                 ref        %QName;        #IMPLIED
314
                 %attributeGroupAttrs;>
315

    
316
<!-- ref iff no content, no name.  ref iff not top level -->
317

    
318
<!-- better reference mechanisms -->
319
<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
320
<!ATTLIST %unique;
321
          name     %NCName;       #REQUIRED
322
	  id       ID             #IMPLIED
323
	  %uniqueAttrs;>
324

    
325
<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
326
<!ATTLIST %key;
327
          name     %NCName;       #REQUIRED
328
	  id       ID             #IMPLIED
329
	  %keyAttrs;>
330

    
331
<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
332
<!ATTLIST %keyref;
333
          name     %NCName;       #REQUIRED
334
	  refer    %QName;        #REQUIRED
335
	  id       ID             #IMPLIED
336
	  %keyrefAttrs;>
337

    
338
<!ELEMENT %selector; ((%annotation;)?)>
339
<!ATTLIST %selector;
340
          xpath %XPathExpr; #REQUIRED
341
          id    ID          #IMPLIED
342
          %selectorAttrs;>
343
<!ELEMENT %field; ((%annotation;)?)>
344
<!ATTLIST %field;
345
          xpath %XPathExpr; #REQUIRED
346
          id    ID          #IMPLIED
347
          %fieldAttrs;>
348

    
349
<!-- Schema combination mechanisms -->
350
<!ELEMENT %include; (%annotation;)?>
351
<!ATTLIST %include;
352
          schemaLocation %URIref; #REQUIRED
353
          id             ID       #IMPLIED
354
          %includeAttrs;>
355

    
356
<!ELEMENT %import; (%annotation;)?>
357
<!ATTLIST %import;
358
          namespace      %URIref; #IMPLIED
359
          schemaLocation %URIref; #IMPLIED
360
          id             ID       #IMPLIED
361
          %importAttrs;>
362

    
363
<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
364
                      %attributeGroup; | %group;)*>
365
<!ATTLIST %redefine;
366
          schemaLocation %URIref; #REQUIRED
367
          id             ID       #IMPLIED
368
          %redefineAttrs;>
369

    
370
<!ELEMENT %notation; (%annotation;)?>
371
<!ATTLIST %notation;
372
	  name        %NCName;    #REQUIRED
373
	  id          ID          #IMPLIED
374
	  public      CDATA       #REQUIRED
375
	  system      %URIref;    #IMPLIED
376
	  %notationAttrs;>
377

    
378
<!-- Annotation is either application information or documentation -->
379
<!-- By having these here they are available for datatypes as well
380
     as all the structures elements -->
381

    
382
<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
383
<!ATTLIST %annotation; %annotationAttrs;>
384

    
385
<!-- User must define annotation elements in internal subset for this
386
     to work -->
387
<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
388
<!ATTLIST %appinfo;
389
          source     %URIref;      #IMPLIED
390
          id         ID         #IMPLIED
391
          %appinfoAttrs;>
392
<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
393
<!ATTLIST %documentation;
394
          source     %URIref;   #IMPLIED
395
          id         ID         #IMPLIED
396
          xml:lang   CDATA      #IMPLIED
397
          %documentationAttrs;>
398

    
399
<!NOTATION XMLSchemaStructures PUBLIC
400
           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
401
<!NOTATION XML PUBLIC
402
           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >
(1-1/2)