File: invalid_models2.xsd

package info (click to toggle)
python-xmlschema 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,208 kB
  • sloc: python: 39,174; xml: 1,282; makefile: 36
file content (42 lines) | stat: -rw-r--r-- 1,541 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="UTF-8"?>
<!-- Schema test for invalid XSD 1.0 models: UPA violations that involve wildcards and elements. -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           targetNamespace="http://xmlschema.test/ns"
           xmlns="http://xmlschema.test/ns"
           xmlns:other-ns="http://xmlschema.test/other-ns">

    <xs:import namespace='http://xmlschema.test/other-ns' schemaLocation='other-ns.xsd'/>

    <xs:element name="elem0" type="xs:string"/>

    <!-- UPA violation (any with minOccurs < maxOccurs and ambiguity with elem0 validation) -->
    <xs:element name='elem1'>
        <xs:complexType>
            <xs:sequence>
                <xs:any namespace='##targetNamespace' minOccurs='0'/>
                <xs:element ref='elem0'/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- UPA violation (any and elem0 overlap and choice model) -->
    <xs:element name='elem2'>
        <xs:complexType>
            <xs:choice>
                <xs:any namespace='##targetNamespace'/>
                <xs:element ref='elem0'/>
            </xs:choice>
        </xs:complexType>
    </xs:element>

    <!-- UPA violation (any with minOccurs < maxOccurs and ambiguity with other-ns:elem0) -->
    <xs:element name='elem3'>
        <xs:complexType>
            <xs:sequence>
                <xs:any namespace='##other' minOccurs='0'/>
                <xs:element ref='other-ns:elem0'/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

</xs:schema>