Project

Profile

Help

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

he / tags / 9.7.0.3 / hej / data / w3c / xslt3 / xslt30.xsd @ cb770b3c

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--* <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200105//EN"
3
       "http://www.w3.org/2001/XMLSchema.dtd" [
4
<!ENTITY % schemaAttrs "
5
  xmlns:xs   CDATA #IMPLIED
6
  xmlns:xsl  CDATA #IMPLIED
7
  xmlns:xsd  CDATA #IMPLIED"
8
>
9
<!ENTITY % p "xs:">
10
<!ENTITY % s ":xs">
11
]> *-->
12

    
13
<?xml-stylesheet href="http://www.w3.org/2008/09/xsd.xsl" type="text/xsl"?> 
14
<!--* <?xml-stylesheet href="http://www.w3.org/2008/09/xsd.xsl" type="application/xslt+xml"?>  *-->
15
<!--* <?xml-stylesheet href="../../../www.w3.org/2008/09/xsd.xsl" type="application/xslt+xml"?> *-->
16

    
17
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
18
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19
  targetNamespace="http://www.w3.org/1999/XSL/Transform" elementFormDefault="qualified">
20

    
21
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
22
  <xs:annotation>
23
    <xs:documentation>
24
      <p>This is an XSD 1.1 schema for XSLT 3.0 stylesheets.
25
      It defines all the elements that appear in the XSLT namespace; it also provides hooks that
26
      allow the inclusion of user-defined literal result elements, extension instructions, and
27
      top-level data elements.</p>
28
      
29
      <p>This schema is available for use under the conditions of the W3C
30
      Software License published at http://www.w3.org/Consortium/Legal/copyright-software-19980720</p>
31
      
32
      <p>The schema is organized as follows:</p>
33
      <ul>
34
         <li>PART A: definitions of complex types and model groups used
35
         as the basis for element definitions</li>
36
         <li>PART B: definitions of individual XSLT elements</li> 
37
         <li>PART C: definitions for literal result elements</li> 
38
         <li>PART D: definitions of simple types used in attribute definitions</li>
39
      </ul>
40
      
41
      <p>The schema has a number of limitations:</p>
42
      <ul>
43
        <li>The XSLT specification allows additional elements and attributes to be present
44
        where forwards compatibility is invoked. This schema does not.</li>
45
        <li>The XSLT specification allows arbitrary content in a part of the stylesheet
46
        that is excluded by virtue of a use-when attribute. This schema does not.</li>
47
        <li>The handling of literal result elements in this schema is imperfect; although
48
        various options are allowed, none matches the specification exactly. For example,
49
        the content of a literal result element uses lax validation, which permits child
50
        elements in the XSLT namespace that have no declaration in this schema.</li>
51
        <li>The schema makes no attempt to check XPath expressions for syntactic or
52
        semantic correctness, nor to check that component references are resolved (for example
53
        that a template named in xsl:call-template has a declaration). Doing this in general
54
        requires cross-document validation, which is beyond the scope of XSD.</li>
55
        <li>The schema imports the schema for XSD 1.0 schema documents. In stylesheets that contain
56
        an inline XSD 1.1 schema, this import should be replaced with one for the schema for XSD 1.1
57
        schema documents.</li>
58
       </ul>
59
    </xs:documentation>
60
  </xs:annotation>
61
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
62

    
63
  <!--
64
The declaration of xml:space and xml:lang may need to be commented out because
65
of problems processing the schema using various tools
66
-->
67

    
68
  <xs:import namespace="http://www.w3.org/XML/1998/namespace"/>
69
  <!--schemaLocation="http://www.w3.org/2001/xml.xsd"-->
70

    
71
  <!-- 
72
    An XSLT stylesheet may contain an in-line schema within an xsl:import-schema element,
73
    so the Schema for schemas needs to be imported
74
-->
75

    
76
  <xs:import namespace="http://www.w3.org/2001/XMLSchema"
77
    schemaLocation="http://www.w3.org/2001/XMLSchema.xsd"/>
78

    
79
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
80
  <xs:annotation>
81
    <xs:documentation> PART A: definitions of complex types and model groups used as the basis for
82
      element definitions </xs:documentation>
83
  </xs:annotation>
84
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
85

    
86
  <xs:complexType name="generic-element-type" mixed="true">
87
    <xs:annotation>
88
        <xs:documentation>
89
            <p>This complex type provides a generic supertype for all XSLT elements; it contains the
90
                definitions of the standard attributes that may appear on any element.</p>    
91
        </xs:documentation>
92
    </xs:annotation>
93
    <xs:attribute name="default-collation" type="xsl:uri-list"/>
94
    <xs:attribute name="default-mode" type="xsl:default-mode-type"/>
95
    <xs:attribute name="default-validation" type="xsl:validation-strip-or-preserve" default="strip"/>
96
    <xs:attribute name="exclude-result-prefixes" type="xsl:prefix-list-or-all"/>
97
    <xs:attribute name="expand-text" type="xsl:yes-or-no"/>
98
    <xs:attribute name="extension-element-prefixes" type="xsl:prefix-list"/>
99
    <xs:attribute name="use-when" type="xsl:expression"/>
100
    <xs:attribute name="xpath-default-namespace" type="xs:anyURI"/>
101
    <xs:attribute name="_default-collation" type="xs:string"/>
102
    <xs:attribute name="_default-mode" type="xs:string"/>
103
    <xs:attribute name="_default-validation" type="xs:string"/>
104
    <xs:attribute name="_exclude-result-prefixes" type="xs:string"/>
105
    <xs:attribute name="_expand-text" type="xs:string"/>
106
    <xs:attribute name="_extension-element-prefixes" type="xs:string"/>
107
    <xs:attribute name="_use-when" type="xs:string"/>
108
    <xs:attribute name="_xpath-default-namespace" type="xs:string"/>
109
    <xs:anyAttribute namespace="##other" processContents="lax"/>
110
  </xs:complexType>
111

    
112
  <xs:complexType name="versioned-element-type" mixed="true">
113
    <xs:annotation>
114
        <xs:documentation>
115
            <p>This complex type provides a generic supertype for all XSLT elements with
116
                the exception of <code>xsl:output</code>; it contains the
117
                definitions of the <code>version</code> attribute that may appear on any element.
118
                </p>
119
             <p>The <code>xsl:output</code> does not use this definition because, although it
120
             has a <code>version</code> attribute, the syntax and semantics of this attribute are
121
             unrelated to the standard <code>version</code> attribute allowed on other elements.</p>    
122
        </xs:documentation>
123
    </xs:annotation>
124
    <xs:complexContent>
125
      <xs:extension base="xsl:generic-element-type">
126
        <xs:attribute name="version" type="xs:decimal" use="optional"/>
127
        <xs:attribute name="_version" type="xs:string"/>
128
      </xs:extension>
129
    </xs:complexContent>
130
  </xs:complexType>
131

    
132
  <xs:complexType name="element-only-versioned-element-type" mixed="false">
133
    <xs:complexContent>
134
      <xs:restriction base="xsl:versioned-element-type">
135
        <xs:anyAttribute namespace="##other" processContents="lax"/>
136
      </xs:restriction>
137
    </xs:complexContent>
138
  </xs:complexType>
139

    
140
  <xs:complexType name="sequence-constructor">
141
    <xs:annotation>
142
        <xs:documentation>
143
            <p>This complex type provides a generic supertype for all XSLT elements that
144
                allow a sequence constructor as their content.
145
                </p>
146
        </xs:documentation>
147
    </xs:annotation>
148
    <xs:complexContent mixed="true">
149
      <xs:extension base="xsl:versioned-element-type">
150
        <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
151
      </xs:extension>
152
    </xs:complexContent>
153
  </xs:complexType>
154
  
155
  <xs:complexType name="sequence-constructor-and-select">
156
    <xs:annotation>
157
      <xs:documentation>
158
        <p>This complex type allows a sequence constructor and a select attribute.</p>
159
      </xs:documentation>
160
    </xs:annotation>
161
    <xs:complexContent mixed="true">
162
      <xs:extension base="xsl:sequence-constructor">
163
        <xs:attribute name="select" type="xsl:expression"/>
164
        <xs:attribute name="_select" type="xs:string"/>
165
      </xs:extension>
166
    </xs:complexContent>
167
  </xs:complexType>
168
  
169
  <xs:complexType name="sequence-constructor-or-select">
170
    <xs:annotation>
171
      <xs:documentation>
172
        <p>This complex type allows a sequence constructor or a select attribute, but not both.</p>
173
      </xs:documentation>
174
    </xs:annotation>
175
    <xs:complexContent mixed="true">
176
      <xs:restriction base="xsl:sequence-constructor-and-select">
177
        <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
178
        <xs:anyAttribute namespace="##other" processContents="lax"/>
179
        <xs:assert test="not(exists(@select) and (exists(* except xsl:fallback) or exists(text()[normalize-space()])))"/>
180
      </xs:restriction>
181
    </xs:complexContent>
182
  </xs:complexType>
183

    
184
  <xs:group name="sequence-constructor-group">
185
    <xs:annotation>
186
        <xs:documentation>
187
            <p>This complex type provides a generic supertype for all XSLT elements that
188
                allow a sequence constructor as their content.
189
                </p>
190
        </xs:documentation>
191
    </xs:annotation>
192
    <xs:choice>
193
      <xs:element ref="xsl:instruction"/>
194
      <xs:group ref="xsl:result-elements"/>
195
    </xs:choice>
196
  </xs:group>
197

    
198
  <xs:element name="declaration" type="xsl:generic-element-type" abstract="true"/>
199

    
200
  <xs:element name="instruction" type="xsl:versioned-element-type" abstract="true"/>
201

    
202
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
203
  <xs:annotation>
204
    <xs:documentation> 
205
      PART B: definitions of individual XSLT elements 
206
      Elements are listed in alphabetical order. 
207
    </xs:documentation>
208
  </xs:annotation>
209
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
210
  
211
  <xs:element name="accept">
212
    <xs:annotation>
213
        <xs:documentation>
214
            <p>This element appears as a child of <code>xsl:use-package</code> and defines 
215
            any variations that the containing package wishes to make to the visibility of
216
            components made available from a library package. For example, it may indicate that
217
            some of the public components in the library package are not to be made available
218
            to the containing package.</p>
219
        </xs:documentation>
220
    </xs:annotation>
221
    <xs:complexType>
222
      <xs:complexContent>
223
        <xs:extension base="xsl:element-only-versioned-element-type">
224
          <xs:attribute name="component" type="xsl:component-kind-type"/>
225
          <xs:attribute name="names" type="xsl:EQNames"/>
226
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
227
          <xs:attribute name="_component" type="xs:string"/>
228
          <xs:attribute name="_names" type="xs:string"/>
229
          <xs:attribute name="_visibility" type="xs:string"/>
230
          <xs:assert test="exists(@component | @_component)"/>
231
          <xs:assert test="exists(@names | @_names)"/>
232
          <xs:assert test="exists(@visibility | @_visibility)"/>
233
        </xs:extension>
234
      </xs:complexContent>
235
    </xs:complexType>
236
  </xs:element>
237
  
238
  <xs:element name="accumulator" substitutionGroup="xsl:declaration">
239
    <xs:complexType>
240
      <xs:complexContent>
241
        <xs:extension base="xsl:element-only-versioned-element-type">
242
          <xs:sequence>
243
            <xs:element ref="xsl:accumulator-rule" minOccurs="1"  maxOccurs="unbounded"/>
244
          </xs:sequence>
245
          <xs:attribute name="name" type="xsl:EQName" />
246
          <xs:attribute name="applies-to" type="xsl:pattern"/>
247
          <xs:attribute name="initial-value" type="xsl:expression"/>
248
          <xs:attribute name="as" type="xsl:sequence-type"/>
249
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
250
          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
251
          <xs:attribute name="_name" type="xs:string" />
252
          <xs:attribute name="_applies-to" type="xs:string"/> 
253
          <xs:attribute name="_initial-value" type="xs:string"/>
254
          <xs:attribute name="_as" type="xs:string"/>
255
          <xs:attribute name="_visibility" type="xs:string"/>
256
          <xs:attribute name="_streamable" type="xs:string"/>
257
        </xs:extension>
258
      </xs:complexContent>
259
    </xs:complexType>
260
  </xs:element>
261

    
262
  <xs:element name="accumulator-rule">
263
    <xs:complexType>
264
      <xs:complexContent mixed="true">
265
        <xs:extension base="xsl:sequence-constructor-or-select">
266
          <xs:sequence/>
267
          <xs:attribute name="match" type="xsl:pattern"/>
268
          <xs:attribute name="phase">
269
            <xs:simpleType>
270
              <xs:restriction base="xs:token">
271
                <xs:enumeration value="start"/>
272
                <xs:enumeration value="end"/>
273
              </xs:restriction>           
274
            </xs:simpleType>
275
          </xs:attribute>
276
          <xs:attribute name="_match" type="xs:string"/>
277
          <xs:attribute name="_phase" type="xs:string"/>
278
          <xs:assert test="exists(@match | @_match)"/>
279
        </xs:extension>
280
      </xs:complexContent>
281
    </xs:complexType>
282
  </xs:element>
283

    
284
  <xs:element name="analyze-string" substitutionGroup="xsl:instruction">
285
    <xs:complexType>
286
      <xs:complexContent>
287
        <xs:extension base="xsl:element-only-versioned-element-type">
288
          <xs:sequence>
289
            <xs:element ref="xsl:matching-substring" minOccurs="0"/>
290
            <xs:element ref="xsl:non-matching-substring" minOccurs="0"/>
291
            <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
292
          </xs:sequence>
293
          <xs:attribute name="select" type="xsl:expression"/>
294
          <xs:attribute name="regex" type="xsl:avt"/>
295
          <xs:attribute name="flags" type="xsl:avt" default=""/>
296
          <xs:attribute name="_select" type="xs:string"/>
297
          <xs:attribute name="_regex" type="xs:string"/>
298
          <xs:attribute name="_flags" type="xs:string"/>
299
          <xs:assert test="exists(@select | @_select)"/>
300
          <xs:assert test="exists(@regex | @_regex)"/>
301
        </xs:extension>
302
      </xs:complexContent>
303
    </xs:complexType>
304
  </xs:element>
305

    
306
  <xs:element name="apply-imports" substitutionGroup="xsl:instruction">
307
    <xs:complexType>
308
      <xs:complexContent>
