domain.xsd 8.91 KB
Newer Older
ankraft's avatar
ankraft committed
1 2 3 4 5 6 7 8 9 10
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
  <xs:element name="Domain">
    <xs:complexType>
      <xs:sequence>
11
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
12
        <xs:element minOccurs="0" ref="Imports"/>
ankraft's avatar
ankraft committed
13 14 15
        <xs:element minOccurs="0" name="Modules">
          <xs:complexType>
            <xs:sequence>
ankraft's avatar
ankraft committed
16
              <xs:element maxOccurs="unbounded" ref="ModuleClass"/>
ankraft's avatar
ankraft committed
17 18 19 20 21 22 23 24 25
            </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
26 27 28
  <xs:element name="Imports">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
29
        <xs:element maxOccurs="unbounded" ref="Domain"/>
ankraft's avatar
ankraft committed
30 31 32
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
33 34 35 36
  <xs:element name="ModuleClass" type="ModuleDef"/>
  <xs:element name="Devices">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
37
        <xs:element maxOccurs="unbounded" ref="Device"/>
ankraft's avatar
ankraft committed
38 39 40 41 42 43
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Device">
    <xs:complexType>
      <xs:sequence>
44
        <xs:group ref="DocDef"/>
45
        <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
46 47 48 49 50 51 52 53 54
        <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
55
        <xs:element maxOccurs="unbounded" ref="SubDevice"/>
ankraft's avatar
ankraft committed
56 57 58
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
59 60 61
  <xs:element name="SubDevice">
    <xs:complexType>
      <xs:sequence>
62
        <xs:group ref="DocDef"/>
63
        <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
64 65 66 67 68
        <xs:element minOccurs="0" ref="Modules"/>
      </xs:sequence>
      <xs:attribute name="id" use="required" type="xs:Name"/>
    </xs:complexType>
  </xs:element>
69
  <xs:element name="Properties">
70 71
    <xs:complexType>
      <xs:sequence>
72
        <xs:element maxOccurs="unbounded" ref="Property"/>
73 74 75
      </xs:sequence>
    </xs:complexType>
  </xs:element>
76
  <xs:element name="Property">
77 78 79 80 81 82 83 84 85 86
    <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
87
  <xs:element name="DataType">
ankraft's avatar
ankraft committed
88 89
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
90 91 92 93 94 95 96
        <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
97 98
      </xs:sequence>
      <xs:attribute name="name"/>
ankraft's avatar
ankraft committed
99
      <xs:attribute name="unitOfMeasure"/>
ankraft's avatar
ankraft committed
100 101
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
102
  <xs:element name="Struct">
ankraft's avatar
ankraft committed
103 104
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
105
        <xs:element maxOccurs="unbounded" ref="DataType"/>
ankraft's avatar
ankraft committed
106 107 108
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
109 110 111 112 113 114 115 116
  <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
117 118 119 120 121
    <xs:complexType>
      <xs:attribute name="type" use="required" type="BasicType"/>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="BasicType">
ankraft's avatar
ankraft committed
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
    <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
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
  <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
152 153 154 155 156 157 158 159 160 161 162 163
  <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"/>
164 165
  <!-- <Doc> element is always optional -->
  <xs:group name="DocDef">
ankraft's avatar
ankraft committed
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
    <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"/>
198
      <xs:group ref="DocDef"/>
199
      <xs:element minOccurs="0" ref="Properties"/>
ankraft's avatar
ankraft committed
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215
      <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
216
        <xs:element maxOccurs="unbounded" ref="Module"/>
ankraft's avatar
ankraft committed
217 218 219 220 221 222 223
      </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
224
        <xs:element maxOccurs="unbounded" ref="Action"/>
ankraft's avatar
ankraft committed
225 226 227 228 229 230
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Action">
    <xs:complexType>
      <xs:sequence>
231
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
232
        <xs:element minOccurs="0" ref="DataType"/>
233
        <xs:element minOccurs="0" ref="Args"/>
ankraft's avatar
ankraft committed
234 235 236 237 238
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
239 240 241
  <xs:element name="Args">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
242
        <xs:element maxOccurs="unbounded" ref="Arg"/>
243 244 245
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
246 247
  <xs:element name="Arg">
    <xs:complexType>
ankraft's avatar
ankraft committed
248
      <xs:sequence>
249
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
250
        <xs:element ref="DataType"/>
ankraft's avatar
ankraft committed
251
      </xs:sequence>
ankraft's avatar
ankraft committed
252 253 254 255 256 257
      <xs:attribute name="name" use="required"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Data">
    <xs:complexType>
      <xs:sequence>
ankraft's avatar
ankraft committed
258
        <xs:element maxOccurs="unbounded" ref="DataPoint"/>
ankraft's avatar
ankraft committed
259 260 261 262 263
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataPoint">
    <xs:complexType>
ankraft's avatar
ankraft committed
264
      <xs:sequence>
265
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
266
        <xs:element ref="DataType"/>
ankraft's avatar
ankraft committed
267
      </xs:sequence>
ankraft's avatar
ankraft committed
268 269 270 271 272 273 274 275 276 277
      <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
278
        <xs:element maxOccurs="unbounded" ref="Event"/>
ankraft's avatar
ankraft committed
279 280 281 282 283 284
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Event">
    <xs:complexType>
      <xs:sequence>
285
        <xs:group ref="DocDef"/>
286
        <xs:element minOccurs="0" ref="Data"/>
ankraft's avatar
ankraft committed
287 288 289 290 291 292
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
</xs:schema>