lutaml-model 0.8.192 → 0.8.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/dependent-tests.yml +12 -0
- data/README.adoc +9 -0
- data/docs/_guides/xml-guide-0.8.0.adoc +1547 -0
- data/docs/_guides/xml_mappings/05_common_patterns.adoc +365 -1
- data/docs/missing_xml_features.adoc +35 -0
- data/docs/xml_1.0.adoc +1989 -0
- data/docs/xml_base.adoc +718 -0
- data/docs/xml_data_types.adoc +263 -0
- data/docs/xml_namespace.adoc +129 -0
- data/docs/xml_schema.adoc +500 -0
- data/docs/xml_xlink.adoc +539 -0
- data/lib/lutaml/model/attribute.rb +55 -0
- data/lib/lutaml/model/version.rb +1 -1
- data/spec/lutaml/model/namespace_autoload_spec.rb +86 -0
- metadata +10 -1
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
= XML Schema Part 1: Structures — Comprehensive Specification Reference
|
|
2
|
+
:source: https://www.w3.org/TR/xmlschema-1/
|
|
3
|
+
:edition: W3C Recommendation 28 October 2004
|
|
4
|
+
|
|
5
|
+
This document provides a complete reference to the requirements, definitions, constraints, element and attribute types, conformance levels, processing rules, and implementation guidelines for XML Schema Part 1: Structures, based on the official W3C specification.
|
|
6
|
+
|
|
7
|
+
== 1. Introduction
|
|
8
|
+
|
|
9
|
+
XML Schema: Structures defines the XML Schema definition language, which describes the structure and constrains the contents of XML 1.0 documents, including those using XML Namespaces. It reconstructs and extends the capabilities of XML DTDs, and depends on XML Schema Part 2: Datatypes.
|
|
10
|
+
|
|
11
|
+
=== 1.1 Purpose
|
|
12
|
+
- Define the nature of XML schemas and their components
|
|
13
|
+
- Inventory XML markup constructs for representing schemas
|
|
14
|
+
- Specify application of schemas to XML documents
|
|
15
|
+
- Constrain and document datatypes, elements, attributes, and their values
|
|
16
|
+
- Provide normalization, defaulting, and self-documentation facilities
|
|
17
|
+
|
|
18
|
+
.Example: Declaring XML Namespaces in Schema
|
|
19
|
+
[source,xml]
|
|
20
|
+
----
|
|
21
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
22
|
+
targetNamespace="http://example.com"
|
|
23
|
+
xmlns:ex="http://example.com">
|
|
24
|
+
</xs:schema>
|
|
25
|
+
----
|
|
26
|
+
|
|
27
|
+
== 2. Conceptual Framework
|
|
28
|
+
|
|
29
|
+
=== 2.1 Overview
|
|
30
|
+
- XML Schema consists of components (type definitions, element/attribute declarations)
|
|
31
|
+
- Used to assess validity of XML infoset items and augment infoset (PSVI)
|
|
32
|
+
- Schema-validity assessment: local validity + overall validation outcome
|
|
33
|
+
|
|
34
|
+
.Example: Validating an XML Document
|
|
35
|
+
[source,xml]
|
|
36
|
+
----
|
|
37
|
+
<!-- Instance document -->
|
|
38
|
+
<note>Remember the meeting</note>
|
|
39
|
+
<!-- Validated by the schema above -->
|
|
40
|
+
----
|
|
41
|
+
|
|
42
|
+
=== 2.2 Abstract Data Model
|
|
43
|
+
- 13 kinds of schema components: simple/complex type definitions, element/attribute declarations, attribute/model group definitions, identity-constraint definitions, notation declarations, annotation components, particles, wildcards, attribute uses
|
|
44
|
+
- Components have properties, XML representations, constraints, validation rules, PSVI contributions
|
|
45
|
+
|
|
46
|
+
.Example: Defining a Simple and Complex Type
|
|
47
|
+
[source,xml]
|
|
48
|
+
----
|
|
49
|
+
<xs:simpleType name="ZipCode">
|
|
50
|
+
<xs:restriction base="xs:string">
|
|
51
|
+
<xs:pattern value="[0-9]{5}"/>
|
|
52
|
+
</xs:restriction>
|
|
53
|
+
</xs:simpleType>
|
|
54
|
+
|
|
55
|
+
<xs:complexType name="Address">
|
|
56
|
+
<xs:sequence>
|
|
57
|
+
<xs:element name="street" type="xs:string"/>
|
|
58
|
+
<xs:element name="zipcode" type="ZipCode"/>
|
|
59
|
+
</xs:sequence>
|
|
60
|
+
</xs:complexType>
|
|
61
|
+
----
|
|
62
|
+
|
|
63
|
+
=== 2.3 Constraints and Validation Rules
|
|
64
|
+
- Schema Component Constraints: conditions for components to exist
|
|
65
|
+
- Schema Representation Constraints: XML representation rules
|
|
66
|
+
- Validation Rules: how components contribute to validation
|
|
67
|
+
- Schema Information Set Contributions: PSVI augmentations
|
|
68
|
+
|
|
69
|
+
.Example: Enforcing Constraints
|
|
70
|
+
[source,xml]
|
|
71
|
+
----
|
|
72
|
+
<xs:element name="age" type="xs:integer" minOccurs="1" maxOccurs="1"/>
|
|
73
|
+
----
|
|
74
|
+
|
|
75
|
+
.Example: Default vs Fixed Constraint
|
|
76
|
+
[source,xml]
|
|
77
|
+
----
|
|
78
|
+
<!-- This is valid: -->
|
|
79
|
+
<xs:element name="status" type="xs:string" default="active"/>
|
|
80
|
+
<!-- This is invalid: default and fixed cannot both be present -->
|
|
81
|
+
<xs:element name="status" type="xs:string" default="active" fixed="active"/>
|
|
82
|
+
----
|
|
83
|
+
|
|
84
|
+
.Example: Unique Element Name Constraint
|
|
85
|
+
[source,xml]
|
|
86
|
+
----
|
|
87
|
+
<!-- Valid: unique element names -->
|
|
88
|
+
<xs:sequence>
|
|
89
|
+
<xs:element name="firstName" type="xs:string"/>
|
|
90
|
+
<xs:element name="lastName" type="xs:string"/>
|
|
91
|
+
</xs:sequence>
|
|
92
|
+
<!-- Invalid: duplicate element name -->
|
|
93
|
+
<xs:sequence>
|
|
94
|
+
<xs:element name="name" type="xs:string"/>
|
|
95
|
+
<xs:element name="name" type="xs:string"/>
|
|
96
|
+
</xs:sequence>
|
|
97
|
+
----
|
|
98
|
+
|
|
99
|
+
.Example: Facet Constraint (Pattern)
|
|
100
|
+
[source,xml]
|
|
101
|
+
----
|
|
102
|
+
<xs:simpleType name="PhoneNumber">
|
|
103
|
+
<xs:restriction base="xs:string">
|
|
104
|
+
<xs:pattern value="\d{3}-\d{3}-\d{4}"/>
|
|
105
|
+
</xs:restriction>
|
|
106
|
+
</xs:simpleType>
|
|
107
|
+
----
|
|
108
|
+
|
|
109
|
+
.Example: Circularity Constraint
|
|
110
|
+
[source,xml]
|
|
111
|
+
----
|
|
112
|
+
<!-- Invalid: type cannot reference itself directly -->
|
|
113
|
+
<xs:complexType name="Loop">
|
|
114
|
+
<xs:sequence>
|
|
115
|
+
<xs:element name="loop" type="Loop"/>
|
|
116
|
+
</xs:sequence>
|
|
117
|
+
</xs:complexType>
|
|
118
|
+
----
|
|
119
|
+
|
|
120
|
+
.Example: Identity Constraint (Key)
|
|
121
|
+
[source,xml]
|
|
122
|
+
----
|
|
123
|
+
<xs:element name="employee">
|
|
124
|
+
<xs:complexType>
|
|
125
|
+
<xs:sequence>
|
|
126
|
+
<xs:element name="empId" type="xs:integer"/>
|
|
127
|
+
<xs:element name="name" type="xs:string"/>
|
|
128
|
+
</xs:sequence>
|
|
129
|
+
</xs:complexType>
|
|
130
|
+
<xs:key name="uniqueEmpId">
|
|
131
|
+
<xs:selector xpath="."/>
|
|
132
|
+
<xs:field xpath="empId"/>
|
|
133
|
+
</xs:key>
|
|
134
|
+
</xs:element>
|
|
135
|
+
----
|
|
136
|
+
|
|
137
|
+
.Example: Attribute Use Constraint
|
|
138
|
+
[source,xml]
|
|
139
|
+
----
|
|
140
|
+
<xs:attribute name="isbn" type="xs:string" use="required"/>
|
|
141
|
+
<xs:attribute name="edition" type="xs:string" use="optional"/>
|
|
142
|
+
<xs:attribute name="draft" type="xs:boolean" use="prohibited"/>
|
|
143
|
+
----
|
|
144
|
+
|
|
145
|
+
.Example: Wildcard Constraint
|
|
146
|
+
[source,xml]
|
|
147
|
+
----
|
|
148
|
+
<xs:any namespace="##other" processContents="strict"/>
|
|
149
|
+
----
|
|
150
|
+
|
|
151
|
+
.Example: Model Group Occurrence Constraint
|
|
152
|
+
[source,xml]
|
|
153
|
+
----
|
|
154
|
+
<xs:sequence minOccurs="1" maxOccurs="3">
|
|
155
|
+
<xs:element name="item" type="xs:string"/>
|
|
156
|
+
</xs:sequence>
|
|
157
|
+
----
|
|
158
|
+
|
|
159
|
+
.Example: Prohibited Substitution Constraint
|
|
160
|
+
[source,xml]
|
|
161
|
+
----
|
|
162
|
+
<xs:complexType name="BaseType" final="extension restriction"/>
|
|
163
|
+
----
|
|
164
|
+
|
|
165
|
+
.Example: Annotation Constraint
|
|
166
|
+
[source,xml]
|
|
167
|
+
----
|
|
168
|
+
<xs:element name="price" type="xs:decimal">
|
|
169
|
+
<xs:annotation>
|
|
170
|
+
<xs:documentation>Price must be a positive decimal value.</xs:documentation>
|
|
171
|
+
</xs:annotation>
|
|
172
|
+
</xs:element>
|
|
173
|
+
----
|
|
174
|
+
|
|
175
|
+
=== 2.4 Conformance Levels
|
|
176
|
+
- Minimally conforming: implement all component constraints, validation rules, PSVI contributions
|
|
177
|
+
- XML Representation conformance: process XML schema documents and mapping rules
|
|
178
|
+
- Fully conforming: network-enabled, access schemas from the Web, support schema location strategies
|
|
179
|
+
|
|
180
|
+
.Example: Referencing External Schema (Web Interoperability)
|
|
181
|
+
[source,xml]
|
|
182
|
+
----
|
|
183
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
184
|
+
xmlns:ex="http://example.com"
|
|
185
|
+
targetNamespace="http://example.com"
|
|
186
|
+
elementFormDefault="qualified">
|
|
187
|
+
<xs:import namespace="http://other.com" schemaLocation="http://other.com/schema.xsd"/>
|
|
188
|
+
</xs:schema>
|
|
189
|
+
----
|
|
190
|
+
|
|
191
|
+
== 3. Schema Component Details
|
|
192
|
+
|
|
193
|
+
=== 3.1 Attribute Declarations
|
|
194
|
+
- Properties: name, target namespace, type definition, scope, value constraint, annotation
|
|
195
|
+
- XML Representation: <attribute> element
|
|
196
|
+
- Constraints: mutual exclusivity of default/fixed, ref/name, type/simpleType, etc.
|
|
197
|
+
- Validation: value must conform to type, context-determined declaration
|
|
198
|
+
- Built-in attributes: xsi:type, xsi:nil, xsi:schemaLocation, xsi:noNamespaceSchemaLocation
|
|
199
|
+
|
|
200
|
+
.Example: Attribute Declaration
|
|
201
|
+
[source,xml]
|
|
202
|
+
----
|
|
203
|
+
<xs:attribute name="lang" type="xs:string" use="required"/>
|
|
204
|
+
----
|
|
205
|
+
|
|
206
|
+
=== 3.2 Element Declarations
|
|
207
|
+
- Properties: name, target namespace, type definition, scope, value constraint, nillable, identity-constraint definitions, substitution group, abstract, annotation
|
|
208
|
+
- XML Representation: <element> element
|
|
209
|
+
- Constraints: mutual exclusivity of default/fixed, ref/name, type/simpleType, etc.
|
|
210
|
+
- Validation: local validity, nillable, xsi:type, substitution groups
|
|
211
|
+
|
|
212
|
+
.Example: Element Declaration
|
|
213
|
+
[source,xml]
|
|
214
|
+
----
|
|
215
|
+
<xs:element name="price" type="xs:decimal" default="0.0"/>
|
|
216
|
+
<xs:element name="comment" type="xs:string" nillable="true"/>
|
|
217
|
+
----
|
|
218
|
+
|
|
219
|
+
=== 3.3 Complex Type Definitions
|
|
220
|
+
- Properties: name, target namespace, base type, derivation method (extension/restriction), final, abstract, attribute uses, attribute wildcard, content type, prohibited substitutions, annotation
|
|
221
|
+
- XML Representation: <complexType>, <complexContent>, <simpleContent>, <extension>, <restriction>
|
|
222
|
+
- Constraints: base type must be correct, content type rules, attribute wildcards
|
|
223
|
+
- Validation: extension/restriction rules, attribute and element content models
|
|
224
|
+
|
|
225
|
+
.Example: Complex Type Definition
|
|
226
|
+
[source,xml]
|
|
227
|
+
----
|
|
228
|
+
<xs:complexType name="Person">
|
|
229
|
+
<xs:sequence>
|
|
230
|
+
<xs:element name="name" type="xs:string"/>
|
|
231
|
+
<xs:element name="age" type="xs:integer"/>
|
|
232
|
+
</xs:sequence>
|
|
233
|
+
<xs:attribute name="id" type="xs:ID"/>
|
|
234
|
+
</xs:complexType>
|
|
235
|
+
----
|
|
236
|
+
|
|
237
|
+
=== 3.4 Simple Type Definitions
|
|
238
|
+
- Properties: name, target namespace, base type, facets, fundamental facets, final, variety (atomic/list/union), annotation
|
|
239
|
+
- XML Representation: <simpleType>, <restriction>, <list>, <union>
|
|
240
|
+
- Constraints: base type, variety, facet rules, circularity prevention
|
|
241
|
+
- Validation: string validity, datatype validity, entity name checks
|
|
242
|
+
|
|
243
|
+
.Example: Simple Type Definition with Facet
|
|
244
|
+
[source,xml]
|
|
245
|
+
----
|
|
246
|
+
<xs:simpleType name="SmallInt">
|
|
247
|
+
<xs:restriction base="xs:integer">
|
|
248
|
+
<xs:minInclusive value="0"/>
|
|
249
|
+
<xs:maxInclusive value="100"/>
|
|
250
|
+
</xs:restriction>
|
|
251
|
+
</xs:simpleType>
|
|
252
|
+
----
|
|
253
|
+
|
|
254
|
+
=== 3.5 Attribute Uses
|
|
255
|
+
- Properties: required, attribute declaration, value constraint
|
|
256
|
+
- XML Representation: <attribute> (with use/default/fixed)
|
|
257
|
+
- Constraints: consistency with attribute declaration
|
|
258
|
+
- Validation: required/optional/prohibited
|
|
259
|
+
|
|
260
|
+
.Example: Attribute Use in Complex Type
|
|
261
|
+
[source,xml]
|
|
262
|
+
----
|
|
263
|
+
<xs:complexType name="Book">
|
|
264
|
+
<xs:attribute name="isbn" type="xs:string" use="required"/>
|
|
265
|
+
<xs:attribute name="edition" type="xs:string" use="optional" default="1st"/>
|
|
266
|
+
</xs:complexType>
|
|
267
|
+
----
|
|
268
|
+
|
|
269
|
+
=== 3.6 Attribute Group Definitions
|
|
270
|
+
- Properties: name, target namespace, attribute uses, attribute wildcard, annotation
|
|
271
|
+
- XML Representation: <attributeGroup>
|
|
272
|
+
- Constraints: top-level/ref forms, intersection rules
|
|
273
|
+
- Validation: group inclusion in complex types
|
|
274
|
+
|
|
275
|
+
.Example: Attribute Group Definition
|
|
276
|
+
[source,xml]
|
|
277
|
+
----
|
|
278
|
+
<xs:attributeGroup name="commonAttrs">
|
|
279
|
+
<xs:attribute name="created" type="xs:date"/>
|
|
280
|
+
<xs:attribute name="updated" type="xs:date"/>
|
|
281
|
+
</xs:attributeGroup>
|
|
282
|
+
|
|
283
|
+
<xs:complexType name="Document">
|
|
284
|
+
<xs:attributeGroup ref="commonAttrs"/>
|
|
285
|
+
</xs:complexType>
|
|
286
|
+
----
|
|
287
|
+
|
|
288
|
+
=== 3.7 Model Group Definitions & Model Groups
|
|
289
|
+
- Properties: name, target namespace, particles, annotation
|
|
290
|
+
- XML Representation: <group>, <all>, <choice>, <sequence>
|
|
291
|
+
- Constraints: content model rules, occurrence constraints
|
|
292
|
+
- Validation: element occurrence, order, and grouping
|
|
293
|
+
|
|
294
|
+
.Example: Model Group Definition and Use
|
|
295
|
+
[source,xml]
|
|
296
|
+
----
|
|
297
|
+
<xs:group name="addressGroup">
|
|
298
|
+
<xs:sequence>
|
|
299
|
+
<xs:element name="street" type="xs:string"/>
|
|
300
|
+
<xs:element name="city" type="xs:string"/>
|
|
301
|
+
</xs:sequence>
|
|
302
|
+
</xs:group>
|
|
303
|
+
|
|
304
|
+
<xs:complexType name="Address">
|
|
305
|
+
<xs:group ref="addressGroup"/>
|
|
306
|
+
</xs:complexType>
|
|
307
|
+
----
|
|
308
|
+
|
|
309
|
+
=== 3.8 Particles
|
|
310
|
+
- Properties: term (element, model group, wildcard), minOccurs, maxOccurs
|
|
311
|
+
- XML Representation: <element>, <group>, <any>
|
|
312
|
+
- Constraints: emptiable, derivation rules
|
|
313
|
+
- Validation: occurrence and content model validation
|
|
314
|
+
|
|
315
|
+
.Example: Particle with Occurrence Constraints
|
|
316
|
+
[source,xml]
|
|
317
|
+
----
|
|
318
|
+
<xs:element name="phone" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
|
319
|
+
----
|
|
320
|
+
|
|
321
|
+
=== 3.9 Wildcards
|
|
322
|
+
- Properties: namespace constraint, processContents (strict/lax/skip), annotation
|
|
323
|
+
- XML Representation: <any>, <anyAttribute>
|
|
324
|
+
- Constraints: namespace and processContents rules
|
|
325
|
+
- Validation: matching and validation of elements/attributes
|
|
326
|
+
|
|
327
|
+
.Example: Wildcard Element
|
|
328
|
+
[source,xml]
|
|
329
|
+
----
|
|
330
|
+
<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="1"/>
|
|
331
|
+
----
|
|
332
|
+
|
|
333
|
+
=== 3.10 Identity-constraint Definitions
|
|
334
|
+
- Properties: name, target namespace, category (key, keyref, unique), selector, fields, referenced key, annotation
|
|
335
|
+
- XML Representation: <unique>, <key>, <keyref>
|
|
336
|
+
- Constraints: XPath restrictions, uniqueness/reference rules
|
|
337
|
+
- Validation: uniqueness, referential integrity
|
|
338
|
+
|
|
339
|
+
.Example: Identity Constraint (Unique)
|
|
340
|
+
[source,xml]
|
|
341
|
+
----
|
|
342
|
+
<xs:element name="user">
|
|
343
|
+
<xs:complexType>
|
|
344
|
+
<xs:sequence>
|
|
345
|
+
<xs:element name="username" type="xs:string"/>
|
|
346
|
+
</xs:sequence>
|
|
347
|
+
</xs:complexType>
|
|
348
|
+
<xs:unique name="uniqueUsername">
|
|
349
|
+
<xs:selector xpath="."/>
|
|
350
|
+
<xs:field xpath="username"/>
|
|
351
|
+
</xs:unique>
|
|
352
|
+
</xs:element>
|
|
353
|
+
----
|
|
354
|
+
|
|
355
|
+
=== 3.11 Notation Declarations
|
|
356
|
+
- Properties: name, target namespace, public/system identifiers, annotation
|
|
357
|
+
- XML Representation: <notation>
|
|
358
|
+
- Constraints: identifier rules
|
|
359
|
+
- Validation: notation validity
|
|
360
|
+
|
|
361
|
+
.Example: Notation Declaration
|
|
362
|
+
[source,xml]
|
|
363
|
+
----
|
|
364
|
+
<xs:notation name="gif" public="image/gif" system="viewer.exe"/>
|
|
365
|
+
----
|
|
366
|
+
|
|
367
|
+
=== 3.12 Annotations
|
|
368
|
+
- Properties: documentation, appinfo
|
|
369
|
+
- XML Representation: <annotation>, <documentation>, <appinfo>
|
|
370
|
+
- Constraints: location and content rules
|
|
371
|
+
|
|
372
|
+
.Example: Annotation
|
|
373
|
+
[source,xml]
|
|
374
|
+
----
|
|
375
|
+
<xs:element name="price" type="xs:decimal">
|
|
376
|
+
<xs:annotation>
|
|
377
|
+
<xs:documentation>Price of the product in USD</xs:documentation>
|
|
378
|
+
<xs:appinfo>
|
|
379
|
+
<info>Internal use only</info>
|
|
380
|
+
</xs:appinfo>
|
|
381
|
+
</xs:annotation>
|
|
382
|
+
</xs:element>
|
|
383
|
+
----
|
|
384
|
+
|
|
385
|
+
=== 3.13 Schemas as a Whole
|
|
386
|
+
- Properties: type definitions, attribute/element declarations, attribute/model group definitions, notation declarations, annotations
|
|
387
|
+
- XML Representation: <schema>
|
|
388
|
+
- Constraints: uniqueness of names, target namespace, inclusion/import/redefine rules
|
|
389
|
+
|
|
390
|
+
.Example: Complete Schema Structure
|
|
391
|
+
[source,xml]
|
|
392
|
+
----
|
|
393
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.com" elementFormDefault="qualified">
|
|
394
|
+
<xs:element name="product" type="xs:string"/>
|
|
395
|
+
<xs:attributeGroup name="meta">
|
|
396
|
+
<xs:attribute name="created" type="xs:date"/>
|
|
397
|
+
</xs:attributeGroup>
|
|
398
|
+
</xs:schema>
|
|
399
|
+
----
|
|
400
|
+
|
|
401
|
+
== 4. Schemas and Namespaces: Access and Composition
|
|
402
|
+
|
|
403
|
+
=== 4.1 Layer 1: Assessment Core
|
|
404
|
+
- Relates schema components and instance items
|
|
405
|
+
- Requires complete schema for assessment
|
|
406
|
+
- Invariants: no changes after establishment, dynamic acquisition must not affect results
|
|
407
|
+
|
|
408
|
+
=== 4.2 Layer 2: Schema Documents, Namespaces, Composition
|
|
409
|
+
- Assembling schemas from multiple documents
|
|
410
|
+
- <include>, <import>, <redefine> mechanisms
|
|
411
|
+
- Target namespace rules
|
|
412
|
+
- XML representation mapping
|
|
413
|
+
|
|
414
|
+
=== 4.3 Layer 3: Web Interoperability
|
|
415
|
+
- Schema documents as Web resources (URI retrieval)
|
|
416
|
+
- Schema location strategies (xsi:schemaLocation, xsi:noNamespaceSchemaLocation)
|
|
417
|
+
- Namespace declarations and dereferencing
|
|
418
|
+
|
|
419
|
+
== 5. Schema-validity Assessment
|
|
420
|
+
|
|
421
|
+
=== 5.1 Errors in Schema Construction and Structure
|
|
422
|
+
- Schema must satisfy all component constraints
|
|
423
|
+
- Schema documents must be valid per Schema for Schemas
|
|
424
|
+
- Representation constraints must be met
|
|
425
|
+
|
|
426
|
+
=== 5.2 Assessment Strategies
|
|
427
|
+
- User/application identifies type or element declaration
|
|
428
|
+
- Assessment via schema-validity rules
|
|
429
|
+
- Outcome: validation attempted, validity properties
|
|
430
|
+
|
|
431
|
+
=== 5.3 Responsibilities of Schema-aware Processors
|
|
432
|
+
- Process XML documents, schemas, and schema documents per conformance level
|
|
433
|
+
- Implement assessment core, XML representation, and Web interoperability
|
|
434
|
+
|
|
435
|
+
== 6. Normative Appendices
|
|
436
|
+
|
|
437
|
+
=== A. Schema for Schemas
|
|
438
|
+
- Normative XML representation of the schema language itself
|
|
439
|
+
- <schema> element, DTD, and type library
|
|
440
|
+
|
|
441
|
+
=== B. References
|
|
442
|
+
- XML 1.0, XML Namespaces, XML Infoset, XPath, XML Schema Part 2: Datatypes, XML Schema Requirements, XML Schema Primer
|
|
443
|
+
|
|
444
|
+
=== C. Schema Representation Constraints
|
|
445
|
+
- src-annotation, src-attribute, src-attribute_group, src-ct, src-element, src-expredef, src-identity-constraint, src-import, src-include, src-list-itemType-or-simpleType, src-model_group, src-model_group_defn, totalDigits-valid-restriction, w-props-correct, whiteSpace-valid-restriction
|
|
446
|
+
|
|
447
|
+
=== D. Required Infoset Items and Properties
|
|
448
|
+
- Element, attribute, namespace, document, ID/IDREF, identity-constraint, schema information, schema document properties
|
|
449
|
+
|
|
450
|
+
=== E. Schema Components Diagram
|
|
451
|
+
- Visual diagram of schema components and relationships
|
|
452
|
+
|
|
453
|
+
=== F. Glossary
|
|
454
|
+
- Definitions of key terms: extension, final, fully conforming, symbol space, target namespace, type definition, validation root, PSVI, etc.
|
|
455
|
+
|
|
456
|
+
=== G. DTD for Schemas
|
|
457
|
+
- Non-normative DTD for authoring schema documents
|
|
458
|
+
|
|
459
|
+
== 7. Implementation Checklist
|
|
460
|
+
|
|
461
|
+
- [ ] Implement all schema component types and their properties
|
|
462
|
+
- [ ] Support XML representation and mapping for all components
|
|
463
|
+
- [ ] Enforce all schema component, representation, and validation constraints
|
|
464
|
+
- [ ] Support PSVI augmentation
|
|
465
|
+
- [ ] Implement conformance levels (minimal, XML representation, full)
|
|
466
|
+
- [ ] Support schema location and namespace rules
|
|
467
|
+
- [ ] Implement <include>, <import>, <redefine> mechanisms
|
|
468
|
+
- [ ] Support identity-constraint validation
|
|
469
|
+
- [ ] Support annotation/documentation/appinfo
|
|
470
|
+
- [ ] Validate schema documents against Schema for Schemas
|
|
471
|
+
- [ ] Support DTD-based authoring and validation
|
|
472
|
+
- [ ] Provide error handling for schema construction and validation
|
|
473
|
+
- [ ] Document supported features and conformance level
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
This document provides a complete implementation reference for XML Schema Part 1: Structures, including all requirements, constraints, and processing rules from the W3C Recommendation. For datatype definitions, see XML Schema Part 2: Datatypes.
|
|
478
|
+
|
|
479
|
+
== Implementation Status in lutaml-model
|
|
480
|
+
|
|
481
|
+
[cols="1,1,1", options="header"]
|
|
482
|
+
|===
|
|
483
|
+
| Feature/Requirement | Status | Notes
|
|
484
|
+
|
|
485
|
+
| Implement all schema component types and their properties | Partially implemented | Basic support for simple/complex types, elements, attributes; some advanced components (identity-constraint, notation, annotation) not fully supported
|
|
486
|
+
| Support XML representation and mapping for all components | Partially implemented | XSD import/export supported for basic types; advanced mapping (groups, wildcards, annotation) limited
|
|
487
|
+
| Enforce all schema component, representation, and validation constraints | Partially implemented | Some constraints (type, pattern, required, min/max) enforced; others (unique, circularity, substitution, identity-constraint) not fully enforced
|
|
488
|
+
| Support PSVI augmentation | Not implemented | No explicit PSVI support
|
|
489
|
+
| Implement conformance levels (minimal, XML representation, full) | Not implemented | No conformance level selection or documentation
|
|
490
|
+
| Support schema location and namespace rules | Partially implemented | Basic support for schemaLocation, namespaces; advanced rules (import/include/redefine) limited
|
|
491
|
+
| Implement <include>, <import>, <redefine> mechanisms | Partially implemented | Basic import supported; include/redefine not fully supported
|
|
492
|
+
| Support identity-constraint validation | Not implemented | No key/unique/keyref validation
|
|
493
|
+
| Support annotation/documentation/appinfo | Not implemented | No annotation/appinfo mapping or processing
|
|
494
|
+
| Validate schema documents against Schema for Schemas | Not implemented | No meta-schema validation
|
|
495
|
+
| Support DTD-based authoring and validation | Not implemented | No DTD authoring/validation
|
|
496
|
+
| Provide error handling for schema construction and validation | Partially implemented | Basic error handling for invalid attributes/types; limited schema-level error reporting
|
|
497
|
+
| Document supported features and conformance level | Not implemented | No documentation of supported features/conformance
|
|
498
|
+
|===
|
|
499
|
+
|
|
500
|
+
*Summary*: lutaml-model provides partial support for XML Schema (XSD) import/export, basic type/element/attribute mapping, and some validation constraints. Advanced features (identity-constraint, annotation, PSVI, meta-schema validation, DTD, conformance levels) are not implemented as of this review.
|