309
        <xs:extension base="xsl:element-only-versioned-element-type">
310
          <xs:sequence>
311
            <xs:element ref="xsl:with-param" minOccurs="0" maxOccurs="unbounded"/>
312
          </xs:sequence>
313
        </xs:extension>
314
      </xs:complexContent>
315
    </xs:complexType>
316
  </xs:element>
317

    
318
  <xs:element name="apply-templates" substitutionGroup="xsl:instruction">
319
    <xs:complexType>
320
      <xs:complexContent>
321
        <xs:extension base="xsl:element-only-versioned-element-type">
322
          <xs:choice minOccurs="0" maxOccurs="unbounded">
323
            <xs:element ref="xsl:sort"/>
324
            <xs:element ref="xsl:with-param"/>
325
          </xs:choice>
326
          <xs:attribute name="select" type="xsl:expression" default="child::node()"/>
327
          <xs:attribute name="mode" type="xsl:mode"/>
328
          <xs:attribute name="_select" type="xs:string"/>
329
          <xs:attribute name="_mode" type="xs:string"/>
330
          <xs:assert test="every $e in subsequence(xsl:sort, 2) satisfies empty($e/@stable)">
331
            <xs:annotation>
332
              <xs:documentation>
333
                <p>It is a static error if an xsl:sort element other than the first in a 
334
                  sequence of sibling xsl:sort elements has a stable attribute.
335
                </p>
336
              </xs:documentation>
337
            </xs:annotation>
338
          </xs:assert>
339
        </xs:extension>
340
      </xs:complexContent>
341
    </xs:complexType>
342
  </xs:element>
343
  
344
  <xs:element name="assert" substitutionGroup="xsl:instruction">
345
    <xs:complexType>
346
      <xs:complexContent mixed="true">
347
        <xs:extension base="xsl:sequence-constructor">
348
          <xs:attribute name="test" type="xsl:expression"/>
349
          <xs:attribute name="select" type="xsl:expression"/>
350
          <xs:attribute name="error-code" type="xsl:avt"/>
351
          <xs:attribute name="_test" type="xs:string"/>
352
          <xs:attribute name="_select" type="xs:string"/>
353
          <xs:attribute name="_error-code" type="xs:string"/>
354
          <xs:assert test="exists(@test | @_test)"/>
355
        </xs:extension>
356
      </xs:complexContent>
357
    </xs:complexType>
358
  </xs:element>
359

    
360
  <xs:element name="attribute" substitutionGroup="xsl:instruction">
361
    <xs:complexType>
362
      <xs:complexContent mixed="true">
363
        <xs:extension base="xsl:sequence-constructor-or-select">
364
          <xs:attribute name="name" type="xsl:avt"/>
365
          <xs:attribute name="namespace" type="xsl:avt"/>
366
          <xs:attribute name="separator" type="xsl:avt"/>
367
          <xs:attribute name="type" type="xsl:EQName"/>
368
          <xs:attribute name="validation" type="xsl:validation-type"/>
369
          <xs:attribute name="_name" type="xs:string"/>
370
          <xs:attribute name="_namespace" type="xs:string"/>
371
          <xs:attribute name="_separator" type="xs:string"/>
372
          <xs:attribute name="_type" type="xs:string"/>
373
          <xs:attribute name="_validation" type="xs:string"/>
374
          <xs:assert test="not(exists(@type) and exists(@validation))">
375
            <xs:annotation>
376
              <xs:documentation>
377
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
378
                (if one is present, the other must be absent).</p>
379
              </xs:documentation>
380
            </xs:annotation>
381
          </xs:assert>
382
          <xs:assert test="exists(@name | @_name)"/>
383
        </xs:extension>
384
      </xs:complexContent>
385
    </xs:complexType>
386
  </xs:element>
387

    
388
  <xs:element name="attribute-set" substitutionGroup="xsl:declaration">
389
    <xs:complexType>
390
      <xs:complexContent>
391
        <xs:extension base="xsl:element-only-versioned-element-type">
392
          <xs:sequence minOccurs="0" maxOccurs="unbounded">
393
            <xs:element ref="xsl:attribute"/>
394
          </xs:sequence>
395
          <xs:attribute name="name" type="xsl:EQName"/>
396
          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
397
          <xs:attribute name="use-attribute-sets" type="xsl:EQNames" default=""/>
398
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
399
          <xs:attribute name="_name" type="xs:string"/>
400
          <xs:attribute name="_streamable" type="xs:string"/>
401
          <xs:attribute name="_use-attribute-sets" type="xs:string"/>
402
          <xs:attribute name="_visibility" type="xs:string"/>
403
          <xs:assert test="exists(@name | @_name)"/>
404
        </xs:extension>
405
      </xs:complexContent>
406
    </xs:complexType>
407
  </xs:element>
408

    
409
  <xs:element name="break" substitutionGroup="xsl:instruction" type="xsl:sequence-constructor-or-select"/>
410

    
411
  <xs:element name="call-template" substitutionGroup="xsl:instruction">
412
    <xs:complexType>
413
      <xs:complexContent>
414
        <xs:extension base="xsl:element-only-versioned-element-type">
415
          <xs:sequence>
416
            <xs:element ref="xsl:with-param" minOccurs="0" maxOccurs="unbounded"/>
417
          </xs:sequence>
418
          <xs:attribute name="name" type="xsl:EQName"/>
419
          <xs:attribute name="_name" type="xs:string"/>
420
          <xs:assert test="exists(@name | @_name)"/>
421
        </xs:extension>
422
      </xs:complexContent>
423
    </xs:complexType>
424
  </xs:element>
425

    
426
  <xs:element name="catch">
427
    <xs:complexType>
428
      <xs:complexContent mixed="true">
429
        <xs:extension base="xsl:sequence-constructor-or-select">
430
          <xs:attribute name="errors" type="xs:token" use="optional"/>
431
          <xs:attribute name="_errors" type="xs:string"/>
432
        </xs:extension>
433
      </xs:complexContent>
434
    </xs:complexType>
435
  </xs:element>
436

    
437
  <xs:element name="character-map" substitutionGroup="xsl:declaration">
438
    <xs:complexType>
439
      <xs:complexContent>
440
        <xs:extension base="xsl:element-only-versioned-element-type">
441
          <xs:sequence>
442
            <xs:element ref="xsl:output-character" minOccurs="0" maxOccurs="unbounded"/>
443
          </xs:sequence>
444
          <xs:attribute name="name" type="xsl:EQName"/>
445
          <xs:attribute name="use-character-maps" type="xsl:EQNames" default=""/>
446
          <xs:attribute name="_name" type="xs:string"/>
447
          <xs:attribute name="_use-character-maps" type="xs:string"/>
448
          <xs:assert test="exists(@name | @_name)"/>
449
        </xs:extension>
450
      </xs:complexContent>
451
    </xs:complexType>
452
  </xs:element>
453

    
454
  <xs:element name="choose" substitutionGroup="xsl:instruction">
455
    <xs:complexType>
456
      <xs:complexContent>
457
        <xs:extension base="xsl:element-only-versioned-element-type">
458
          <xs:sequence>
459
            <xs:element ref="xsl:when" maxOccurs="unbounded"/>
460
            <xs:element ref="xsl:otherwise" minOccurs="0"/>
461
          </xs:sequence>
462
        </xs:extension>
463
      </xs:complexContent>
464
    </xs:complexType>
465
  </xs:element>
466

    
467
  <xs:element name="comment" substitutionGroup="xsl:instruction" type="xsl:sequence-constructor-or-select"/>
468

    
469
  <xs:element name="context-item">
470
    <xs:complexType>
471
      <xs:complexContent>
472
        <xs:extension base="xsl:element-only-versioned-element-type">
473
          <xs:attribute name="as" type="xsl:item-type"/>
474
          <xs:attribute name="use">
475
            <xs:simpleType>
476
              <xs:restriction base="xs:token">
477
                <xs:enumeration value="required"/>
478
                <xs:enumeration value="optional"/>
479
                <xs:enumeration value="prohibited"/>
480
              </xs:restriction>
481
            </xs:simpleType>
482
          </xs:attribute>
483
          <xs:attribute name="_as" type="xs:string"/>
484
          <xs:attribute name="_use" type="xs:string"/>
485
        </xs:extension>
486
      </xs:complexContent>
487
    </xs:complexType>
488
  </xs:element>
489

    
490
  <xs:element name="copy" substitutionGroup="xsl:instruction">
491
    <xs:complexType>
492
      <xs:complexContent mixed="true">
493
        <xs:extension base="xsl:sequence-constructor">
494
          <xs:attribute name="select" type="xsl:expression"/>
495
          <xs:attribute name="copy-namespaces" type="xsl:yes-or-no" default="yes"/>
496
          <xs:attribute name="inherit-namespaces" type="xsl:yes-or-no" default="yes"/>
497
          <xs:attribute name="use-attribute-sets" type="xsl:EQNames" default=""/>
498
          <xs:attribute name="type" type="xsl:EQName"/>
499
          <xs:attribute name="validation" type="xsl:validation-type"/>
500
          <xs:attribute name="on-empty" type="xsl:expression"/>
501
          <xs:attribute name="_select" type="xs:string"/>
502
          <xs:attribute name="_copy-namespaces" type="xs:string"/>
503
          <xs:attribute name="_inherit-namespaces" type="xs:string"/>
504
          <xs:attribute name="_use-attribute-sets" type="xs:string"/>
505
          <xs:attribute name="_type" type="xs:string"/>
506
          <xs:attribute name="_validation" type="xs:string"/>
507
          <xs:attribute name="_on-empty" type="xs:string"/>
508
          <xs:assert test="not(exists(@type) and exists(@validation))">
509
            <xs:annotation>
510
              <xs:documentation>
511
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
512
                  (if one is present, the other must be absent).</p>
513
              </xs:documentation>
514
            </xs:annotation>
515
          </xs:assert>
516
        </xs:extension>
517
      </xs:complexContent>
518
    </xs:complexType>
519
  </xs:element>
520

    
521
  <xs:element name="copy-of" substitutionGroup="xsl:instruction">
522
    <xs:complexType>
523
      <xs:complexContent mixed="true">
524
        <xs:extension base="xsl:versioned-element-type">
525
          <xs:attribute name="select" type="xsl:expression"/>
526
          <xs:attribute name="copy-namespaces" type="xsl:yes-or-no" default="yes"/>
527
          <xs:attribute name="type" type="xsl:EQName"/>
528
          <xs:attribute name="validation" type="xsl:validation-type"/>
529
          <xs:attribute name="_select" type="xs:string"/>
530
          <xs:attribute name="_copy-namespaces" type="xs:string"/>
531
          <xs:attribute name="_type" type="xs:string"/>
532
          <xs:attribute name="_validation" type="xs:string"/>
533
          <xs:assert test="not(exists(@type) and exists(@validation))">
534
            <xs:annotation>
535
              <xs:documentation>
536
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
537
                  (if one is present, the other must be absent).</p>
538
              </xs:documentation>
539
            </xs:annotation>
540
          </xs:assert>
541
          <xs:assert test="exists(@select | @_select)"/>
542
        </xs:extension>
543
      </xs:complexContent>
544
    </xs:complexType>
545
  </xs:element>
546

    
547
  <xs:element name="document" substitutionGroup="xsl:instruction">
548
    <xs:complexType>
549
      <xs:complexContent mixed="true">
550
        <xs:extension base="xsl:sequence-constructor">
551
          <xs:attribute name="type" type="xsl:EQName"/>
552
          <xs:attribute name="validation" type="xsl:validation-type"/>
553
          <xs:attribute name="_type" type="xs:string"/>
554
          <xs:attribute name="_validation" type="xs:string"/>
555
          <xs:assert test="not(exists(@type) and exists(@validation))">
556
            <xs:annotation>
557
              <xs:documentation>
558
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
559
                  (if one is present, the other must be absent).</p>
560
              </xs:documentation>
561
            </xs:annotation>
562
          </xs:assert>
563
        </xs:extension>
564
      </xs:complexContent>
565
    </xs:complexType>
566
  </xs:element>
567

    
568
  <xs:element name="decimal-format" substitutionGroup="xsl:declaration">
569
    <xs:complexType>
570
      <xs:complexContent>
571
        <xs:extension base="xsl:element-only-versioned-element-type">
572
          <xs:attribute name="name" type="xsl:EQName"/>
573
          <xs:attribute name="decimal-separator" type="xsl:char" default="."/>
574
          <xs:attribute name="grouping-separator" type="xsl:char" default=","/>
575
          <xs:attribute name="infinity" type="xs:string" default="Infinity"/>
576
          <xs:attribute name="minus-sign" type="xsl:char" default="-"/>
577
          <xs:attribute name="exponent-separator" type="xsl:char" default="e"/>
578
          <xs:attribute name="NaN" type="xs:string" default="NaN"/>
579
          <xs:attribute name="percent" type="xsl:char" default="%"/>
580
          <xs:attribute name="per-mille" type="xsl:char" default="~"/>
581
          <xs:attribute name="zero-digit" type="xsl:zero-digit" default="0"/>
582
          <xs:attribute name="digit" type="xsl:char" default="#"/>
583
          <xs:attribute name="pattern-separator" type="xsl:char" default=";"/>
584
          <xs:attribute name="_name" type="xs:string"/>
585
          <xs:attribute name="_decimal-separator" type="xs:string"/>
586
          <xs:attribute name="_grouping-separator" type="xs:string"/>
587
          <xs:attribute name="_infinity" type="xs:string"/>
588
          <xs:attribute name="_minus-sign" type="xs:string"/>
589
          <xs:attribute name="_exponent-separator" type="xs:string"/>
590
          <xs:attribute name="_NaN" type="xs:string"/>
591
          <xs:attribute name="_percent" type="xs:string"/>
592
          <xs:attribute name="_per-mille" type="xs:string"/>
593
          <xs:attribute name="_zero-digit" type="xs:string"/>
594
          <xs:attribute name="_digit" type="xs:string"/>
595
          <xs:attribute name="_pattern-separator" type="xs:string"/>
596
        </xs:extension>
597
      </xs:complexContent>
598
    </xs:complexType>
599
  </xs:element>
600

    
601
  <xs:element name="element" substitutionGroup="xsl:instruction">
602
    <xs:complexType mixed="true">
603
      <xs:complexContent>
604
        <xs:extension base="xsl:sequence-constructor">
