-
Notifications
You must be signed in to change notification settings - Fork 0
/
ax25c.xsd
138 lines (127 loc) · 4.79 KB
/
ax25c.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Project: ax25c - File: ax25c_config.cpp
* Copyright (C) 2019 - Tania Hagn - tania@df9ry.de
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tp="http://df9ry.ampr.org/ax25c"
targetNamespace="http://df9ry.ampr.org/ax25c"
elementFormDefault="qualified">
<!-- The root element always have to be a Configuration -->
<xs:element name="Configuration" type="tp:ConfigurationType">
<xs:key name="ServerEndPointUrlKey">
<xs:selector
xpath="tp:Plugins/tp:Plugin/tp:Instances/tp:Instance/tp:ServerEndPoint"/>
<xs:field xpath="@url"/>
</xs:key>
<xs:keyref name="ServerEndPointUrlRef" refer="tp:ServerEndPointUrlKey">
<xs:selector
xpath="tp:Plugins/tp:Plugin/tp:Instances/tp:Instance/tp:ClientEndPoint"/>
<xs:field xpath="@url"/>
</xs:keyref>
</xs:element>
<!-- A Configuration has Settings and Plugins -->
<xs:complexType name="ConfigurationType">
<xs:sequence>
<xs:element name="Settings" type="tp:SettingsType"
minOccurs="0" maxOccurs="1">
<xs:unique name="ConfigurationSettingsUnique">
<xs:selector xpath="tp:Setting"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="Plugins" type="tp:PluginsType"
minOccurs="0" maxOccurs="1">
<xs:unique name="ConfigurationPluginsUnique">
<xs:selector xpath="tp:Plugin"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:Name" use="required"/>
</xs:complexType>
<!-- List of Plugins -->
<xs:complexType name="PluginsType">
<xs:sequence>
<xs:element name="Plugin" type="tp:PluginType"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!--
A Plugin has a name and optionally a file to load the
Plugin from. If no file is specified this is a builtin
Plugin. It can have any number of Settings.
A Plugin can instantiate any number of instances.
-->
<xs:complexType name="PluginType">
<xs:sequence>
<xs:element name="Settings" type="tp:SettingsType"
minOccurs="0" maxOccurs="1">
<xs:unique name="PluginSettingsUnique">
<xs:selector xpath="tp:Setting"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
<xs:element name="Instances" type="tp:InstancesType"
minOccurs="0" maxOccurs="1">
<xs:unique name="PluginInstancesUnique">
<xs:selector xpath="tp:Instance"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:Name" use="required"/>
<xs:attribute name="file" type="xs:string" use="required"/>
</xs:complexType>
<!-- List of Settings -->
<xs:complexType name="SettingsType">
<xs:sequence>
<xs:element name="Setting" type="tp:SettingType"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!-- Every Setting has a name and a value (text-node) -->
<xs:complexType name="SettingType">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<!-- List of Instances -->
<xs:complexType name="InstancesType">
<xs:sequence>
<xs:element name="Instance" type="tp:InstanceType"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<!--
An Instance is a concrete realisation of a Plugin. Every
Instance have to have a unique name and can have any number
of Settings.
-->
<xs:complexType name="InstanceType">
<xs:sequence>
<xs:element name="Settings" type="tp:SettingsType"
minOccurs="0" maxOccurs="1">
<xs:unique name="InstanceSettingsUnique">
<xs:selector xpath="tp:Setting"/>
<xs:field xpath="@name"/>
</xs:unique>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:Name" use="required"/>
</xs:complexType>
</xs:schema>