-
Notifications
You must be signed in to change notification settings - Fork 4
/
topo.xsd
85 lines (85 loc) · 3.09 KB
/
topo.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
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"
>
<xs:element name="interface">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="name" use="required"/>
<xs:attribute type="xs:string" name="external" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="interfaces">
<xs:complexType>
<xs:sequence>
<xs:element ref="interface" maxOccurs="unbounded" minOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="switch">
<xs:complexType>
<xs:sequence>
<xs:element ref="interfaces" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute type="xs:string" name="name" use="required"/>
</xs:complexType>
<xs:unique name="unique_interfaces">
<xs:selector xpath="interfaces/interface"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="shared_interface">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute type="xs:string" name="switch" use="required"/>
<xs:attribute type="xs:string" name="interface" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="sides">
<xs:complexType>
<xs:sequence>
<xs:element ref="shared_interface" maxOccurs="2" minOccurs="2"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="link">
<xs:complexType>
<xs:sequence>
<xs:element ref="sides"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="switches">
<xs:complexType>
<xs:sequence>
<xs:element ref="switch" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:unique name="unique_switchname">
<xs:selector xpath="switch"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="links">
<xs:complexType>
<xs:sequence>
<xs:element ref="link" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="network" vc:minVersion="1.1">
<xs:complexType>
<xs:sequence>
<xs:element ref="switches"/>
<xs:element ref="links"/>
</xs:sequence>
<!-- Why must you hurt me XML -->
<xs:assert id="a" test="every $si in //shared_interface satisfies //switches/switch[@name=$si/@switch]/interfaces/interface[@name=$si/@interface]"/>
</xs:complexType>
</xs:element>
</xs:schema>