605
          <xs:attribute name="name" type="xsl:avt"/>
606
          <xs:attribute name="namespace" type="xsl:avt"/>
607
          <xs:attribute name="inherit-namespaces" type="xsl:yes-or-no" default="yes"/>
608
          <xs:attribute name="use-attribute-sets" type="xsl:EQNames" default=""/>
609
          <xs:attribute name="type" type="xsl:EQName"/>
610
          <xs:attribute name="validation" type="xsl:validation-type"/>
611
          <xs:attribute name="on-empty" type="xsl:expression"/>
612
          <xs:attribute name="_name" type="xs:string"/>
613
          <xs:attribute name="_namespace" type="xs:string"/>
614
          <xs:attribute name="_inherit-namespaces" type="xs:string"/>
615
          <xs:attribute name="_use-attribute-sets" type="xs:string"/>
616
          <xs:attribute name="_type" type="xs:string"/>
617
          <xs:attribute name="_validation" type="xs:string"/>
618
          <xs:attribute name="_on-empty" type="xs:string"/>
619
          <xs:assert test="exists(@name | @_name)"/>
620
          <xs:assert test="not(exists(@type) and exists(@validation))">
621
            <xs:annotation>
622
              <xs:documentation>
623
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
624
                  (if one is present, the other must be absent).</p>
625
              </xs:documentation>
626
            </xs:annotation>
627
          </xs:assert>
628
        </xs:extension>
629
      </xs:complexContent>
630
    </xs:complexType>
631
  </xs:element>
632

    
633
  <xs:element name="evaluate" substitutionGroup="xsl:instruction">
634
    <xs:complexType>
635
      <xs:complexContent mixed="true">
636
        <xs:extension base="xsl:element-only-versioned-element-type">
637
          <xs:choice minOccurs="0" maxOccurs="unbounded">
638
            <xs:element ref="xsl:with-param"/>
639
            <xs:element ref="xsl:fallback"/>
640
          </xs:choice>
641
          <xs:attribute name="xpath" type="xsl:expression"/>
642
          <xs:attribute name="as" type="xsl:sequence-type"/>
643
          <xs:attribute name="base-uri" type="xsl:avt"/>
644
          <xs:attribute name="context-item" type="xsl:expression"/>
645
          <xs:attribute name="namespace-context" type="xsl:expression"/>
646
          <xs:attribute name="schema-aware" type="xsl:avt"/>
647
          <xs:attribute name="with-params" type="xsl:expression"/> 
648
          <xs:attribute name="_xpath" type="xs:string"/>
649
          <xs:attribute name="_as" type="xs:string"/>
650
          <xs:attribute name="_base-uri" type="xs:string"/>
651
          <xs:attribute name="_context-item" type="xs:string"/>
652
          <xs:attribute name="_namespace-context" type="xs:string"/>
653
          <xs:attribute name="_schema-aware" type="xs:string"/>
654
          <xs:attribute name="_with-params" type="xs:string"/> 
655
          <xs:assert test="exists(@xpath | @_xpath)"/>
656
        </xs:extension>
657
      </xs:complexContent>
658
    </xs:complexType>
659
  </xs:element>
660
  
661
  <xs:element name="expose">
662
    <xs:annotation>
663
        <xs:documentation>
664
            <p>This element appears as a child of <code>xsl:use-package</code> and defines 
665
            the visibility of components that are made available (or not) by this package
666
            to other using packages.</p>
667
        </xs:documentation>
668
    </xs:annotation>
669
    <xs:complexType>
670
      <xs:complexContent>
671
        <xs:extension base="xsl:element-only-versioned-element-type">
672
          <xs:attribute name="component" type="xsl:component-kind-type"/>
673
          <xs:attribute name="names" type="xsl:EQNames"/>
674
          <xs:attribute name="visibility" type="xsl:visibility-not-hidden-type"/>
675
          <xs:attribute name="_component" type="xs:string"/>
676
          <xs:attribute name="_names" type="xs:string"/>
677
          <xs:attribute name="_visibility" type="xs:string"/>
678
        </xs:extension>
679
      </xs:complexContent>
680
    </xs:complexType>
681
  </xs:element>
682

    
683
  <xs:element name="fallback" substitutionGroup="xsl:instruction" type="xsl:sequence-constructor"/>
684

    
685
  <xs:element name="for-each" substitutionGroup="xsl:instruction">
686
    <xs:complexType>
687
      <xs:complexContent mixed="true">
688
        <xs:extension base="xsl:versioned-element-type">
689
          <xs:sequence>
690
            <xs:element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
691
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
692
          </xs:sequence>
693
          <xs:attribute name="select" type="xsl:expression"/>
694
          <xs:attribute name="_select" type="xs:string"/>
695
          <xs:assert test="every $e in subsequence(xsl:sort, 2) satisfies empty($e/@stable)">
696
            <xs:annotation>
697
              <xs:documentation>
698
                <p>It is a static error if an xsl:sort element other than the first in a 
699
                  sequence of sibling xsl:sort elements has a stable attribute.
700
                </p>
701
              </xs:documentation>
702
            </xs:annotation>
703
          </xs:assert>
704
          <xs:assert test="exists(@select | @_select)"/>
705
        </xs:extension>
706
      </xs:complexContent>
707
    </xs:complexType>
708
  </xs:element>
709

    
710
  <xs:element name="for-each-group" substitutionGroup="xsl:instruction">
711
    <xs:complexType>
712
      <xs:complexContent mixed="true">
713
        <xs:extension base="xsl:versioned-element-type">
714
          <xs:sequence>
715
            <xs:element ref="xsl:sort" minOccurs="0" maxOccurs="unbounded"/>
716
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
717
          </xs:sequence>
718
          <xs:attribute name="select" type="xsl:expression"/>
719
          <xs:attribute name="group-by" type="xsl:expression"/>
720
          <xs:attribute name="group-adjacent" type="xsl:expression"/>
721
          <xs:attribute name="group-starting-with" type="xsl:pattern"/>
722
          <xs:attribute name="group-ending-with" type="xsl:pattern"/>
723
          <xs:attribute name="composite" type="xsl:yes-or-no"/>
724
          <xs:attribute name="collation" type="xsl:avt"/>
725
          <xs:attribute name="_select" type="xs:string"/>
726
          <xs:attribute name="_group-by" type="xs:string"/>
727
          <xs:attribute name="_group-adjacent" type="xs:string"/>
728
          <xs:attribute name="_group-starting-with" type="xs:string"/>
729
          <xs:attribute name="_group-ending-with" type="xs:string"/>
730
          <xs:attribute name="_composite" type="xs:string"/>
731
          <xs:attribute name="_collation" type="xs:string"/>
732
          <xs:assert test="exists(@select | @_select)"/>
733
          <xs:assert test="every $e in subsequence(xsl:sort, 2) satisfies empty($e/@stable)">
734
            <xs:annotation>
735
              <xs:documentation>
736
                <p>It is a static error if an xsl:sort element other than the first in a 
737
                  sequence of sibling xsl:sort elements has a stable attribute.
738
                </p>
739
              </xs:documentation>
740
            </xs:annotation>
741
          </xs:assert>
742
          <xs:assert test="count((@group-by, @group-adjacent, @group-starting-with, @group-ending-with)) = 1">
743
            <xs:annotation>
744
              <xs:documentation>
745
                <p>These four attributes are mutually exclusive: it is a static error 
746
                  if none of these four attributes is present or if more than one of them is present.
747
                </p>
748
              </xs:documentation>
749
            </xs:annotation>
750
          </xs:assert>
751
          <xs:assert test="if (exists(@collation) or exists(@composite)) then (exists(@group-by) or exists(@group-adjacent)) else true()">
752
            <xs:annotation>
753
              <xs:documentation>
754
                <p>It is an error to specify the collation attribute or the composite attribute 
755
                  if neither the group-by attribute nor group-adjacent attribute is specified.
756
                </p>
757
              </xs:documentation>
758
            </xs:annotation>
759
          </xs:assert>
760
        </xs:extension>
761
      </xs:complexContent>
762
    </xs:complexType>
763
  </xs:element>
764

    
765
  <xs:element name="fork" substitutionGroup="xsl:instruction">
766
    <xs:complexType>
767
      <xs:complexContent mixed="true">
768
        <xs:extension base="xsl:versioned-element-type">
769
          <xs:sequence>
770
            <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
771
            <xs:choice>
772
              <xs:sequence minOccurs="0" maxOccurs="unbounded">
773
                <xs:element ref="xsl:sequence"/>
774
                <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
775
              </xs:sequence>
776
              <xs:sequence>
777
                <xs:element ref="xsl:for-each-group"/>
778
                <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
779
              </xs:sequence>
780
            </xs:choice>
781
          </xs:sequence>
782
        </xs:extension>
783
      </xs:complexContent>
784
    </xs:complexType>
785
  </xs:element>
786

    
787
  <xs:element name="function" substitutionGroup="xsl:declaration">
788
    <xs:complexType>
789
      <xs:complexContent mixed="true">
790
        <xs:extension base="xsl:versioned-element-type">
791
          <xs:sequence>
792
            <xs:element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
793
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
794
          </xs:sequence>
795
          <xs:attribute name="name" type="xsl:EQName-in-namespace"/>
796
          <xs:attribute name="override" type="xsl:yes-or-no" default="yes"/>
797
          <xs:attribute name="as" type="xsl:sequence-type" default="item()*"/>
798
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
799
          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
800
          <xs:attribute name="override-extension-function" type="xsl:yes-or-no"/>
801
          <xs:attribute name="identity-sensitive" type="xsl:yes-or-no"/>
802
          <xs:attribute name="cache" type="xsl:caching-values"/>
803
          <xs:attribute name="_name" type="xs:string"/>
804
          <xs:attribute name="_override" type="xs:string"/>
805
          <xs:attribute name="_as" type="xs:string"/>
806
          <xs:attribute name="_visibility" type="xs:string"/>
807
          <xs:attribute name="_streamable" type="xs:string"/>
808
          <xs:attribute name="_override-extension-function" type="xs:string"/>
809
          <xs:attribute name="_identity-sensitive" type="xs:string"/>
810
          <xs:attribute name="_cache" type="xs:string"/>
811
          <xs:assert test="exists(@name | @_name)"/>
812
          <xs:assert test="every $e in xsl:param satisfies (empty($e/@select) and empty($e/child::node()))">
813
            <xs:annotation>
814
              <xs:documentation>
815
                <p>A parameter for a function must have no default value.</p>
816
              </xs:documentation>
817
            </xs:annotation>
818
          </xs:assert>
819
          <xs:assert test="every $e in xsl:param satisfies empty($e/@visibility)">
820
            <xs:annotation>
821
              <xs:documentation>
822
                <p>A parameter for a function must have no <code>visibility</code> attribute.</p>
823
              </xs:documentation>
824
            </xs:annotation>
825
          </xs:assert>
826
          <xs:assert test="every $e in xsl:param satisfies empty($e/@required)">
827
            <xs:annotation>
828
              <xs:documentation>
829
                <p>A parameter for a function must have no <code>required</code> attribute.</p>
830
              </xs:documentation>
831
            </xs:annotation>
832
          </xs:assert>
833
        </xs:extension>
834
      </xs:complexContent>
835
    </xs:complexType>
836
  </xs:element>
837
  
838
  <xs:element name="global-context-item">
839
    <xs:complexType>
840
      <xs:complexContent>
841
        <xs:extension base="xsl:element-only-versioned-element-type">
842
          <xs:attribute name="as" type="xsl:item-type"/>
843
          <xs:attribute name="use">
844
            <xs:simpleType>
845
              <xs:restriction base="xs:token">
846
                <xs:enumeration value="required"/>
847
                <xs:enumeration value="optional"/>
848
                <xs:enumeration value="prohibited"/>
849
              </xs:restriction>
850
            </xs:simpleType>
851
          </xs:attribute>
852
          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
853
          <xs:attribute name="_as" type="xs:string"/>
854
          <xs:attribute name="_use" type="xs:string"/>
855
          <xs:attribute name="_streamable" type="xs:string"/>
856
        </xs:extension>
857
      </xs:complexContent>
858
    </xs:complexType>
859
  </xs:element>
860
  
861

    
862
  <xs:element name="if" substitutionGroup="xsl:instruction">
863
    <xs:complexType>
864
      <xs:complexContent mixed="true">
865
        <xs:extension base="xsl:sequence-constructor">
866
          <xs:attribute name="test" type="xsl:expression"/>
867
          <xs:attribute name="_test" type="xs:string"/>
868
          <xs:assert test="exists(@test | @_test)"/>
869
        </xs:extension>
870
      </xs:complexContent>
871
    </xs:complexType>
872
  </xs:element>
873

    
874
  <xs:element name="import" substitutionGroup="xsl:declaration">
875
    <xs:complexType>
876
      <xs:complexContent>
877
        <xs:extension base="xsl:element-only-versioned-element-type">
878
          <xs:attribute name="href" type="xs:anyURI"/>
879
          <xs:attribute name="_href" type="xs:string"/>
880
          <xs:assert test="exists(@href | @_href)"/>
881
        </xs:extension>
882
      </xs:complexContent>
883
    </xs:complexType>
884
  </xs:element>
885

    
886
  <xs:element name="import-schema" substitutionGroup="xsl:declaration">
887
    <xs:complexType>
888
      <xs:complexContent>
889
        <xs:extension base="xsl:element-only-versioned-element-type">
890
          <xs:sequence>
891
            <xs:element ref="xs:schema" minOccurs="0" maxOccurs="1"/>
892
          </xs:sequence>
893
          <xs:attribute name="namespace" type="xs:anyURI"/>
894
          <xs:attribute name="schema-location" type="xs:anyURI"/>
895
          <xs:attribute name="_namespace" type="xs:string"/>
896
          <xs:attribute name="_schema-location" type="xs:string"/>
897
          <xs:assert test="not(exists(@schema-location) and exists(xs:schema))">
898
            <xs:annotation>
899
              <xs:documentation>
900
                <p>XTSE0215: It is a static error if an xsl:import-schema element that contains an 
901
                xs:schema element has a schema-location attribute
902
                </p>
903
              </xs:documentation>
904
            </xs:annotation>
905
          </xs:assert> 
906
        </xs:extension>
907
      </xs:complexContent>
908
    </xs:complexType>
909
  </xs:element>
910

    
911
  <xs:element name="include" substitutionGroup="xsl:declaration">
