This repository has been archived by the owner on Jan 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.xsd
102 lines (91 loc) · 3.5 KB
/
schema.xsd
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
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<!-- Define types -->
<xs:simpleType name="dateType">
<xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType name="decimalType">
<xs:restriction base="xs:decimal"/>
</xs:simpleType>
<xs:simpleType name="phoneType">
<xs:restriction base="xs:string">
<xs:pattern value="\+\d{1,}"/>
</xs:restriction>
</xs:simpleType>
<!-- Define elements -->
<xs:element name="catalogue">
<xs:complexType>
<xs:sequence>
<xs:element name="employeesList">
<xs:complexType>
<xs:sequence>
<xs:element name="employee" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="personData" type="personDataType"/>
<xs:element name="employeeData" type="employeeDataType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="departmentsList">
<xs:complexType>
<xs:sequence>
<xs:element name="department" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="departmentName" type="xs:string"/>
<xs:element name="manager" type="managerType"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="personDataType">
<xs:sequence>
<xs:element name="firstName" type="xs:string"/>
<xs:element name="middleName" type="xs:string"/>
<xs:element name="lastName" type="xs:string"/>
<xs:element name="id" type="xs:string"/>
<xs:element name="birthday" type="dateType"/>
<xs:element name="telephoneNumber" type="phoneType"/>
<xs:element name="residenceData" type="residenceDataType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="residenceDataType">
<xs:sequence>
<xs:element name="country" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="zipCode" type="xs:string"/>
<xs:element name="address" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="employeeDataType">
<xs:sequence>
<xs:element name="departmentName" type="xs:string"/>
<xs:element name="workweek" type="xs:string"/>
<xs:element name="salary" type="decimalType"/>
<xs:element name="employmentType" type="xs:string"/>
<xs:element name="positionInCompany" type="positionType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="positionType">
<xs:sequence>
<xs:element name="positionName" type="xs:string"/>
<xs:element name="startDate" type="dateType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="managerType">
<xs:attribute name="firstNameRef" type="xs:string" use="required"/>
<xs:attribute name="lastNameRef" type="xs:string" use="required"/>
<xs:attribute name="idRef" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>