Project

Profile

Help

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

he / tags / 9.6.0.8 / samples / data / books1.xsd @ 02f8308b

1
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
2

    
3
 <xs:element name="BOOKLIST">
4
  <xs:complexType>
5
   <xs:sequence>
6
    <xs:element ref="BOOKS"/>
7
    <xs:element ref="CATEGORIES"/>
8
   </xs:sequence>
9
  </xs:complexType>
10
 </xs:element>
11

    
12
 <xs:element name="BOOKS">
13
  <xs:complexType>
14
   <xs:sequence>
15
    <xs:element ref="ITEM" maxOccurs="unbounded"/>
16
   </xs:sequence>
17
  </xs:complexType>
18
 </xs:element>
19

    
20
 <xs:element name="CATEGORIES">
21
  <xs:complexType mixed="true">
22
   <xs:sequence minOccurs="0" maxOccurs="unbounded">
23
    <xs:element ref="CATEGORY"/>
24
   </xs:sequence>
25
   <xs:attribute name="DESC" type="xs:string" use="required"/>
26
  </xs:complexType>
27
 </xs:element>
28
 <xs:element name="CATEGORY">
29
  <xs:complexType>
30
   <xs:attribute name="CODE" type="xs:ID" use="required"/>
31
   <xs:attribute name="DESC" type="xs:string" use="required"/>
32
   <xs:attribute name="NOTE" type="xs:string" use="optional"/>
33
  </xs:complexType>
34
 </xs:element>
35

    
36
 <xs:element name="ITEM">
37
  <xs:complexType>
38
   <xs:sequence>
39
    <xs:element name="TITLE" type="xs:string"/>
40
    <xs:element name="AUTHOR" type="xs:string"/>
41
    <xs:element name="PUBLISHER" type="xs:string"/>
42
    <xs:element name="PUB-DATE" type="xs:date"/>
43
    <xs:element name="LANGUAGE" type="languageType"/>
44
    <xs:element name="PRICE" type="moneyType"/>
45
    <xs:element name="QUANTITY" type="xs:integer"/>
46
    <xs:element name="ISBN" type="ISBNType"/>                      
47
    <xs:element name="PAGES" type="xs:integer"/>
48
    <xs:element name="DIMENSIONS" type="dimensionsType"/>
49
    <xs:element name="WEIGHT" type="weightType"/>
50
   </xs:sequence>
51
   <xs:attribute name="CAT" type="xs:IDREF" use="required"/>
52
   <xs:attribute name="TAX" type="xs:NMTOKEN" use="optional" default="V"/>
53
  </xs:complexType>
54
 </xs:element>
55
 
56
 <xs:simpleType name="languageType">
57
  <xs:restriction base="xs:string">
58
   <xs:enumeration value="English"/>
59
   <xs:enumeration value="French"/>
60
   <xs:enumeration value="German"/>
61
   <xs:enumeration value="Spanish"/>
62
  </xs:restriction>
63
 </xs:simpleType>
64
 
65
 <xs:complexType name="moneyType">
66
  <xs:simpleContent>
67
   <xs:extension base="xs:decimal">
68
    <xs:attribute name="currency" type="currencyType"/>
69
   </xs:extension> 
70
  </xs:simpleContent>
71
 </xs:complexType>
72
 
73
 <xs:simpleType name="currencyType">
74
  <xs:restriction base="xs:string">
75
   <xs:enumeration value="USD"/>
76
   <xs:enumeration value="GBP"/>
77
   <xs:enumeration value="EUR"/>
78
   <xs:enumeration value="CAD"/>
79
  </xs:restriction>
80
 </xs:simpleType> 
81
 
82
 <xs:simpleType name="ISBNType">
83
  <xs:restriction base="xs:string">
84
   <xs:pattern value="[0-9]{9}[0-9X]"/>
85
  </xs:restriction>
86
 </xs:simpleType>     
87
 
88
 <xs:complexType name="dimensionsType">
89
  <xs:simpleContent>
90
   <xs:extension base="dimensionsContentType"> 
91
    <xs:attribute name="UNIT" type="lengthUnitType"/>
92
   </xs:extension> 
93
  </xs:simpleContent>
94
 </xs:complexType>
95
 
96
 <xs:simpleType name="dimensionsContentType">
97
  <xs:restriction>
98
   <xs:simpleType>
99
    <xs:list itemType="dimensionType"/>
100
   </xs:simpleType>     
101
   <xs:length value="3"/>
102
  </xs:restriction>
103
 </xs:simpleType>  
104
 
105
 <xs:simpleType name="lengthUnitType">
106
  <xs:restriction base="xs:string">
107
   <xs:enumeration value="in"/>
108
   <xs:enumeration value="cm"/>
109
  </xs:restriction>
110
 </xs:simpleType> 
111
 
112
 <xs:simpleType name="dimensionType">
113
  <xs:restriction base="xs:decimal">
114
   <xs:minExclusive value="0.00"/>
115
  </xs:restriction>
116
 </xs:simpleType> 
117
 
118
 <xs:complexType name="weightType">
119
  <xs:simpleContent>
120
   <xs:extension base="xs:decimal">
121
    <xs:attribute name="UNIT" type="weightUnitType"/>
122
   </xs:extension> 
123
  </xs:simpleContent>
124
 </xs:complexType>
125
 
126
 <xs:simpleType name="weightUnitType">
127
  <xs:restriction base="xs:string">
128
   <xs:enumeration value="oz"/>
129
   <xs:enumeration value="g"/>
130
  </xs:restriction>
131
 </xs:simpleType>    
132
    
133
</xs:schema>
(6-6/12)