912
    <xs:complexType>
913
      <xs:complexContent>
914
        <xs:extension base="xsl:element-only-versioned-element-type">
915
          <xs:attribute name="href" type="xs:anyURI"/>
916
          <xs:attribute name="_href" type="xs:string"/>
917
          <xs:assert test="exists(@href | @_href)"/>
918
        </xs:extension>
919
      </xs:complexContent>
920
    </xs:complexType>
921
  </xs:element>
922

    
923
  <xs:element name="iterate" substitutionGroup="xsl:instruction">
924
    <xs:complexType>
925
      <xs:complexContent mixed="true">
926
        <xs:extension base="xsl:versioned-element-type">
927
          <xs:sequence>
928
            <xs:element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
929
            <xs:element ref="xsl:on-completion" minOccurs="0" maxOccurs="1"/>
930
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>           
931
          </xs:sequence>
932
          <xs:attribute name="select" type="xsl:expression"/>
933
          <xs:attribute name="_select" type="xs:string"/>
934
          <xs:assert test="exists(@select | @_select)"/>
935
        </xs:extension>
936
      </xs:complexContent>
937
    </xs:complexType>
938
  </xs:element>
939

    
940
  <xs:element name="key" substitutionGroup="xsl:declaration">
941
    <xs:complexType>
942
      <xs:complexContent mixed="true">
943
        <xs:extension base="xsl:sequence-constructor">
944
          <xs:attribute name="name" type="xsl:EQName"/>
945
          <xs:attribute name="match" type="xsl:pattern"/>
946
          <xs:attribute name="use" type="xsl:expression"/>
947
          <xs:attribute name="composite" type="xsl:yes-or-no"/>
948
          <xs:attribute name="collation" type="xs:anyURI"/>
949
          <xs:attribute name="_name" type="xs:string"/>
950
          <xs:attribute name="_match" type="xs:string"/>
951
          <xs:attribute name="_use" type="xs:string"/>
952
          <xs:attribute name="_composite" type="xs:string"/>
953
          <xs:attribute name="_collation" type="xs:string"/>
954
          <xs:assert test="exists(@name | @_name)"/>
955
          <xs:assert test="exists(@match | @_match)"/>
956
        </xs:extension>
957
      </xs:complexContent>
958
    </xs:complexType>
959
  </xs:element>
960
  
961
  <xs:element name="map" type="xsl:sequence-constructor" substitutionGroup="xsl:instruction"/>
962
  
963
  <xs:element name="map-entry" substitutionGroup="xsl:instruction">
964
    <xs:complexType>
965
      <xs:complexContent mixed="true">
966
        <xs:extension base="xsl:sequence-constructor-and-select">
967
          <xs:attribute name="key" type="xsl:expression"/>
968
          <xs:attribute name="_key" type="xs:string"/>
969
          <xs:assert test="exists(@key | @_key)"/>
970
        </xs:extension>
971
      </xs:complexContent>
972
    </xs:complexType>
973
  </xs:element>
974

    
975
  <xs:element name="matching-substring" type="xsl:sequence-constructor"/>
976

    
977
  <xs:element name="merge" substitutionGroup="xsl:instruction">
978
    <xs:complexType>
979
      <xs:complexContent>
980
        <xs:extension base="xsl:element-only-versioned-element-type">
981
          <xs:sequence>
982
            <xs:element ref="xsl:merge-source" minOccurs="1" maxOccurs="unbounded"/>
983
            <xs:element ref="xsl:merge-action" minOccurs="1" maxOccurs="1"/>
984
            <xs:element ref="xsl:fallback" minOccurs="0" maxOccurs="unbounded"/>
985
          </xs:sequence>
986
        </xs:extension>
987
      </xs:complexContent>
988
    </xs:complexType>
989
  </xs:element>
990

    
991
  <xs:element name="merge-action" type="xsl:sequence-constructor"/>
992

    
993
  <xs:element name="merge-key" substitutionGroup="xsl:instruction">
994
    <xs:complexType>
995
      <xs:complexContent mixed="true">
996
        <xs:extension base="xsl:versioned-element-type">
997
          <xs:sequence>
998
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
999
          </xs:sequence>
1000
          <xs:attribute name="select" type="xsl:expression"/>
1001
          <xs:attribute name="lang" type="xsl:avt"/>
1002
          <xs:attribute name="order" type="xsl:avt"/>
1003
          <xs:attribute name="collation" type="xs:anyURI"/>
1004
          <xs:attribute name="case-order" type="xsl:avt"/>
1005
          <xs:attribute name="data-type" type="xsl:avt"/>
1006
          <xs:attribute name="_select" type="xs:string"/>
1007
          <xs:attribute name="_lang" type="xs:string"/>
1008
          <xs:attribute name="_order" type="xs:string"/>
1009
          <xs:attribute name="_collation" type="xs:string"/>
1010
          <xs:attribute name="_case-order" type="xs:string"/>
1011
          <xs:attribute name="_data-type" type="xs:string"/>
1012
        </xs:extension>
1013
      </xs:complexContent>
1014
    </xs:complexType>
1015
  </xs:element>
1016

    
1017
  <xs:element name="merge-source">
1018
    <xs:complexType>
1019
      <xs:complexContent>
1020
        <xs:extension base="xsl:element-only-versioned-element-type">
1021
          <xs:sequence>
1022
            <xs:element ref="xsl:merge-key" minOccurs="1" maxOccurs="unbounded"/>
1023
          </xs:sequence>
1024
          <xs:attribute name="name" type="xs:NCName"/>
1025
          <xs:attribute name="for-each-item" type="xsl:expression"/>
1026
          <xs:attribute name="for-each-stream" type="xsl:expression"/>
1027
          <xs:attribute name="select" type="xsl:expression"/>
1028
          <xs:attribute name="streamable" type="xsl:yes-or-no"/>
1029
          <xs:attribute name="sort-before-merge" type="xsl:yes-or-no"/>
1030
          <xs:attribute name="type" type="xsl:EQName"/>
1031
          <xs:attribute name="validation" type="xsl:validation-type"/>
1032
          <xs:attribute name="_name" type="xs:string"/>
1033
          <xs:attribute name="_for-each-item" type="xs:string"/>
1034
          <xs:attribute name="_for-each-stream" type="xs:string"/>
1035
          <xs:attribute name="_select" type="xs:string"/>
1036
          <xs:attribute name="_streamable" type="xs:string"/>
1037
          <xs:attribute name="_sort-before-merge" type="xs:string"/>
1038
          <xs:attribute name="_type" type="xs:string"/>
1039
          <xs:attribute name="_validation" type="xs:string"/>
1040
          <xs:assert test="exists(@select | @_select)"/>
1041
        </xs:extension>
1042
      </xs:complexContent>
1043
    </xs:complexType>
1044
  </xs:element>
1045

    
1046
  <xs:element name="message" substitutionGroup="xsl:instruction">
1047
    <xs:complexType>
1048
      <xs:complexContent mixed="true">
1049
        <xs:extension base="xsl:sequence-constructor">
1050
          <xs:attribute name="select" type="xsl:expression"/>
1051
          <xs:attribute name="terminate" type="xsl:avt" default="no"/>
1052
          <xs:attribute name="error-code" type="xsl:avt"/>
1053
          <xs:attribute name="_select" type="xs:string"/>
1054
          <xs:attribute name="_terminate" type="xs:string"/>
1055
          <xs:attribute name="_error-code" type="xs:string"/>
1056
        </xs:extension>
1057
      </xs:complexContent>
1058
    </xs:complexType>
1059
  </xs:element>
1060

    
1061
  <xs:element name="mode" substitutionGroup="xsl:declaration">
1062
    <xs:complexType>
1063
      <xs:complexContent mixed="false">
1064
        <xs:extension base="xsl:element-only-versioned-element-type">
1065
          <xs:attribute name="name" type="xsl:EQName"/>
1066
          <xs:attribute name="streamable" type="xsl:yes-or-no" default="no"/>
1067
          <xs:attribute name="on-no-match" type="xsl:on-no-match-type" default="shallow-skip"/>
1068
          <xs:attribute name="on-multiple-match" type="xsl:on-multiple-match-type" default="use-last"/>
1069
          <xs:attribute name="warning-on-no-match" type="xsl:yes-or-no"/>
1070
          <xs:attribute name="warning-on-multiple-match" type="xsl:yes-or-no"/>
1071
          <xs:attribute name="typed" type="xsl:typed-type"/>
1072
          <xs:attribute name="visibility">
1073
            <xs:simpleType>
1074
              <xs:restriction base="xsl:visibility-type">
1075
                <xs:enumeration value="public"/>
1076
                <xs:enumeration value="private"/>
1077
                <xs:enumeration value="final"/>
1078
              </xs:restriction>
1079
            </xs:simpleType>
1080
          </xs:attribute>
1081
          <xs:attribute name="_name" type="xs:string"/>
1082
          <xs:attribute name="_streamable" type="xs:string"/>
1083
          <xs:attribute name="_on-no-match" type="xs:string"/>
1084
          <xs:attribute name="_on-multiple-match" type="xs:string"/>
1085
          <xs:attribute name="_warning-on-no-match" type="xs:string"/>
1086
          <xs:attribute name="_warning-on-multiple-match" type="xs:string"/>
1087
          <xs:attribute name="_typed" type="xs:string"/>
1088
          <xs:attribute name="_visibility" type="xs:string"/>
1089
          <xs:assert test="not(exists(@name) and normalize-space(@visibility) = 'private' and exists(xsl:context-item))">
1090
            <xs:annotation>
1091
              <xs:documentation>
1092
                <p>It is a static error if a named xsl:mode declaration specifying visibility="private" 
1093
                  contains an xsl:context-item element.
1094
                </p>
1095
              </xs:documentation>
1096
            </xs:annotation>
1097
          </xs:assert> 
1098
        </xs:extension>
1099
      </xs:complexContent>
1100
    </xs:complexType>
1101
  </xs:element>
1102

    
1103

    
1104
  <xs:element name="namespace" substitutionGroup="xsl:instruction">
1105
    <xs:complexType>
1106
      <xs:complexContent mixed="true">
1107
        <xs:extension base="xsl:sequence-constructor-or-select">
1108
          <xs:attribute name="name" type="xsl:avt"/>
1109
          <xs:attribute name="_name" type="xs:string"/>
1110
          <xs:assert test="exists(@name | @_name)"/>
1111
        </xs:extension>
1112
      </xs:complexContent>
1113
    </xs:complexType>
1114
  </xs:element>
1115

    
1116
  <xs:element name="namespace-alias" substitutionGroup="xsl:declaration">
1117
    <xs:complexType>
1118
      <xs:complexContent>
1119
        <xs:extension base="xsl:element-only-versioned-element-type">
1120
          <xs:attribute name="stylesheet-prefix" type="xsl:prefix-or-default"/>
1121
          <xs:attribute name="result-prefix" type="xsl:prefix-or-default"/>
1122
          <xs:attribute name="_stylesheet-prefix" type="xs:string"/>
1123
          <xs:attribute name="_result-prefix" type="xs:string"/>
1124
          <xs:assert test="exists(@stylesheet-prefix | @_stylesheet-prefix)"/>
1125
          <xs:assert test="exists(@result-prefix | @_result-prefix)"/>
1126
          <xs:assert test="every $prefix in (@stylesheet-prefix, @result-prefix)[. ne '#default']
1127
            satisfies $prefix = in-scope-prefixes(.)"/>
1128
        </xs:extension>
1129
      </xs:complexContent>
1130
    </xs:complexType>
1131
  </xs:element>
1132

    
1133

    
1134
  <xs:element name="next-iteration" substitutionGroup="xsl:instruction">
1135
    <xs:complexType>
1136
      <xs:complexContent mixed="true">
1137
        <xs:extension base="xsl:element-only-versioned-element-type">
1138
          <xs:sequence>
1139
            <xs:element ref="xsl:with-param" minOccurs="0" maxOccurs="unbounded"/>
1140
          </xs:sequence>
1141
        </xs:extension>
1142
      </xs:complexContent>
1143
    </xs:complexType>
1144
  </xs:element>
1145

    
1146

    
1147
  <xs:element name="next-match" substitutionGroup="xsl:instruction">
1148
    <xs:complexType>
1149
      <xs:complexContent>
1150
        <xs:extension base="xsl:element-only-versioned-element-type">
1151
          <xs:choice minOccurs="0" maxOccurs="unbounded">
1152
            <xs:element ref="xsl:with-param"/>
1153
            <xs:element ref="xsl:fallback"/>
1154
          </xs:choice>
1155
        </xs:extension>
1156
      </xs:complexContent>
1157
    </xs:complexType>
1158
  </xs:element>
1159

    
1160
  <xs:element name="non-matching-substring" type="xsl:sequence-constructor"/>
1161

    
1162
  <xs:element name="number" substitutionGroup="xsl:instruction">
1163
    <xs:complexType>
1164
      <xs:complexContent mixed="true">
1165
        <xs:extension base="xsl:versioned-element-type">
1166
          <xs:attribute name="value" type="xsl:expression"/>
1167
          <xs:attribute name="select" type="xsl:expression"/>
1168
          <xs:attribute name="level" type="xsl:level" default="single"/>
1169
          <xs:attribute name="count" type="xsl:pattern"/>
1170
          <xs:attribute name="from" type="xsl:pattern"/>
1171
          <xs:attribute name="format" type="xsl:avt" default="1"/>
1172
          <xs:attribute name="lang" type="xsl:avt"/>
1173
          <xs:attribute name="letter-value" type="xsl:avt"/>
1174
          <xs:attribute name="ordinal" type="xsl:avt"/>
1175
          <xs:attribute name="start-at" type="xsl:avt"/>
1176
          <xs:attribute name="grouping-separator" type="xsl:avt"/>
1177
          <xs:attribute name="grouping-size" type="xsl:avt"/>
1178
          <xs:attribute name="_value" type="xs:string"/>
1179
          <xs:attribute name="_select" type="xs:string"/>
1180
          <xs:attribute name="_level" type="xs:string"/>
1181
          <xs:attribute name="_count" type="xs:string"/>
1182
          <xs:attribute name="_from" type="xs:string"/>
1183
          <xs:attribute name="_format" type="xs:string"/>
1184
          <xs:attribute name="_lang" type="xs:string"/>
1185
          <xs:attribute name="_letter-value" type="xs:string"/>
