| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<xs:schema xmlns="ns" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="ns" > |
| 3 |
|
| 4 |
<xs:element name="patterns"> |
| 5 |
<xs:complexType> |
| 6 |
<xs:sequence> |
| 7 |
<xs:element name="ISBN" type="ISBNType" minOccurs="0" maxOccurs="unbounded"/> |
| 8 |
<xs:element name="ZipCode" type="better-us-zipcode" minOccurs="0" maxOccurs="unbounded"/> |
| 9 |
<xs:element name="BasicString" type="basic-latin-string" minOccurs="0" maxOccurs="unbounded"/> |
| 10 |
<xs:element name="LatinString" type="latin-1-string" minOccurs="0" maxOccurs="unbounded"/> |
| 11 |
<xs:element name="Prefix" type="prefix-name" minOccurs="0" maxOccurs="unbounded"/> |
| 12 |
<xs:element name="Timestamp" type="TimestampType" minOccurs="0" maxOccurs="unbounded"/> |
| 13 |
<xs:element name="Digits" type="DigitsType" minOccurs="0" maxOccurs="unbounded"/> |
| 14 |
<xs:element name="Word" type="Word5Type" minOccurs="0" maxOccurs="unbounded"/> |
| 15 |
<xs:element name="NoWord" type="NotWord5Type" minOccurs="0" maxOccurs="unbounded"/> |
| 16 |
<xs:element name="CRS" type="crsCodeType" minOccurs="0" maxOccurs="unbounded"/> |
| 17 |
<xs:element name="CRSw" type="crsCodeTypeWrong" minOccurs="0" maxOccurs="unbounded"/> |
| 18 |
</xs:sequence> |
| 19 |
</xs:complexType> |
| 20 |
</xs:element> |
| 21 |
|
| 22 |
<xs:simpleType name="ISBNType"> |
| 23 |
<xs:restriction base="xs:ID"> |
| 24 |
<xs:pattern value="b\d{13}"/> |
| 25 |
</xs:restriction> |
| 26 |
</xs:simpleType> |
| 27 |
|
| 28 |
<xs:simpleType name='better-us-zipcode'> |
| 29 |
<xs:restriction base='xs:string'> |
| 30 |
<xs:pattern value='[0-9]{5}(-[0-9]{4})?'/> |
| 31 |
</xs:restriction> |
| 32 |
</xs:simpleType> |
| 33 |
|
| 34 |
<xs:simpleType name="basic-latin-string"> |
| 35 |
<xs:restriction base="xs:string"> |
| 36 |
<xs:pattern value="\p{IsBasicLatin}*"/> |
| 37 |
</xs:restriction> |
| 38 |
</xs:simpleType> |
| 39 |
|
| 40 |
<xs:simpleType name="latin-1-string"> |
| 41 |
<xs:restriction base="xs:string"> |
| 42 |
<xs:pattern value="[\p{IsBasicLatin}\p{IsLatin-1Supplement}]*"/> |
| 43 |
</xs:restriction> |
| 44 |
</xs:simpleType> |
| 45 |
|
| 46 |
<xs:simpleType name="prefix-name"> |
| 47 |
<xs:restriction base="xs:Name"> |
| 48 |
<xs:pattern value="[\i-[:]][\c-[:]]*: [\i-[:]][\c-[:]]+:.+" /> |
| 49 |
</xs:restriction> |
| 50 |
</xs:simpleType> |
| 51 |
|
| 52 |
<xs:simpleType name="TOKEN"> |
| 53 |
<xs:restriction base="xs:token"> |
| 54 |
<xs:pattern value="(\p{L}|\p{N}|\p{P}|\p{S})+"/> |
| 55 |
</xs:restriction> |
| 56 |
</xs:simpleType> |
| 57 |
|
| 58 |
<xs:simpleType name="TimestampType"> |
| 59 |
<xs:restriction base="xs:string"> |
| 60 |
<xs:pattern value=".+T.+(Z|[+-].+)"/> |
| 61 |
</xs:restriction> |
| 62 |
</xs:simpleType> |
| 63 |
|
| 64 |
<xs:simpleType name="DigitsType"> |
| 65 |
<xs:restriction base="xs:string"> |
| 66 |
<xs:pattern value="[\S' ']{1,50}"/> |
| 67 |
</xs:restriction> |
| 68 |
</xs:simpleType> |
| 69 |
|
| 70 |
<!-- Issue 079 --> |
| 71 |
<xs:simpleType name="issue079Type"> |
| 72 |
<xs:restriction base="xs:string"> |
| 73 |
<xs:pattern value="[^\n\t]+"/> |
| 74 |
</xs:restriction> |
| 75 |
</xs:simpleType> |
| 76 |
|
| 77 |
<!-- Pull Request 114 --> |
| 78 |
<xs:simpleType name="Word5Type"> |
| 79 |
<xs:restriction base="xs:string"> |
| 80 |
<xs:pattern value='[\w]{0,5}'/> |
| 81 |
</xs:restriction> |
| 82 |
</xs:simpleType> |
| 83 |
|
| 84 |
<xs:simpleType name="NotWord5Type"> |
| 85 |
<xs:restriction base="xs:string"> |
| 86 |
<xs:pattern value='[\W]{0,5}'/> |
| 87 |
</xs:restriction> |
| 88 |
</xs:simpleType> |
| 89 |
|
| 90 |
<!-- Issue 429 --> |
| 91 |
<xs:simpleType name="crsCodeType"> |
| 92 |
<xs:restriction base="xs:string"> |
| 93 |
<xs:pattern value="|.{3}"/> |
| 94 |
</xs:restriction> |
| 95 |
</xs:simpleType> |
| 96 |
|
| 97 |
<xs:simpleType name="crsCodeTypeWrong"> |
| 98 |
<xs:restriction base="xs:string"> |
| 99 |
<xs:pattern value="^$|.{3}"/> |
| 100 |
</xs:restriction> |
| 101 |
</xs:simpleType> |
| 102 |
|
| 103 |
</xs:schema> |