domain.xsd 9.22 KB
Newer Older
ankraft's avatar
ankraft committed
1
<?xml version="1.0" encoding="UTF-8"?>
ankraft's avatar
ankraft committed
2 3 4 5 6 7 8 9 10 11 12
<!--
  - domain.rng
  -
  - Version 3.0
  -
  - This work is released by the Smarthome Task Force of the HGI (Home
  - Gateway Initative), October 2015.
  - The work is created and released under the Apache License Version 2.0 .
  - See the license text at http://www.apache.org/licenses/LICENSE-2.0 for
  - full details.
-->
ankraft's avatar
ankraft committed
13 14 15 16 17
<xs:schema targetNamespace="http://homegatewayinitiative.org/xml/dal/3.0" 
	   xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
	  
 elementFormDefault="qualified">
ankraft's avatar
ankraft committed
18
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
ankraft's avatar
ankraft committed
19 20 21
  <xs:element name="Domain">
    <xs:complexType>
      <xs:sequence>
22
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
23
        <xs:element minOccurs="0" ref="Imports"/>
ankraft's avatar
ankraft committed
24 25 26
        <xs:element minOccurs="0" name="Modules">
          <xs:complexType>
            <xs:sequence>
ankraft's avatar
ankraft committed
27
              <xs:element maxOccurs="unbounded" ref="ModuleClass"/>
ankraft's avatar
ankraft committed
28 29 30 31 32 33 34 35 36
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element minOccurs="0" ref="Devices"/>
      </xs:sequence>
      <xs:attribute ref="xml:base"/>
      <xs:attribute name="id" use="required" type="xs:ID"/>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
37 38 39
  <xs:element name="Imports">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
40
        <xs:element maxOccurs="unbounded" ref="Domain"/>
ankraft's avatar
ankraft committed
41 42 43
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
44 45 46 47
  <xs:element name="ModuleClass" type="ModuleDef"/>
  <xs:element name="Devices">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
48
        <xs:element maxOccurs="unbounded" ref="Device"/>
ankraft's avatar
ankraft committed
49 50 51 52 53 54
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Device">
    <xs:complexType>
      <xs:sequence>
55
        <xs:group ref="DocDef"/>
56
        <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
57 58 59 60 61 62 63 64 65
        <xs:element minOccurs="0" ref="Modules"/>
        <xs:element minOccurs="0" ref="SubDevices"/>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:Name"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="SubDevices">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
66
        <xs:element maxOccurs="unbounded" ref="SubDevice"/>
ankraft's avatar
ankraft committed
67 68 69
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
70 71 72
  <xs:element name="SubDevice">
    <xs:complexType>
      <xs:sequence>
73
        <xs:group ref="DocDef"/>
74
        <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
75 76 77 78 79
        <xs:element minOccurs="0" ref="Modules"/>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:Name"/>
    </xs:complexType>
  </xs:element>
80
  <xs:element name="Properties">
81 82
    <xs:complexType>
      <xs:sequence>
83
        <xs:element maxOccurs="unbounded" ref="Property"/>
84 85 86
      </xs:sequence>
    </xs:complexType>
  </xs:element>
87
  <xs:element name="Property">
88 89 90 91 92 93 94 95 96 97
    <xs:complexType>
      <xs:sequence>
        <xs:group ref="DocDef"/>
        <xs:element ref="SimpleType"/>
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
      <xs:attribute name="value"/>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
98
  <xs:element name="DataType">
ankraft's avatar
ankraft committed
99 100
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
101 102 103 104 105 106 107
        <xs:group ref="DocDef"/>
        <xs:choice>
          <xs:element ref="Struct"/>
          <xs:element ref="Array"/>
          <xs:element ref="SimpleType"/>
        </xs:choice>
        <xs:element minOccurs="0" ref="Constraints"/>
ankraft's avatar
ankraft committed
108 109
      </xs:sequence>
      <xs:attribute name="name"/>
ankraft's avatar
ankraft committed
110
      <xs:attribute name="unitOfMeasure"/>
ankraft's avatar
ankraft committed
111 112
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
113
  <xs:element name="Struct">
ankraft's avatar
ankraft committed
114 115
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
116
        <xs:element maxOccurs="unbounded" ref="DataType"/>
ankraft's avatar
ankraft committed
117 118 119
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
120 121 122 123 124 125 126 127
  <xs:element name="Array">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DataType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="SimpleType">
ankraft's avatar
ankraft committed
128 129 130 131 132
    <xs:complexType>
      <xs:attribute name="type" use="required" type="BasicType"/>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="BasicType">