1186
          <xs:attribute name="_ordinal" type="xs:string"/>
1187
          <xs:attribute name="_start-at" type="xs:string"/>
1188
          <xs:attribute name="_grouping-separator" type="xs:string"/>
1189
          <xs:attribute name="_grouping-size" type="xs:string"/>
1190
          <xs:assert test="if (exists(@value)) then empty((@select, @count, @from)) and @level='single' else true()">
1191
            <xs:annotation>
1192
              <xs:documentation>
1193
                <p>It is a static error if the value attribute of xsl:number is present unless the 
1194
                  select, level, count, and from attributes are all absent.
1195
                </p>
1196
              </xs:documentation>
1197
            </xs:annotation>
1198
          </xs:assert>         
1199
          </xs:extension>
1200
      </xs:complexContent>
1201
    </xs:complexType>
1202
  </xs:element>
1203

    
1204
  <xs:element name="on-completion" type="xsl:sequence-constructor-or-select"/>
1205

    
1206
  <xs:element name="otherwise" type="xsl:sequence-constructor"/>
1207

    
1208
  <xs:element name="output" substitutionGroup="xsl:declaration">
1209
    <xs:complexType>
1210
      <xs:complexContent mixed="true">
1211
        <xs:extension base="xsl:generic-element-type">
1212
          <xs:attribute name="name" type="xsl:EQName"/>
1213
          <xs:attribute name="recoverable" type="xsl:yes-or-no"/>
1214
          <xs:attribute name="method" type="xsl:method"/>
1215
          <xs:attribute name="byte-order-mark" type="xsl:yes-or-no"/>
1216
          <xs:attribute name="cdata-section-elements" type="xsl:EQNames"/>
1217
          <xs:attribute name="doctype-public" type="xs:string"/>
1218
          <xs:attribute name="doctype-system" type="xs:string"/>
1219
          <xs:attribute name="encoding" type="xs:string"/>
1220
          <xs:attribute name="escape-uri-attributes" type="xsl:yes-or-no"/>
1221
          <xs:attribute name="html-version" type="xs:decimal"/>
1222
          <xs:attribute name="include-content-type" type="xsl:yes-or-no"/>
1223
          <xs:attribute name="indent" type="xsl:yes-or-no"/>
1224
          <xs:attribute name="item-separator" type="xs:string"/>
1225
          <xs:attribute name="media-type" type="xs:string"/>
1226
          <xs:attribute name="normalization-form" type="xs:NMTOKEN"/>
1227
          <xs:attribute name="omit-xml-declaration" type="xsl:yes-or-no"/>
1228
          <xs:attribute name="parameter-document" type="xs:anyURI"/>
1229
          <xs:attribute name="standalone" type="xsl:yes-or-no-or-omit"/>
1230
          <xs:attribute name="suppress-indentation" type="xsl:EQNames"/>
1231
          <xs:attribute name="undeclare-prefixes" type="xsl:yes-or-no"/>
1232
          <xs:attribute name="use-character-maps" type="xsl:EQNames"/>
1233
          <xs:attribute name="version" type="xs:NMTOKEN"/>
1234
          <xs:attribute name="_name" type="xs:string"/>
1235
          <xs:attribute name="_method" type="xs:string"/>
1236
          <xs:attribute name="_byte-order-mark" type="xs:string"/>
1237
          <xs:attribute name="_cdata-section-elements" type="xs:string"/>
1238
          <xs:attribute name="_doctype-public" type="xs:string"/>
1239
          <xs:attribute name="_doctype-system" type="xs:string"/>
1240
          <xs:attribute name="_encoding" type="xs:string"/>
1241
          <xs:attribute name="_escape-uri-attributes" type="xs:string"/>
1242
          <xs:attribute name="_html-version" type="xs:string"/>
1243
          <xs:attribute name="_include-content-type" type="xs:string"/>
1244
          <xs:attribute name="_indent" type="xs:string"/>
1245
          <xs:attribute name="_item-separator" type="xs:string"/>
1246
          <xs:attribute name="_media-type" type="xs:string"/>
1247
          <xs:attribute name="_normalization-form" type="xs:string"/>
1248
          <xs:attribute name="_omit-xml-declaration" type="xs:string"/>
1249
          <xs:attribute name="_parameter-document" type="xs:string"/>
1250
          <xs:attribute name="_standalone" type="xs:string"/>
1251
          <xs:attribute name="_suppress-indentation" type="xs:string"/>
1252
          <xs:attribute name="_undeclare-prefixes" type="xs:string"/>
1253
          <xs:attribute name="_use-character-maps" type="xs:string"/>
1254
          <xs:attribute name="_version" type="xs:string"/>
1255
        </xs:extension>
1256
      </xs:complexContent>
1257
    </xs:complexType>
1258
  </xs:element>
1259

    
1260
  <xs:element name="output-character">
1261
    <xs:complexType>
1262
      <xs:complexContent>
1263
        <xs:extension base="xsl:element-only-versioned-element-type">
1264
          <xs:attribute name="character" type="xsl:char"/>
1265
          <xs:attribute name="string" type="xs:string"/>
1266
          <xs:attribute name="_character" type="xs:string"/>
1267
          <xs:attribute name="_string" type="xs:string"/>
1268
          <xs:assert test="exists(@character | @_character)"/>
1269
          <xs:assert test="exists(@string | @_string)"/>
1270
        </xs:extension>
1271
      </xs:complexContent>
1272
    </xs:complexType>
1273
  </xs:element>
1274
  
1275
  <xs:element name="override">
1276
    <xs:annotation>
1277
        <xs:documentation>
1278
            <p>This element appears as a child of <code>xsl:use-package</code> and defines 
1279
            any overriding definitions of components that the containing package wishes to make 
1280
            to the components made available from a library package.</p>
1281
        </xs:documentation>
1282
    </xs:annotation>
1283
    <xs:complexType>
1284
      <xs:complexContent>
1285
        <xs:extension base="xsl:element-only-versioned-element-type">
1286
          <xs:choice minOccurs="0" maxOccurs="unbounded">
1287
            <xs:element ref="xsl:template"/>
1288
            <xs:element ref="xsl:function"/>
1289
            <xs:element ref="xsl:variable"/>
1290
            <xs:element ref="xsl:param"/>
1291
            <xs:element ref="xsl:attribute-set"/>
1292
          </xs:choice>          
1293
          <xs:assert test="every $e in * satisfies exists($e/@name)">
1294
            <xs:annotation>
1295
              <xs:documentation>
1296
                <p>Every component that is overridden (in particular, templates) must have a <code>name</code> attribute</p>
1297
              </xs:documentation>
1298
            </xs:annotation>
1299
          </xs:assert>
1300
          <xs:assert test="every $e in xsl:template satisfies empty($e/@match)">
1301
            <xs:annotation>
1302
              <xs:documentation>
1303
                <p>A template that is overridden must not have a <code>match</code> attribute</p>
1304
              </xs:documentation>
1305
            </xs:annotation>
1306
          </xs:assert>  
1307
        </xs:extension>
1308
      </xs:complexContent>
1309
    </xs:complexType>   
1310
  </xs:element>
1311
    
1312
  <xs:element name="package">
1313
    <xs:complexType>
1314
      <xs:complexContent>
1315
        <xs:extension base="xsl:element-only-versioned-element-type">
1316
          <xs:sequence>
1317
            <xs:choice minOccurs="0" maxOccurs="unbounded">             
1318
              <xs:element ref="xsl:use-package"/>
1319
              <xs:element ref="xsl:expose"/>
1320
              <xs:element ref="xsl:global-context-item"/>
1321
              <xs:element ref="xsl:declaration"/>
1322
              <xs:any namespace="##other" processContents="lax"/>
1323
            </xs:choice>  
1324
          </xs:sequence>
1325
          <xs:attribute name="id" type="xs:ID"/>         
1326
          <xs:attribute name="name" type="xs:anyURI"/>
1327
          <xs:attribute name="package-version" type="xs:string"/>
1328
          <xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type"/>
1329
          <xs:attribute name="_id" type="xs:string"/>
1330
          <xs:attribute name="_name" type="xs:string"/>
1331
          <xs:attribute name="_package-version" type="xs:string"/>
1332
          <xs:attribute name="_input-type-annotations" type="xs:string"/>
1333
        </xs:extension>
1334
      </xs:complexContent>
1335
    </xs:complexType>
1336
  </xs:element>
1337

    
1338
  <xs:element name="param" substitutionGroup="xsl:declaration">
1339
    <xs:annotation>
1340
        <xs:documentation>
1341
            <p>Declaration of the <code>xsl:param</code> element, used both defining function
1342
            parameters, template parameters, parameters to <code>xsl:iterate</code>,
1343
            and global stylesheet parameters.</p>
1344
        </xs:documentation>
1345
    </xs:annotation>
1346
    <xs:complexType>
1347
      <xs:complexContent mixed="true">
1348
        <xs:extension base="xsl:sequence-constructor-or-select">
1349
          <xs:attribute name="name" type="xsl:EQName"/>
1350
          <xs:attribute name="as" type="xsl:sequence-type"/>
1351
          <xs:attribute name="required" type="xsl:yes-or-no"/>
1352
          <xs:attribute name="tunnel" type="xsl:yes-or-no"/>
1353
          <xs:attribute name="static" type="xsl:yes-or-no"/>  
1354
          <xs:attribute name="_name" type="xs:string"/>
1355
          <xs:attribute name="_as" type="xs:string"/>
1356
          <xs:attribute name="_required" type="xs:string"/>
1357
          <xs:attribute name="_tunnel" type="xs:string"/>
1358
          <xs:attribute name="_static" type="xs:string"/>
1359
          <xs:assert test="exists(@name | @_name)"/>
1360
          <xs:assert test="if (normalize-space(@static) = 'yes') 
1361
                           then normalize-space(@visibility) = ('', 'private', 'final') 
1362
                           else true()">
1363
              <xs:annotation>
1364
                <xs:documentation>
1365
                  <p>When the static attribute is present with the value yes, 
1366
                    the visibility attribute must not have a value other than private 
1367
                    or final.</p>
1368
                </xs:documentation>
1369
              </xs:annotation>
1370
            </xs:assert>
1371
          <xs:assert test="if (normalize-space(@static) = 'yes')
1372
                           then empty((*,text()))
1373
                           else true()">
1374
            <xs:annotation>
1375
              <xs:documentation>
1376
                <p>When the attribute static="yes" is specified, 
1377
                  the xsl:param element must have empty content.</p>
1378
              </xs:documentation>
1379
            </xs:annotation>
1380
          </xs:assert> 
1381
        </xs:extension>
1382
      </xs:complexContent>
1383
    </xs:complexType>
1384
  </xs:element>
1385

    
1386
  
1387

    
1388
  <xs:element name="perform-sort" substitutionGroup="xsl:instruction">
1389
    <xs:complexType>
1390
      <xs:complexContent mixed="true">
1391
        <xs:extension base="xsl:versioned-element-type">
1392
          <xs:sequence>
1393
            <xs:element ref="xsl:sort" minOccurs="1" maxOccurs="unbounded"/>
1394
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
1395
          </xs:sequence>
1396
          <xs:attribute name="select" type="xsl:expression"/>
1397
          <xs:assert test="every $e in subsequence(xsl:sort, 2) satisfies empty($e/@stable)">
1398
            <xs:annotation>
1399
              <xs:documentation>
1400
                <p>It is a static error if an xsl:sort element other than the first in a 
1401
                  sequence of sibling xsl:sort elements has a stable attribute.
1402
                </p>
1403
              </xs:documentation>
1404
            </xs:annotation>
1405
          </xs:assert>
1406
        </xs:extension>
1407
      </xs:complexContent>
1408
    </xs:complexType>
1409
  </xs:element>
1410

    
1411
  <xs:element name="preserve-space" substitutionGroup="xsl:declaration">
1412
    <xs:complexType>
1413
      <xs:complexContent>
1414
        <xs:extension base="xsl:element-only-versioned-element-type">
1415
          <xs:attribute name="elements" type="xsl:nametests"/>
1416
          <xs:attribute name="_elements" type="xs:string"/>
1417
          <xs:assert test="exists(@elements | @_elements)"/>
1418
        </xs:extension>
1419
      </xs:complexContent>
1420
    </xs:complexType>
1421
  </xs:element>
1422

    
1423
  <xs:element name="processing-instruction" substitutionGroup="xsl:instruction">
1424
    <xs:complexType>
1425
      <xs:complexContent mixed="true">
1426
        <xs:extension base="xsl:sequence-constructor-or-select">
1427
          <xs:attribute name="name" type="xsl:avt"/>
1428
          <xs:attribute name="_name" type="xs:string"/>
1429
          <xs:assert test="exists(@name | @_name)"/>
1430
        </xs:extension>
1431
      </xs:complexContent>
1432
    </xs:complexType>
1433
  </xs:element>
1434

    
1435
  <xs:element name="result-document" substitutionGroup="xsl:instruction">
1436
    <xs:complexType>
1437
      <xs:complexContent mixed="true">
1438
        <xs:extension base="xsl:sequence-constructor">
1439
          <xs:attribute name="format" type="xsl:avt"/>
1440
          <xs:attribute name="href" type="xsl:avt"/>
1441
          <xs:attribute name="type" type="xsl:EQName"/>
1442
          <xs:attribute name="validation" type="xsl:validation-type"/>
1443
          <xs:attribute name="recoverable" type="xsl:avt"/>
1444
          <xs:attribute name="method" type="xsl:avt"/>
1445
          <xs:attribute name="byte-order-mark" type="xsl:avt"/>
1446
          <xs:attribute name="cdata-section-elements" type="xsl:avt"/>
1447
          <xs:attribute name="doctype-public" type="xsl:avt"/>
1448
          <xs:attribute name="doctype-system" type="xsl:avt"/>
1449
          <xs:attribute name="encoding" type="xsl:avt"/>
1450
          <xs:attribute name="escape-uri-attributes" type="xsl:avt"/>
1451
          <xs:attribute name="html-version" type="xsl:avt"/>
1452
          <xs:attribute name="include-content-type" type="xsl:avt"/>
1453
          <xs:attribute name="indent" type="xsl:avt"/>
1454
          <xs:attribute name="item-separator" type="xsl:avt"/>
1455
          <xs:attribute name="media-type" type="xsl:avt"/>
1456
          <xs:attribute name="normalization-form" type="xsl:avt"/>
