2 DTD for XML Schemas: Part 2: Datatypes
3 $Id: datatypes.dtd,v 1.23 2001/03/16 17:36:30 ht Exp $
4 Note this DTD is NOT normative, or even definitive. - - the
5 prose copy in the datatypes REC is the definitive version
6 (which shouldn't differ from this one except for this comment
7 and entity expansions, but just in case)
11 This DTD cannot be used on its own, it is intended
12 only for incorporation in XMLSchema.dtd, q.v.
15 <!-- Define all the element names, with optional prefix -->
16 <!ENTITY % simpleType "%p;simpleType">
17 <!ENTITY % restriction "%p;restriction">
18 <!ENTITY % list "%p;list">
19 <!ENTITY % union "%p;union">
20 <!ENTITY % maxExclusive "%p;maxExclusive">
21 <!ENTITY % minExclusive "%p;minExclusive">
22 <!ENTITY % maxInclusive "%p;maxInclusive">
23 <!ENTITY % minInclusive "%p;minInclusive">
24 <!ENTITY % totalDigits "%p;totalDigits">
25 <!ENTITY % fractionDigits "%p;fractionDigits">
26 <!ENTITY % length "%p;length">
27 <!ENTITY % minLength "%p;minLength">
28 <!ENTITY % maxLength "%p;maxLength">
29 <!ENTITY % enumeration "%p;enumeration">
30 <!ENTITY % whiteSpace "%p;whiteSpace">
31 <!ENTITY % pattern "%p;pattern">
34 Customisation entities for the ATTLIST of each element
35 type. Define one of these if your schema takes advantage
36 of the anyAttribute='##other' in the schema for schemas
39 <!ENTITY % simpleTypeAttrs "">
40 <!ENTITY % restrictionAttrs "">
41 <!ENTITY % listAttrs "">
42 <!ENTITY % unionAttrs "">
43 <!ENTITY % maxExclusiveAttrs "">
44 <!ENTITY % minExclusiveAttrs "">
45 <!ENTITY % maxInclusiveAttrs "">
46 <!ENTITY % minInclusiveAttrs "">
47 <!ENTITY % totalDigitsAttrs "">
48 <!ENTITY % fractionDigitsAttrs "">
49 <!ENTITY % lengthAttrs "">
50 <!ENTITY % minLengthAttrs "">
51 <!ENTITY % maxLengthAttrs "">
52 <!ENTITY % enumerationAttrs "">
53 <!ENTITY % whiteSpaceAttrs "">
54 <!ENTITY % patternAttrs "">
56 <!-- Define some entities for informative use as attribute
58 <!ENTITY % URIref "CDATA">
59 <!ENTITY % XPathExpr "CDATA">
60 <!ENTITY % QName "NMTOKEN">
61 <!ENTITY % QNames "NMTOKENS">
62 <!ENTITY % NCName "NMTOKEN">
63 <!ENTITY % nonNegativeInteger "NMTOKEN">
64 <!ENTITY % boolean "(true|false)">
65 <!ENTITY % simpleDerivationSet "CDATA">
67 #all or space-separated list drawn from derivationChoice
71 Note that the use of 'facet' below is less restrictive
72 than is really intended: There should in fact be no
73 more than one of each of minInclusive, minExclusive,
74 maxInclusive, maxExclusive, totalDigits, fractionDigits,
75 length, maxLength, minLength within datatype,
76 and the min- and max- variants of Inclusive and Exclusive
77 are mutually exclusive. On the other hand, pattern and
78 enumeration may repeat.
80 <!ENTITY % minBound "(%minInclusive; | %minExclusive;)">
81 <!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)">
82 <!ENTITY % bounds "%minBound; | %maxBound;">
83 <!ENTITY % numeric "%totalDigits; | %fractionDigits;">
84 <!ENTITY % ordered "%bounds; | %numeric;">
86 "%pattern; | %enumeration; | %whiteSpace; | %length; |
87 %maxLength; | %minLength;">
88 <!ENTITY % facet "%ordered; | %unordered;">
90 "value CDATA #REQUIRED
92 <!ENTITY % fixedAttr "fixed %boolean; #IMPLIED">
93 <!ENTITY % facetModel "(%annotation;)?">
94 <!ELEMENT %simpleType;
95 ((%annotation;)?, (%restriction; | %list; | %union;))>
96 <!ATTLIST %simpleType;
97 name %NCName; #IMPLIED
98 final %simpleDerivationSet; #IMPLIED
101 <!-- name is required at top level -->
102 <!ELEMENT %restriction; ((%annotation;)?,
104 ((%simpleType;)?,(%facet;)*)),
106 <!ATTLIST %restriction;
107 base %QName; #IMPLIED
111 base and simpleType child are mutually exclusive,
114 restriction is shared between simpleType and
115 simpleContent and complexContent (in XMLSchema.xsd).
116 restriction1 is for the latter cases, when this
117 is restricting a complex type, as is attrDecls.
119 <!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)>
121 itemType %QName; #IMPLIED
125 itemType and simpleType child are mutually exclusive,
128 <!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)>
131 memberTypes %QNames; #IMPLIED
134 At least one item in memberTypes or one simpleType
138 <!ELEMENT %maxExclusive; %facetModel;>
139 <!ATTLIST %maxExclusive;
143 <!ELEMENT %minExclusive; %facetModel;>
144 <!ATTLIST %minExclusive;
149 <!ELEMENT %maxInclusive; %facetModel;>
150 <!ATTLIST %maxInclusive;
154 <!ELEMENT %minInclusive; %facetModel;>
155 <!ATTLIST %minInclusive;
160 <!ELEMENT %totalDigits; %facetModel;>
161 <!ATTLIST %totalDigits;
165 <!ELEMENT %fractionDigits; %facetModel;>
166 <!ATTLIST %fractionDigits;
169 %fractionDigitsAttrs;>
171 <!ELEMENT %length; %facetModel;>
176 <!ELEMENT %minLength; %facetModel;>
177 <!ATTLIST %minLength;
181 <!ELEMENT %maxLength; %facetModel;>
182 <!ATTLIST %maxLength;
187 <!-- This one can be repeated -->
188 <!ELEMENT %enumeration; %facetModel;>
189 <!ATTLIST %enumeration;
193 <!ELEMENT %whiteSpace; %facetModel;>
194 <!ATTLIST %whiteSpace;
199 <!-- This one can be repeated -->
200 <!ELEMENT %pattern; %facetModel;>