File: complex-with-simple-content-restriction.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 (21 lines) | stat: -rw-r--r-- 662 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
<?xml version="1.0" encoding="UTF-8"?>
<!-- Extends an attribute-only complexType with a simple content -->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="value" type="int-node"/>

    <xs:complexType name="node-type" mixed="true">
        <xs:attribute name="choice" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="int-node">
        <xs:simpleContent>
            <xs:restriction base="node-type">
                <xs:simpleType>
                    <xs:restriction base="xs:int"/>
                </xs:simpleType>
            </xs:restriction>
        </xs:simpleContent>
    </xs:complexType>

</xs:schema>