1457
          <xs:attribute name="omit-xml-declaration" type="xsl:avt"/>
1458
          <xs:attribute name="parameter-document" type="xsl:avt"/>
1459
          <xs:attribute name="standalone" type="xsl:avt"/>
1460
          <xs:attribute name="suppress-indentation" type="xsl:avt"/>
1461
          <xs:attribute name="undeclare-prefixes" type="xsl:avt"/>
1462
          <xs:attribute name="use-character-maps" type="xsl:EQNames"/>
1463
          <xs:attribute name="output-version" type="xsl:avt"/>
1464
          <xs:attribute name="_format" type="xs:string"/>
1465
          <xs:attribute name="_href" type="xs:string"/>
1466
          <xs:attribute name="_type" type="xs:string"/>
1467
          <xs:attribute name="_validation" type="xs:string"/>
1468
          <xs:attribute name="_method" type="xs:string"/>
1469
          <xs:attribute name="_byte-order-mark" type="xs:string"/>
1470
          <xs:attribute name="_cdata-section-elements" type="xs:string"/>
1471
          <xs:attribute name="_doctype-public" type="xs:string"/>
1472
          <xs:attribute name="_doctype-system" type="xs:string"/>
1473
          <xs:attribute name="_encoding" type="xs:string"/>
1474
          <xs:attribute name="_escape-uri-attributes" type="xs:string"/>
1475
          <xs:attribute name="_html-version" type="xs:string"/>
1476
          <xs:attribute name="_include-content-type" type="xs:string"/>
1477
          <xs:attribute name="_indent" type="xs:string"/>
1478
          <xs:attribute name="_item-separator" type="xs:string"/>
1479
          <xs:attribute name="_media-type" type="xs:string"/>
1480
          <xs:attribute name="_normalization-form" type="xs:string"/>
1481
          <xs:attribute name="_omit-xml-declaration" type="xs:string"/>
1482
          <xs:attribute name="_parameter-document" type="xs:string"/>
1483
          <xs:attribute name="_standalone" type="xs:string"/>
1484
          <xs:attribute name="_suppress-indentation" type="xs:string"/>
1485
          <xs:attribute name="_undeclare-prefixes" type="xs:string"/>
1486
          <xs:attribute name="_use-character-maps" type="xs:string"/>
1487
          <xs:attribute name="_output-version" type="xs:string"/>
1488
          <xs:assert test="not(exists(@type) and exists(@validation))">
1489
            <xs:annotation>
1490
              <xs:documentation>
1491
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
1492
                  (if one is present, the other must be absent).</p>
1493
              </xs:documentation>
1494
            </xs:annotation>
1495
          </xs:assert>
1496
        </xs:extension>
1497
      </xs:complexContent>
1498
    </xs:complexType>
1499
  </xs:element>
1500
  
1501
  <xs:element name="sequence" substitutionGroup="xsl:instruction" type="xsl:sequence-constructor-or-select"/>
1502

    
1503
  <xs:element name="sort">
1504
    <xs:complexType>
1505
      <xs:complexContent mixed="true">
1506
        <xs:extension base="xsl:sequence-constructor-or-select">
1507
          <xs:attribute name="lang" type="xsl:avt"/>
1508
          <xs:attribute name="data-type" type="xsl:avt" default="text"/>
1509
          <xs:attribute name="order" type="xsl:avt" default="ascending"/>
1510
          <xs:attribute name="case-order" type="xsl:avt"/>
1511
          <xs:attribute name="collation" type="xsl:avt"/>
1512
          <xs:attribute name="stable" type="xsl:avt"/>
1513
          <xs:attribute name="_lang" type="xs:string"/>
1514
          <xs:attribute name="_data-type" type="xs:string"/>
1515
          <xs:attribute name="_order" type="xs:string"/>
1516
          <xs:attribute name="_case-order" type="xs:string"/>
1517
          <xs:attribute name="_collation" type="xs:string"/>
1518
          <xs:attribute name="_stable" type="xs:string"/>
1519
        </xs:extension>
1520
      </xs:complexContent>
1521
    </xs:complexType>
1522
  </xs:element>
1523

    
1524
  <xs:element name="strip-space" substitutionGroup="xsl:declaration">
1525
    <xs:complexType>
1526
      <xs:complexContent>
1527
        <xs:extension base="xsl:element-only-versioned-element-type">
1528
          <xs:attribute name="elements" type="xsl:nametests"/>
1529
          <xs:attribute name="_elements" type="xs:string"/>
1530
          <xs:assert test="exists(@elements | @_elements)"/>
1531
        </xs:extension>
1532
      </xs:complexContent>
1533
    </xs:complexType>
1534
  </xs:element>
1535

    
1536
  <xs:element name="stylesheet" substitutionGroup="xsl:transform"/>
1537

    
1538
  <xs:element name="stream" substitutionGroup="xsl:instruction">
1539
    <xs:complexType>
1540
      <xs:complexContent>
1541
        <xs:extension base="xsl:sequence-constructor">
1542
          <xs:attribute name="href" type="xsl:avt"/>
1543
          <xs:attribute name="type" type="xsl:EQName"/>
1544
          <xs:attribute name="validation" type="xsl:validation-type"/>
1545
          <xs:attribute name="_href" type="xs:string"/>
1546
          <xs:attribute name="_type" type="xs:string"/>
1547
          <xs:attribute name="_validation" type="xs:string"/>
1548
          <xs:assert test="exists(@href | @_href)"/>
1549
          <xs:assert test="not(exists(@type) and exists(@validation))">
1550
            <xs:annotation>
1551
              <xs:documentation>
1552
                <p>The <code>type</code> and <code>validation</code> attributes are mutually exclusive
1553
                  (if one is present, the other must be absent).</p>
1554
              </xs:documentation>
1555
            </xs:annotation>
1556
          </xs:assert>
1557
        </xs:extension>
1558
      </xs:complexContent>
1559
    </xs:complexType>
1560
  </xs:element>
1561

    
1562
  <xs:element name="template" substitutionGroup="xsl:declaration">
1563
    <xs:complexType>
1564
      <xs:complexContent mixed="true">
1565
        <xs:extension base="xsl:versioned-element-type">
1566
          <xs:sequence>
1567
            <xs:element ref="xsl:context-item" minOccurs="0" maxOccurs="1"/>
1568
            <xs:element ref="xsl:param" minOccurs="0" maxOccurs="unbounded"/>
1569
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
1570
          </xs:sequence>
1571
          <xs:attribute name="match" type="xsl:pattern"/>
1572
          <xs:attribute name="priority" type="xs:decimal"/>
1573
          <xs:attribute name="mode" type="xsl:modes"/>
1574
          <xs:attribute name="name" type="xsl:EQName"/>
1575
          <xs:attribute name="as" type="xsl:sequence-type" default="item()*"/>
1576
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
1577
          <xs:attribute name="_match" type="xs:string"/>
1578
          <xs:attribute name="_priority" type="xs:string"/>
1579
          <xs:attribute name="_mode" type="xs:string"/>
1580
          <xs:attribute name="_name" type="xs:string"/>
1581
          <xs:attribute name="_as" type="xs:string"/>
1582
          <xs:attribute name="_visibility" type="xs:string"/>
1583
          <xs:assert test="exists(@match) or exists(@name)">
1584
            <xs:annotation>
1585
              <xs:documentation>
1586
                <p>An xsl:template element must have either a match attribute or a name attribute, or both.</p>
1587
              </xs:documentation>
1588
            </xs:annotation>
1589
          </xs:assert>
1590
          <xs:assert test="if (empty(@match)) then (empty(@mode) and empty(@priority)) else true()">
1591
            <xs:annotation>
1592
              <xs:documentation>
1593
                <p>An xsl:template element that has no match attribute must have no mode attribute and no priority attribute.</p>
1594
              </xs:documentation>
1595
            </xs:annotation>
1596
          </xs:assert>
1597
          <xs:assert test="not(exists(@visibility) and empty(@name))">
1598
            <xs:annotation>
1599
              <xs:documentation>
1600
                <p>An xsl:template element that has no name attribute must have no visibility attribute</p>
1601
              </xs:documentation>
1602
            </xs:annotation>
1603
          </xs:assert>
1604
          <xs:assert test="if (normalize-space(@visibility) = 'abstract') then empty(* except (xsl:context-item, xsl:param)) else true()">
1605
            <xs:annotation>
1606
              <xs:documentation>
1607
                <p>If the visibility attribute is present with the value abstract then (a) the sequence constructor defining 
1608
                  the template body must be empty: that is, the only permitted children are xsl:context-item and xsl:param</p>
1609
              </xs:documentation>
1610
            </xs:annotation>
1611
          </xs:assert>
1612
          <xs:assert test="not(normalize-space(@visibility) = 'abstract' and exists(@match))">
1613
            <xs:annotation>
1614
              <xs:documentation>
1615
                <p>If the visibility attribute is present with the value abstract then there must be no match attribute.</p>
1616
              </xs:documentation>
1617
            </xs:annotation>
1618
          </xs:assert>
1619
          <xs:assert test="every $e in xsl:param satisfies empty($e/@visibility)">
1620
            <xs:annotation>
1621
              <xs:documentation>
1622
                <p>A parameter for a template must have no <code>visibility</code> attribute.</p>
1623
              </xs:documentation>
1624
            </xs:annotation>
1625
          </xs:assert>
1626
        </xs:extension>
1627
      </xs:complexContent>
1628
    </xs:complexType>
1629
  </xs:element>
1630

    
1631
  <xs:complexType name="text-element-base-type">
1632
    <xs:simpleContent>
1633
      <xs:restriction base="xsl:versioned-element-type">
1634
        <xs:simpleType>
1635
          <xs:restriction base="xs:string"/>
1636
        </xs:simpleType>
1637
        <xs:anyAttribute namespace="##other" processContents="lax"/>
1638
      </xs:restriction>
1639
    </xs:simpleContent>
1640
  </xs:complexType>
1641

    
1642
  <!--* first cut (for reference)
1643
<xs:element name="text" substitutionGroup="xsl:instruction">
1644
  <xs:complexType>
1645
    <xs:simpleContent>
1646
      <xs:extension base="xsl:text-element-base-type">
1647
        <xs:attribute name="disable-output-escaping" type="xsl:yes-or-no" default="no"/>
1648
      </xs:extension>
1649
    </xs:simpleContent>
1650
  </xs:complexType>
1651
</xs:element>
1652
*-->
1653

    
1654
  <xs:complexType name="text-element-type">
1655
    <xs:simpleContent>
1656
      <xs:extension base="xsl:text-element-base-type">
1657
        <xs:attribute name="disable-output-escaping" type="xsl:yes-or-no" default="no"/>
1658
        <xs:attribute name="_disable-output-escaping" type="xs:string"/>
1659
      </xs:extension>
1660
    </xs:simpleContent>
1661
  </xs:complexType>
1662

    
1663
  <xs:element name="text" substitutionGroup="xsl:instruction" type="xsl:text-element-type"/>
1664

    
1665

    
1666
  <xs:complexType name="transform-element-base-type">
1667
    <xs:complexContent>
1668
      <xs:restriction base="xsl:element-only-versioned-element-type">
1669
        <xs:attribute name="version" type="xs:decimal" use="optional"/>
1670
        <xs:attribute name="_version" type="xs:string">
1671
          <xs:annotation>
1672
            <xs:documentation>
1673
              <p>The version attribute indicates the version of XSLT that 
1674
                the stylesheet module requires. The attribute is required, 
1675
                unless the xsl:stylesheet element is a child of an xsl:package 
1676
                element, in which case it is optional: the default is then 
1677
                taken from the parent xsl:package element.</p>
1678
            </xs:documentation>
1679
          </xs:annotation>
1680
        </xs:attribute>
1681
        <xs:anyAttribute namespace="##other" processContents="lax"/>
1682
      </xs:restriction>
1683
    </xs:complexContent>
1684
  </xs:complexType>
1685

    
1686
  <xs:element name="transform">
1687
    <xs:complexType>
1688
      <xs:complexContent>
1689
        <xs:extension base="xsl:transform-element-base-type">
1690
          <xs:sequence>
1691
            <xs:choice minOccurs="0" maxOccurs="unbounded">
1692
              <xs:element ref="xsl:declaration"/>
1693
              <xs:any namespace="##other" processContents="lax"/>
1694
              <!-- weaker than XSLT 1.0 -->
1695
            </xs:choice>
1696
          </xs:sequence>
1697
          <xs:attribute name="id" type="xs:ID"/>
1698
          <xs:attribute name="input-type-annotations" type="xsl:input-type-annotations-type"
1699
            default="unspecified"/>
1700
          <xs:attribute name="_id" type="xs:string"/>
1701
          <xs:attribute name="_input-type-annotations" type="xs:string"/>
1702
          <!--* The 'static' attribute may be used on 'param' and 'variable'
1703
              * only when they are top-level elements. *-->
1704
          <xs:assert test="every $v in (.//xsl:param, .//xsl:variable)[@static]
1705
            satisfies
1706
            $v[parent::xsl:stylesheet or parent::xsl:transform or parent::xsl:override]
1707
            ">
1708
            <xs:annotation>
1709
              <xs:documentation>
1710
                <p>The static attribute must not be present on an xsl:variable or xsl:param 
1711
                  element unless it is a top-level element.</p>
1712
              </xs:documentation>
1713
            </xs:annotation>
1714
          </xs:assert>
1715
          <xs:assert test="every $prefix in (@exclude-result-prefixes[not(. = '#all')], @extension-element-prefixes)
1716
            satisfies ((if ($prefix = '#default') then '' else $prefix) = in-scope-prefixes(.))">
1717
            <xs:annotation>
1718
              <xs:documentation>
1719
                <p>XTSE0808: It is a static error if a namespace prefix is used within the [xsl:]exclude-result-prefixes 
1720
                  attribute and there is no namespace binding in scope for that prefix.
1721
                </p>
1722
                <p>XTSE0809: It is a static error if the value #default is used within the [xsl:]exclude-result-prefixes 
1723
                  attribute and the parent element of the [xsl:]exclude-result-prefixes attribute has no default namespace.
1724
                </p>
1725
              </xs:documentation>
1726
            </xs:annotation>
1727
          </xs:assert>
1728
        </xs:extension>
1729
      </xs:complexContent>
1730
    </xs:complexType>
1731
  </xs:element>