ankraft's avatar
ankraft committed
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
    <xs:restriction base="xs:token">
      <xs:enumeration value="integer"/>
      <xs:enumeration value="boolean"/>
      <xs:enumeration value="string"/>
      <xs:enumeration value="byte"/>
      <xs:enumeration value="float"/>
      <xs:enumeration value="array"/>
      <xs:enumeration value="enum"/>
      <xs:enumeration value="date"/>
      <xs:enumeration value="time"/>
      <xs:enumeration value="datetime"/>
      <xs:enumeration value="blob"/>
      <xs:enumeration value="uri"/>
    </xs:restriction>
  </xs:simpleType>
ankraft's avatar
ankraft committed
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
  <xs:element name="Constraints">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Constraint"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Constraint">
    <xs:complexType>
      <xs:group ref="DocDef"/>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="type" type="BasicType"/>
      <xs:attribute name="value"/>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
163 164 165 166 167 168 169 170 171 172 173 174
  <xs:group name="DocText">
    <xs:sequence>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element ref="em"/>
        <xs:element ref="b"/>
        <xs:element ref="tt"/>
      </xs:choice>
    </xs:sequence>
  </xs:group>
  <xs:element name="em" type="xs:string"/>
  <xs:element name="b" type="xs:string"/>
  <xs:element name="tt" type="xs:string"/>
175 176
  <!-- <Doc> element is always optional -->
  <xs:group name="DocDef">
ankraft's avatar
ankraft committed
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
    <xs:sequence>
      <xs:element minOccurs="0" ref="Doc"/>
    </xs:sequence>
  </xs:group>
  <xs:element name="Doc">
    <xs:complexType mixed="true">
      <xs:choice>
        <xs:group ref="DocText"/>
        <xs:choice minOccurs="0" maxOccurs="unbounded">
          <xs:element ref="p"/>
          <xs:element ref="img"/>
        </xs:choice>
      </xs:choice>
    </xs:complexType>
  </xs:element>
  <xs:element name="p">
    <xs:complexType mixed="true">
      <xs:group ref="DocText"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="img">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="caption"/>
      </xs:sequence>
      <xs:attribute name="src" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="caption" type="xs:string"/>
  <xs:complexType name="ModuleDef">
    <xs:sequence>
      <xs:element minOccurs="0" ref="extends"/>
209
      <xs:group ref="DocDef"/>
210
      <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
      <xs:element minOccurs="0" ref="Actions"/>
      <xs:element minOccurs="0" ref="Data"/>
      <xs:element minOccurs="0" ref="Events"/>
    </xs:sequence>
    <xs:attribute name="name" use="required"/>
    <xs:attribute name="optional" type="xs:boolean"/>
  </xs:complexType>
  <xs:element name="extends">
    <xs:complexType>
      <xs:attribute name="domain" use="required" type="xs:IDREF"/>
      <xs:attribute name="class" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Modules">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
227
        <xs:element maxOccurs="unbounded" ref="Module"/>
ankraft's avatar
ankraft committed
228 229 230 231 232 233 234
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Module" type="ModuleDef"/>
  <xs:element name="Actions">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
235
        <xs:element maxOccurs="unbounded" ref="Action"/>
ankraft's avatar
ankraft committed
236 237 238 239 240 241
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Action">
    <xs:complexType>
      <xs:sequence>
242
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
243
        <xs:element minOccurs="0" ref="DataType"/>
244
        <xs:element minOccurs="0" ref="Args"/>
ankraft's avatar
ankraft committed
245 246 247 248 249
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
250 251 252
  <xs:element name="Args">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
253
        <xs:element maxOccurs="unbounded" ref="Arg"/>
254 255 256
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
257 258
  <xs:element name="Arg">
    <xs:complexType>
ankraft's avatar
ankraft committed
259
      <xs:sequence>
260
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
261
        <xs:element ref="DataType"/>
ankraft's avatar
ankraft committed
262
      </xs:sequence>
ankraft's avatar
ankraft committed
263 264 265 266 267 268
      <xs:attribute name="name" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Data">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
269
        <xs:element maxOccurs="unbounded" ref="DataPoint"/>
ankraft's avatar
ankraft committed
270 271 272 273 274
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataPoint">
    <xs:complexType>
ankraft's avatar
ankraft committed
275
      <xs:sequence>
276
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
277
        <xs:element ref="DataType"/>
ankraft's avatar
ankraft committed
278
      </xs:sequence>
ankraft's avatar
ankraft committed
279 280 281 282 283 284 285 286 287 288
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
      <xs:attribute name="writable" type="xs:boolean"/>
      <xs:attribute name="readable" type="xs:boolean"/>
      <xs:attribute name="eventable" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Events">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
289
        <xs:element maxOccurs="unbounded" ref="Event"/>
ankraft's avatar
ankraft committed
290 291 292 293 294 295
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Event">
    <xs:complexType>
      <xs:sequence>
296
        <xs:group ref="DocDef"/>
297
        <xs:element minOccurs="0" ref="Data"/>
ankraft's avatar
ankraft committed
298 299 300 301 302 303
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
</xs:schema>