domain.xsd 8.76 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 16 17 18 19 20 21 22 23 24 25
        <xs:element minOccurs="0" name="Modules">
          <xs:complexType>
            <xs:sequence>
              <xs:element minOccurs="0" maxOccurs="unbounded" ref="ModuleClass"/>
            </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 29 30 31 32
  <xs:element name="Imports">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Domain"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
33 34 35 36 37 38 39 40 41 42 43
  <xs:element name="ModuleClass" type="ModuleDef"/>
  <xs:element name="Devices">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Device"/>
      </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="Characteristics"/>
ankraft's avatar
ankraft committed
46 47 48 49 50 51 52 53 54 55 56 57 58
        <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>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="SubDevice"/>
      </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="Characteristics"/>
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
  <xs:element name="Characteristics">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="Characteristic"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Characteristic">
    <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 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
  <xs:element name="DataTypeDef" abstract="true"/>
  <xs:attributeGroup name="DataTypeDef">
    <xs:attribute name="unitOfMeasure"/>
  </xs:attributeGroup>
  <xs:element name="Struct" substitutionGroup="DataTypeDef">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" ref="DataTypeDef"/>
      </xs:sequence>
      <xs:attribute name="name"/>
      <xs:attributeGroup ref="DataTypeDef"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="Array" substitutionGroup="DataTypeDef">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="DataTypeDef"/>
      </xs:sequence>
      <xs:attribute name="name"/>
      <xs:attributeGroup ref="DataTypeDef"/>
    </xs:complexType>
  </xs:element>
  <xs:element name="SimpleType" substitutionGroup="DataTypeDef">
    <xs:complexType>
      <xs:attribute name="name"/>
      <xs:attribute name="type" use="required" type="BasicType"/>
    </xs:complexType>
  </xs:element>
  <xs:simpleType name="BasicType">
ankraft's avatar
ankraft committed
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
    <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>
  <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"/>
143 144
  <!-- <Doc> element is always optional -->
  <xs:group name="DocDef">
ankraft's avatar
ankraft committed
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
    <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"/>
177
      <xs:group ref="DocDef"/>
178
      <xs:element minOccurs="0" ref="Characteristics"/>
ankraft's avatar
ankraft committed
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 209
      <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>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Module"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Module" type="ModuleDef"/>
  <xs:element name="Actions">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Action"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Action">
    <xs:complexType>
      <xs:sequence>
210
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
211
        <xs:element minOccurs="0" ref="DataTypeDef"/>
212
        <xs:element minOccurs="0" ref="Args"/>
ankraft's avatar
ankraft committed
213 214 215
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
ankraft's avatar
ankraft committed
216
      <xs:attributeGroup ref="DataTypeDef"/>
ankraft's avatar
ankraft committed
217 218
    </xs:complexType>
  </xs:element>
219 220 221 222 223 224 225
  <xs:element name="Args">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Arg"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
ankraft's avatar
ankraft committed
226 227
  <xs:element name="Arg">
    <xs:complexType>
ankraft's avatar
ankraft committed
228
      <xs:sequence>
229
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
230 231
        <xs:element ref="DataTypeDef"/>
      </xs:sequence>
ankraft's avatar
ankraft committed
232
      <xs:attribute name="name" use="required"/>
ankraft's avatar
ankraft committed
233
      <xs:attributeGroup ref="DataTypeDef"/>
ankraft's avatar
ankraft committed
234 235 236 237 238 239 240 241 242 243 244
    </xs:complexType>
  </xs:element>
  <xs:element name="Data">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="DataPoint"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DataPoint">
    <xs:complexType>
ankraft's avatar
ankraft committed
245
      <xs:sequence>
246
        <xs:group ref="DocDef"/>
ankraft's avatar
ankraft committed
247 248
        <xs:element ref="DataTypeDef"/>
      </xs:sequence>
ankraft's avatar
ankraft committed
249 250 251 252 253
      <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"/>
ankraft's avatar
ankraft committed
254
      <xs:attributeGroup ref="DataTypeDef"/>
ankraft's avatar
ankraft committed
255 256 257 258 259 260 261 262 263 264 265 266
    </xs:complexType>
  </xs:element>
  <xs:element name="Events">
    <xs:complexType>
      <xs:sequence>
        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Event"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="Event">
    <xs:complexType>
      <xs:sequence>
267
        <xs:group ref="DocDef"/>
268
        <xs:element minOccurs="0" ref="Data"/>
ankraft's avatar
ankraft committed
269 270 271 272 273 274
      </xs:sequence>
      <xs:attribute name="name" use="required"/>
      <xs:attribute name="optional" type="xs:boolean"/>
    </xs:complexType>
  </xs:element>
</xs:schema>