1732

    
1733
  <xs:element name="try" substitutionGroup="xsl:instruction">
1734
    <xs:complexType>
1735
      <xs:complexContent mixed="true">
1736
        <xs:extension base="xsl:versioned-element-type">
1737
          <xs:sequence>
1738
            <xs:group ref="xsl:sequence-constructor-group" minOccurs="0" maxOccurs="unbounded"/>
1739
            <xs:element ref="xsl:catch" minOccurs="1" maxOccurs="1"/>
1740
            <xs:choice minOccurs="0" maxOccurs="unbounded">
1741
              <xs:element ref="xsl:catch"/>
1742
              <xs:element ref="xsl:fallback"/>
1743
            </xs:choice>
1744
          </xs:sequence>
1745
          <xs:attribute name="select" type="xsl:expression" use="optional"/>
1746
          <xs:attribute name="_select" type="xs:string"/>
1747
        </xs:extension>
1748
      </xs:complexContent>
1749
    </xs:complexType>
1750
  </xs:element>
1751
  
1752
  <xs:element name="use-package">
1753
    <xs:annotation>
1754
        <xs:documentation>
1755
            <p>This element appears as a child of <code>xsl:package</code> and defines a dependency
1756
            of the containing package on another package, identified by URI in the <code>name</code>
1757
            attribute. The <code>package-version</code> attribute indicates which version of the
1758
            library package is required, or may indicate a range of versions.</p>
1759
        </xs:documentation>
1760
    </xs:annotation>
1761
    <xs:complexType>
1762
      <xs:complexContent mixed="false">
1763
        <xs:extension base="xsl:element-only-versioned-element-type">
1764
          <xs:choice minOccurs="0" maxOccurs="unbounded">
1765
            <xs:element ref="xsl:accept"/>
1766
            <xs:element ref="xsl:override"/>
1767
          </xs:choice>
1768
          <xs:attribute name="name" type="xs:anyURI"/>
1769
          <xs:attribute name="package-version" type="xs:string"/>
1770
          <xs:attribute name="_name" type="xs:string"/>
1771
          <xs:attribute name="_package-version" type="xs:string"/>
1772
        </xs:extension>
1773
      </xs:complexContent>
1774
    </xs:complexType>
1775
  </xs:element>
1776

    
1777
  <xs:element name="value-of" substitutionGroup="xsl:instruction">
1778
    <xs:complexType>
1779
      <xs:complexContent mixed="true">
1780
        <xs:extension base="xsl:sequence-constructor-or-select">
1781
          <xs:attribute name="separator" type="xsl:avt"/>
1782
          <xs:attribute name="disable-output-escaping" type="xsl:yes-or-no" default="no"/>
1783
          <xs:attribute name="_separator" type="xs:string"/>
1784
          <xs:attribute name="_disable-output-escaping" type="xs:string"/>
1785
        </xs:extension>
1786
      </xs:complexContent>
1787
    </xs:complexType>
1788
  </xs:element>
1789

    
1790
  <xs:element name="variable" substitutionGroup="xsl:declaration xsl:instruction">
1791
    <xs:annotation>
1792
        <xs:documentation>
1793
            <p>Declaration of the <code>xsl:variable</code> element, used both for local
1794
            and global variable bindings.</p>
1795
            <p>This definition takes advantage of the ability in XSD 1.1 for an element
1796
                to belong to more than one substitution group. A global variable
1797
                is a declaration, while a local variable can appear as an instruction
1798
                in a sequence constructor.</p>
1799
        </xs:documentation>
1800
    </xs:annotation>
1801
    <xs:complexType>
1802
      <xs:complexContent mixed="true">
1803
        <xs:extension base="xsl:sequence-constructor-or-select">
1804
          <xs:attribute name="name" type="xsl:EQName"/>
1805
          <xs:attribute name="as" type="xsl:sequence-type"/>
1806
          <xs:attribute name="visibility" type="xsl:visibility-type"/>
1807
          <xs:attribute name="static" type="xsl:yes-or-no"/>
1808
          <xs:attribute name="_name" type="xs:string"/>
1809
          <xs:attribute name="_as" type="xs:string"/>
1810
          <xs:attribute name="_visibility" type="xs:string"/>
1811
          <xs:attribute name="_static" type="xs:string"/>
1812
          <xs:assert test="exists(@name | @_name)"/>
1813
          <xs:assert test="if (normalize-space(@static) = 'yes') 
1814
                           then normalize-space(@visibility) = ('', 'private', 'final') 
1815
                           else true()">
1816
            <xs:annotation>
1817
              <xs:documentation>
1818
                <p>When the static attribute is present with the value yes, 
1819
                  the visibility attribute must not have a value other than private 
1820
                  or final.</p>
1821
              </xs:documentation>
1822
            </xs:annotation>
1823
          </xs:assert>
1824
          <xs:assert test="if (normalize-space(@static) = 'yes')
1825
                           then (empty((*,text())) and @select) 
1826
                           else true()">
1827
            <xs:annotation>
1828
              <xs:documentation>
1829
                <p>When the attribute static="yes" is specified, 
1830
                  the xsl:variable element must have empty content,
1831
                  and the select attribute must be present to 
1832
                  define the value of the variable.
1833
                </p>
1834
              </xs:documentation>
1835
            </xs:annotation>
1836
          </xs:assert>          
1837
        </xs:extension>
1838
      </xs:complexContent>
1839
    </xs:complexType>
1840
  </xs:element>
1841

    
1842
  <xs:element name="when">
1843
    <xs:complexType>
1844
      <xs:complexContent mixed="true">
1845
        <xs:extension base="xsl:sequence-constructor">
1846
          <xs:attribute name="test" type="xsl:expression"/>
1847
          <xs:attribute name="_test" type="xs:string"/>
1848
          <xs:assert test="exists(@test | @_test)"/>
1849
        </xs:extension>
1850
      </xs:complexContent>
1851
    </xs:complexType>
1852
  </xs:element>
1853

    
1854
  <xs:element name="with-param">
1855
    <xs:complexType>
1856
      <xs:complexContent mixed="true">
1857
        <xs:extension base="xsl:sequence-constructor-or-select">
1858
          <xs:attribute name="name" type="xsl:EQName"/>
1859
          <xs:attribute name="as" type="xsl:sequence-type"/>
1860
          <xs:attribute name="tunnel" type="xsl:yes-or-no"/>
1861
          <xs:attribute name="_name" type="xs:string"/>
1862
          <xs:attribute name="_as" type="xs:string"/>
1863
          <xs:attribute name="_tunnel" type="xs:string"/>
1864
          <xs:assert test="exists(@name | @_name)"/>
1865
        </xs:extension>
1866
      </xs:complexContent>
1867
    </xs:complexType>
1868
  </xs:element>
1869

    
1870
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1871
  <xs:annotation>
1872
    <xs:documentation> PART C: definition of literal result elements There are three ways to define
1873
      the literal result elements permissible in a stylesheet. (a) do nothing. This allows any
1874
      element to be used as a literal result element, provided it is not in the XSLT namespace (b)
1875
      declare all permitted literal result elements as members of the xsl:literal-result-element
1876
      substitution group (c) redefine the model group xsl:result-elements to accommodate all
1877
      permitted literal result elements. Literal result elements are allowed to take certain
1878
      attributes in the XSLT namespace. These are defined in the attribute group
1879
      literal-result-element-attributes, which can be included in the definition of any literal
1880
      result element. </xs:documentation>
1881
  </xs:annotation>
1882
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1883

    
1884
  <xs:element name="literal-result-element" abstract="true" type="xs:anyType"/>
1885

    
1886
  <xs:attributeGroup name="literal-result-element-attributes">
1887
    <xs:attribute name="default-collation" form="qualified" type="xsl:uri-list"/>
1888
    <xs:attribute name="default-mode" type="xsl:default-mode-type"/>
1889
    <xs:attribute name="default-validation" type="xsl:validation-strip-or-preserve"
1890
      default="strip"/>
1891
    <xs:attribute name="expand-text" type="xsl:yes-or-no"/>
1892
    <xs:attribute name="extension-element-prefixes" form="qualified" type="xsl:prefixes"/>
1893
    <xs:attribute name="exclude-result-prefixes" form="qualified" type="xsl:prefixes"/>
1894
    <xs:attribute name="xpath-default-namespace" form="qualified" type="xs:anyURI"/>
1895
    <xs:attribute name="inherit-namespaces" form="qualified" type="xsl:yes-or-no" default="yes"/>
1896
    <xs:attribute name="use-attribute-sets" form="qualified" type="xsl:EQNames" default=""/>
1897
    <xs:attribute name="use-when" form="qualified" type="xsl:expression"/>
1898
    <xs:attribute name="version" form="qualified" type="xs:decimal"/>
1899
    <xs:attribute name="type" form="qualified" type="xsl:EQName"/>
1900
    <xs:attribute name="validation" form="qualified" type="xsl:validation-type"/>
1901
  </xs:attributeGroup>
1902

    
1903
  <xs:group name="result-elements">
1904
    <xs:choice>
1905
      <xs:element ref="xsl:literal-result-element"/>
1906
      <xs:any namespace="##other" processContents="lax"/>
1907
      <xs:any namespace="##local" processContents="lax"/>
1908
    </xs:choice>
1909
  </xs:group>
1910

    
1911

    
1912
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1913
  <xs:annotation>
1914
    <xs:documentation> PART D: definitions of simple types used in stylesheet attributes
1915
    </xs:documentation>
1916
  </xs:annotation>
1917
  <!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
1918

    
1919
  <xs:simpleType name="avt">
1920
    <xs:annotation>
1921
      <xs:documentation> This type is used for all attributes that allow an attribute value
1922
        template. The general rules for the syntax of attribute value templates, and the specific
1923
        rules for each such attribute, are described in the XSLT 2.1 Recommendation.
1924
      </xs:documentation>
1925
    </xs:annotation>
1926
    <xs:restriction base="xs:string"/>
1927
  </xs:simpleType>
1928
  
1929
  <xs:simpleType name="caching-values">
1930
    <xs:annotation>
1931
      <xs:documentation> One of the values "full", "partial", or "no". </xs:documentation>
1932
    </xs:annotation>
1933
    <xs:restriction base="xs:token">
1934
      <xs:enumeration value="full"/>
1935
      <xs:enumeration value="partial"/>
1936
      <xs:enumeration value="no"/>
1937
    </xs:restriction>
1938
    
1939
  </xs:simpleType>
1940

    
1941
  <xs:simpleType name="char">
1942
    <xs:annotation>
1943
      <xs:documentation> A string containing exactly one character. </xs:documentation>
1944
    </xs:annotation>
1945
    <xs:restriction base="xs:string">
1946
      <xs:length value="1"/>
1947
    </xs:restriction>
1948
  </xs:simpleType>
1949
  
1950
   <xs:simpleType name="component-kind-type">
1951
    <xs:annotation>
1952
      <xs:documentation> Describes a kind of component within a package.
1953
      </xs:documentation>
1954
    </xs:annotation>
1955
    <xs:restriction base="xs:token">
1956
      <xs:enumeration value="template"/>
1957
      <xs:enumeration value="function"/>
1958
      <xs:enumeration value="variable"/>
1959
      <xs:enumeration value="attribute-set"/>
1960
      <xs:enumeration value="mode"/>
1961
    </xs:restriction>
1962
  </xs:simpleType>
1963
  
1964
  <xs:simpleType name="default-mode-type">
1965
    <xs:annotation>
1966
      <xs:documentation> The default-mode attribute of xsl:stylesheet, xsl:transform, 
1967
        xsl:package (or any other xsl:* element): either a QName or #unnamed. 
1968
      </xs:documentation>
1969
    </xs:annotation>
1970
    <xs:union memberTypes="xsl:EQName">
1971
      <xs:simpleType>
1972
        <xs:restriction base="xs:token">
1973
          <xs:enumeration value="#unnamed"/>
1974
        </xs:restriction>
1975
      </xs:simpleType>
1976
    </xs:union>
1977
  </xs:simpleType>
1978

    
1979
  <xs:simpleType name="expression">
1980
    <xs:annotation>
1981
      <xs:documentation> An XPath 2.0 expression. </xs:documentation>
1982
    </xs:annotation>
1983
    <xs:restriction base="xs:token">
1984
      <xs:pattern value=".+"/>
1985
    </xs:restriction>
1986
  </xs:simpleType>
1987

    
1988
  <xs:simpleType name="item-type">
1989
    <xs:annotation>
1990
      <xs:documentation> An XPath 2.1 ItemType</xs:documentation>
1991
    </xs:annotation>
1992
    <xs:restriction base="xs:token">
1993
      <xs:pattern value=".+"/>
1994
    </xs:restriction>
1995
  </xs:simpleType>
1996

    
1997
  <xs:simpleType name="input-type-annotations-type">
1998
    <xs:annotation>
1999
      <xs:documentation> Describes how type annotations in source documents are handled.
2000
      </xs:documentation>
2001
    </xs:annotation>
2002
    <xs:restriction base="xs:token">
2003
      <xs:enumeration value="preserve"/>
2004
      <xs:enumeration value="strip"/>
2005
      <xs:enumeration value="unspecified"/>
2006
    </xs:restriction>
2007
  </xs:simpleType>
2008

    
2009
  <xs:simpleType name="level">
2010
    <xs:annotation>
2011
      <xs:documentation> The level attribute of xsl:number: one of single, multiple, or any.
2012
      </xs:documentation>
2013
    </xs:annotation>
2014
    <xs:restriction base="xs:token">
2015
      <xs:enumeration value="single"/>
2016
      <xs:enumeration value="multiple"/>
2017
      <xs:enumeration value="any"/>
2018
    </xs:restriction>
2019
  </xs:simpleType>
2020

    
2021
  <xs:simpleType name="mode">
2022
    <xs:annotation>
2023
      <xs:documentation> The mode attribute of xsl:apply-templates: either a QName, or #current, or
2024
        #unnamed, or #default. </xs:documentation>
2025
    </xs:annotation>
2026
    <xs:union memberTypes="xsl:EQName">
2027
      <xs:simpleType>
2028
        <xs:restriction base="xs:token">
2029
          <xs:enumeration value="#default"/>
2030
          <xs:enumeration value="#unnamed"/>
2031
          <xs:enumeration value="#current"/>
2032
        </xs:restriction>
2033
      </xs:simpleType>
2034
    </xs:union>
2035
  </xs:simpleType>
