-
Notifications
You must be signed in to change notification settings - Fork 1
/
Inventory.xsd
58 lines (51 loc) · 1.85 KB
/
Inventory.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
<?xml version="1.1" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.1" targetNamespace="https://example.com/inventory" xmlns="https://example.com/inventory" elementFormDefault="qualified">
<!--
Entry point
-->
<xs:element name="inventory">
<!-- Add an on-hover annotation for this element -->
<xs:annotation>
<xs:documentation>
An inventory of things that a person might own
</xs:documentation>
</xs:annotation>
<!-- Define the type of the element, in this case only a "garage" child is allowed -->
<xs:complexType>
<xs:sequence>
<xs:element ref="garage"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- Define a garage element, referenced from "inventory" -->
<xs:element name="garage">
<!-- Add an on-hover annotation for this element -->
<xs:annotation>
<xs:documentation>
A collection of vehicles that a person owns
</xs:documentation>
</xs:annotation>
<!-- Define that any amount of "car", "bicycle" or "motorbike" elements are allowed as children -->
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="car"></xs:element>
<xs:element name="bicycle"></xs:element>
<xs:element name="motorbike"></xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- Define a car element -->
<xs:element name="car">
<!-- Add an on-hover annotation for this element -->
<xs:annotation>
<xs:documentation>
A motorcar, you know, with wheels
</xs:documentation>
</xs:annotation>
<!-- Define the allowed attributes of a "car" -->
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required" />
<xs:attribute name="wheels" type="xs:integer" />
</xs:complexType>
</xs:element>
</xs:schema>