File: patterns.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 (103 lines) | stat: -rw-r--r-- 3,842 bytes parent folder | download
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns="ns" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ns" >

    <xs:element name="patterns">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ISBN" type="ISBNType" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="ZipCode" type="better-us-zipcode" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="BasicString" type="basic-latin-string" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="LatinString" type="latin-1-string" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="Prefix" type="prefix-name" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="Timestamp" type="TimestampType" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="Digits" type="DigitsType" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="Word" type="Word5Type" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="NoWord" type="NotWord5Type" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="CRS" type="crsCodeType" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="CRSw" type="crsCodeTypeWrong" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="ISBNType">
        <xs:restriction base="xs:ID">
            <xs:pattern value="b\d{13}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name='better-us-zipcode'>
        <xs:restriction base='xs:string'>
            <xs:pattern value='[0-9]{5}(-[0-9]{4})?'/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="basic-latin-string">
        <xs:restriction base="xs:string">
            <xs:pattern value="\p{IsBasicLatin}*"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="latin-1-string">
        <xs:restriction base="xs:string">
            <xs:pattern value="[\p{IsBasicLatin}\p{IsLatin-1Supplement}]*"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="prefix-name">
        <xs:restriction base="xs:Name">
            <xs:pattern value="[\i-[:]][\c-[:]]*: [\i-[:]][\c-[:]]+:.+" />
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TOKEN">
        <xs:restriction base="xs:token">
            <xs:pattern value="(\p{L}|\p{N}|\p{P}|\p{S})+"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="TimestampType">
        <xs:restriction base="xs:string">
            <xs:pattern value=".+T.+(Z|[+-].+)"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="DigitsType">
        <xs:restriction base="xs:string">
            <xs:pattern value="[\S' ']{1,50}"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Issue 079 -->
    <xs:simpleType name="issue079Type">
        <xs:restriction base="xs:string">
            <xs:pattern value="[^\n\t]+"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Pull Request 114 -->
    <xs:simpleType name="Word5Type">
        <xs:restriction base="xs:string">
            <xs:pattern value='[\w]{0,5}'/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="NotWord5Type">
        <xs:restriction base="xs:string">
            <xs:pattern value='[\W]{0,5}'/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Issue 429 -->
    <xs:simpleType name="crsCodeType">
        <xs:restriction base="xs:string">
            <xs:pattern value="|.{3}"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="crsCodeTypeWrong">
        <xs:restriction base="xs:string">
            <xs:pattern value="^$|.{3}"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>