2036

    
2037
  <xs:simpleType name="modes">
2038
    <xs:annotation>
2039
      <xs:documentation> The mode attribute of xsl:template: either a list, each member being either
2040
        a QName or #default or #unnamed; or the value #all </xs:documentation>
2041
    </xs:annotation>   
2042
      <xs:union>
2043
        <xs:simpleType>
2044
          <xs:restriction>           
2045
            <xs:simpleType>
2046
              <xs:list>
2047
                <xs:simpleType>
2048
                  <xs:union memberTypes="xsl:EQName">
2049
                    <xs:simpleType>
2050
                      <xs:restriction base="xs:token">
2051
                        <xs:enumeration value="#default"/>
2052
                        <xs:enumeration value="#unnamed"/>
2053
                      </xs:restriction>
2054
                    </xs:simpleType>
2055
                  </xs:union>
2056
                </xs:simpleType>
2057
              </xs:list>
2058
            </xs:simpleType>
2059
            <xs:assertion test="count($value) = count(distinct-values($value))">
2060
              <xs:annotation>
2061
                <xs:documentation>
2062
                  <p>XTSE0550: It is a static error if the same token is included more than once in the list.
2063
                  </p>
2064
                </xs:documentation>
2065
              </xs:annotation>
2066
            </xs:assertion>
2067
          </xs:restriction>
2068
        </xs:simpleType>
2069
        <xs:simpleType>
2070
          <xs:restriction base="xs:token">
2071
            <xs:enumeration value="#all"/>
2072
          </xs:restriction>
2073
        </xs:simpleType>
2074
      </xs:union>     
2075
  </xs:simpleType>
2076

    
2077
  <xs:simpleType name="nametests">
2078
    <xs:annotation>
2079
      <xs:documentation> A list of NameTests, as defined in the XPath 2.0 Recommendation. Each
2080
        NameTest is either a QName, or "*", or "prefix:*", or "*:localname" </xs:documentation>
2081
    </xs:annotation>
2082
    <xs:list>
2083
      <xs:simpleType>
2084
        <xs:union memberTypes="xsl:EQName">
2085
          <xs:simpleType>
2086
            <xs:restriction base="xs:token">
2087
              <xs:enumeration value="*"/>
2088
            </xs:restriction>
2089
          </xs:simpleType>
2090
          <xs:simpleType>
2091
            <xs:restriction base="xs:token">
2092
              <xs:pattern value="\i\c*:\*"/>
2093
              <xs:pattern value="\*:\i\c*"/>
2094
            </xs:restriction>
2095
          </xs:simpleType>
2096
        </xs:union>
2097
      </xs:simpleType>
2098
    </xs:list>
2099
  </xs:simpleType>
2100
  
2101
  <xs:simpleType name="on-multiple-match-type">
2102
    <xs:annotation>
2103
      <xs:documentation> Describes the action to be taken when there are several template rules to match an item in a given mode.
2104
      </xs:documentation>
2105
    </xs:annotation>
2106
    <xs:restriction base="xs:token">
2107
      <xs:enumeration value="use-last"/>
2108
      <xs:enumeration value="fail"/>
2109
    </xs:restriction>
2110
  </xs:simpleType>
2111
  
2112
  <xs:simpleType name="on-no-match-type">
2113
    <xs:annotation>
2114
      <xs:documentation> Describes the action to be taken when there is no template rule to match an item in a given mode.
2115
      </xs:documentation>
2116
    </xs:annotation>
2117
    <xs:restriction base="xs:token">
2118
      <xs:enumeration value="deep-copy"/>
2119
      <xs:enumeration value="shallow-copy"/>
2120
      <xs:enumeration value="deep-skip"/>
2121
      <xs:enumeration value="shallow-skip"/>
2122
      <xs:enumeration value="text-only-copy"/>
2123
      <xs:enumeration value="fail"/>
2124
    </xs:restriction>
2125
  </xs:simpleType>
2126

    
2127
  <xs:simpleType name="prefixes">
2128
    <xs:list itemType="xs:NCName"/>
2129
  </xs:simpleType>
2130

    
2131
  <xs:simpleType name="prefix-list-or-all">
2132
    <xs:union memberTypes="xsl:prefix-list">
2133
      <xs:simpleType>
2134
        <xs:restriction base="xs:token">
2135
          <xs:enumeration value="#all"/>
2136
        </xs:restriction>
2137
      </xs:simpleType>
2138
    </xs:union>
2139
  </xs:simpleType>
2140

    
2141
  <xs:simpleType name="prefix-list">
2142
    <xs:list itemType="xsl:prefix-or-default"/>
2143
  </xs:simpleType>
2144

    
2145
  <xs:simpleType name="method">
2146
    <xs:annotation>
2147
      <xs:documentation> The method attribute of xsl:output: Either one of the recognized names
2148
        "xml", "xhtml", "html", "text", or a QName that must include a prefix. </xs:documentation>
2149
    </xs:annotation>
2150
    <xs:union>
2151
      <xs:simpleType>
2152
        <xs:restriction base="xs:token">
2153
          <xs:enumeration value="xml"/>
2154
          <xs:enumeration value="xhtml"/>
2155
          <xs:enumeration value="html"/>
2156
          <xs:enumeration value="text"/>
2157
        </xs:restriction>
2158
      </xs:simpleType>
2159
      <xs:simpleType>
2160
        <xs:restriction base="xsl:EQName">
2161
          <xs:pattern value="\c*:\c*"/>
2162
        </xs:restriction>
2163
      </xs:simpleType>
2164
    </xs:union>
2165
  </xs:simpleType>
2166

    
2167
  <xs:simpleType name="pattern">
2168
    <xs:annotation>
2169
      <xs:documentation> A match pattern as defined in the XSLT 2.1 Recommendation. The syntax for
2170
        patterns is a restricted form of the syntax for XPath 2.0 expressions. Change since XSLT
2171
        2.0: Patterns may now match any item (not only nodes) </xs:documentation>
2172
    </xs:annotation>
2173
    <xs:restriction base="xsl:expression"/>
2174
  </xs:simpleType>
2175

    
2176
  <xs:simpleType name="prefix-or-default">
2177
    <xs:annotation>
2178
      <xs:documentation> Either a namespace prefix, or #default. Used in the xsl:namespace-alias
2179
        element. </xs:documentation>
2180
    </xs:annotation>
2181
    <xs:union memberTypes="xs:NCName">
2182
      <xs:simpleType>
2183
        <xs:restriction base="xs:token">
2184
          <xs:enumeration value="#default"/>
2185
        </xs:restriction>
2186
      </xs:simpleType>
2187
    </xs:union>
2188
  </xs:simpleType>
2189

    
2190
  <xs:simpleType name="EQNames">
2191
    <xs:annotation>
2192
      <xs:documentation> A list of QNames. Used in the [xsl:]use-attribute-sets attribute of various
2193
        elements, and in the cdata-section-elements attribute of xsl:output </xs:documentation>
2194
    </xs:annotation>
2195
    <xs:list itemType="xsl:EQName"/>
2196
  </xs:simpleType>
2197

    
2198
  <xs:simpleType name="EQName">
2199
    <xs:annotation>
2200
      <xs:documentation> 
2201
        <p>An extended QName. This schema does not use the built-in type xs:QName, but rather
2202
        defines its own QName type. This may be either a local name, or a prefixed QName, or a name written
2203
        using the extended QName notation Q{uri}local</p>
2204
        <p>Although xs:QName would define the correct validation on these
2205
        attributes, a schema processor would expand unprefixed QNames incorrectly when constructing
2206
        the PSVI, because (as defined in XML Schema errata) an unprefixed xs:QName is assumed to be
2207
        in the default namespace, which is not the correct assumption for XSLT. The datatype is therefore
2208
        defined as a union of NCName and QName, so that an unprefixed name will be validated as an 
2209
        NCName and will therefore not be treated as having the semantics of an unprefixed xs:QName. </p>
2210
      </xs:documentation>
2211
    </xs:annotation>
2212
    <xs:union memberTypes="xs:NCName xs:QName">
2213
      <xs:simpleType>
2214
        <xs:restriction base="xs:token">
2215
          <xs:pattern value="Q\{.*\}\i\c*"/>
2216
        </xs:restriction>
2217
      </xs:simpleType>
2218
    </xs:union>
2219
  </xs:simpleType>
2220
  
2221
  <xs:simpleType name="EQName-in-namespace">
2222
    <xs:annotation>
2223
      <xs:documentation> 
2224
        <p>A subtype of EQNames that excludes no-namespace names</p>
2225
      </xs:documentation>
2226
    </xs:annotation>
2227
        <xs:restriction base="xsl:EQName">
2228
          <xs:pattern value="Q\{.+\}.+|\i\c*:.+"/>
2229
        </xs:restriction>
2230
  </xs:simpleType>  
2231
  
2232
  <xs:simpleType name="sequence-type">
2233
    <xs:annotation>
2234
      <xs:documentation> The description of a datatype, conforming to the SequenceType production
2235
        defined in the XPath 2.0 Recommendation </xs:documentation>
2236
    </xs:annotation>
2237
    <xs:restriction base="xs:token">
2238
      <xs:pattern value=".+"/>
2239
    </xs:restriction>
2240
  </xs:simpleType>
2241
  
2242
  <xs:simpleType name="typed-type">
2243
    <xs:annotation>
2244
      <xs:documentation> Describes whether a mode is designed to match typed or untyped nodes.
2245
      </xs:documentation>
2246
    </xs:annotation>
2247
    <xs:restriction base="xs:token">
2248
      <xs:enumeration value="yes"/>
2249
      <xs:enumeration value="no"/>
2250
      <xs:enumeration value="true"/>
2251
      <xs:enumeration value="false"/>
2252
      <xs:enumeration value="1"/>
2253
      <xs:enumeration value="0"/>
2254
      <xs:enumeration value="strict"/>
2255
      <xs:enumeration value="lax"/>
2256
      <xs:enumeration value="unspecified"/>
2257
    </xs:restriction>
2258
  </xs:simpleType>
2259

    
2260
  <xs:simpleType name="uri-list">
2261
    <xs:list itemType="xs:anyURI"/>
2262
  </xs:simpleType>
2263

    
2264
  <xs:simpleType name="validation-strip-or-preserve">
2265
    <xs:annotation>
2266
      <xs:documentation> Describes different ways of type-annotating an element or attribute.
2267
      </xs:documentation>
2268
    </xs:annotation>
2269
    <xs:restriction base="xsl:validation-type">
2270
      <xs:enumeration value="preserve"/>
2271
      <xs:enumeration value="strip"/>
2272
    </xs:restriction>
2273
  </xs:simpleType>
2274

    
2275
  <xs:simpleType name="validation-type">
2276
    <xs:annotation>
2277
      <xs:documentation> Describes different ways of type-annotating an element or attribute.
2278
      </xs:documentation>
2279
    </xs:annotation>
2280
    <xs:restriction base="xs:token">
2281
      <xs:enumeration value="strict"/>
2282
      <xs:enumeration value="lax"/>
2283
      <xs:enumeration value="preserve"/>
2284
      <xs:enumeration value="strip"/>
2285
    </xs:restriction>
2286
  </xs:simpleType>
2287
  
2288
  <xs:simpleType name="visibility-type">
2289
    <xs:annotation>
2290
      <xs:documentation> Describes the visibility of a component within a package.
2291
      </xs:documentation>
2292
    </xs:annotation>
2293
    <xs:restriction base="xs:token">
2294
      <xs:enumeration value="public"/>
2295
      <xs:enumeration value="private"/>
2296
      <xs:enumeration value="final"/>
2297
      <xs:enumeration value="abstract"/>
2298
      <xs:enumeration value="hidden"/>
2299
    </xs:restriction>
2300
  </xs:simpleType>
2301
  
2302
  <xs:simpleType name="visibility-not-hidden-type">
2303
    <xs:annotation>
2304
      <xs:documentation> Describes the visibility of a component within a package.
2305
      </xs:documentation>
2306
    </xs:annotation>
2307
    <xs:restriction base="xsl:visibility-type">
2308
      <xs:enumeration value="public"/>
2309
      <xs:enumeration value="private"/>
2310
      <xs:enumeration value="final"/>
2311
      <xs:enumeration value="abstract"/>
2312
    </xs:restriction>
2313
  </xs:simpleType>
2314

    
2315
  <xs:simpleType name="yes-or-no">
2316
    <xs:annotation>
2317
      <xs:documentation> One of the values "yes" or "no": the values "true" or "false", or "1" or "0" are accepted as synonyms. </xs:documentation>
2318
    </xs:annotation>
2319
    <xs:restriction base="xs:token">
2320
      <xs:enumeration value="yes"/>
2321
      <xs:enumeration value="no"/>
2322
      <xs:enumeration value="true"/>
2323
      <xs:enumeration value="false"/>
2324
      <xs:enumeration value="1"/>
2325
      <xs:enumeration value="0"/>
2326
    </xs:restriction>
2327
  </xs:simpleType>
2328

    
2329
  <xs:simpleType name="yes-or-no-or-omit">
2330
    <xs:annotation>
2331
      <xs:documentation> One of the values "yes" or "no" or "omit". 
2332
        The values "true" or "false", or "1" or "0" are accepted as synonyms of "yes" and "no" respectively.</xs:documentation>
2333
    </xs:annotation>
2334
    <xs:restriction base="xs:token">
2335
      <xs:enumeration value="yes"/>
2336
      <xs:enumeration value="no"/>
2337
      <xs:enumeration value="true"/>
2338
      <xs:enumeration value="false"/>
2339
      <xs:enumeration value="1"/>
2340
      <xs:enumeration value="0"/>
2341
      <xs:enumeration value="omit"/>
2342
    </xs:restriction>
2343
  </xs:simpleType>
2344
  
2345
  <xs:simpleType name="zero-digit">
2346
    <xs:annotation>
2347
      <xs:documentation> A digit that has the numerical value zero. </xs:documentation>
2348
    </xs:annotation>
2349
    <xs:restriction base="xsl:char">
2350
      <xs:pattern value="\p{Nd}"/>
2351
      <xs:assertion test="matches(string-join(codepoints-to-string(for $i in 0 to 9 
2352
                          return string-to-codepoints($value) + $i), ''), '\p{Nd}{10}')"/>
2353
    </xs:restriction>
2354
  </xs:simpleType>
2355

    
2356
</xs:schema>
    (1-1/1)