Commit 982d002d authored by ankraft's avatar ankraft

Changed Product to ProductClass. Changed test case accordingly

parent 8103002b
......@@ -18,7 +18,7 @@ Domain =
element DataTypes { DataTypeDef+ }?,
ModuleClassesDef?,
DeviceClassesDef?,
ProductsDef?
ProductClassesDef?
}
PropertiesDef =
element Properties {
......@@ -128,19 +128,16 @@ ModuleClassesDef =
Events?
}+
}
ProductsDef =
element Products {
element Product {
ProductClassesDef =
element ProductClasses {
element ProductClass {
attribute id { xsd:Name },
attribute semanticURI { xsd:anyURI }?,
DocDef,
PropertiesDef?,
ModuleClassesDef?,
SubDevicesRef?,
element DeviceClass {
# TODO: Make optional?
ExtendDef
},
element DeviceClass { ExtendDef }?,
ExtendDef?
}+
}
......
......@@ -55,7 +55,7 @@
<ref name="DeviceClassesDef" />
</optional>
<optional>
<ref name="ProductsDef" />
<ref name="ProductClassesDef" />
</optional>
</element>
</define>
......@@ -366,10 +366,10 @@
</define>
<define name="ProductsDef">
<element name="Products">
<define name="ProductClassesDef">
<element name="ProductClasses">
<oneOrMore>
<element name="Product">
<element name="ProductClass">
<attribute name="id">
<data type="Name"/>
</attribute>
......@@ -388,9 +388,11 @@
<optional>
<ref name="SubDevicesRef" />
</optional>
<element name="DeviceClass"> <!-- TODO: Make optional? -->
<ref name="ExtendDef" />
</element>
<optional>
<element name="DeviceClass">
<ref name="ExtendDef" />
</element>
</optional>
<optional>
<ref name="ExtendDef" />
</optional>
......
......@@ -24,7 +24,7 @@
<xs:element minOccurs="0" ref="DataTypes"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="DeviceClasses"/>
<xs:element minOccurs="0" ref="Products"/>
<xs:element minOccurs="0" ref="ProductClasses"/>
</xs:sequence>
<xs:attribute ref="xml:base"/>
<xs:attribute name="id" use="required" type="xs:Name"/>
......@@ -275,14 +275,14 @@
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Products">
<xs:element name="ProductClasses">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Product"/>
<xs:element maxOccurs="unbounded" ref="ProductClass"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Product">
<xs:element name="ProductClass">
<xs:complexType>
<xs:complexContent>
<xs:extension base="DocDef">
......@@ -290,7 +290,7 @@
<xs:element minOccurs="0" ref="Properties"/>
<xs:element minOccurs="0" ref="ModuleClasses"/>
<xs:element minOccurs="0" ref="SubDevices"/>
<xs:element name="DeviceClass">
<xs:element minOccurs="0" name="DeviceClass">
<xs:complexType>
<xs:sequence>
<xs:element ref="Extend"/>
......
<?xml version="1.0" encoding="iso-8859-1"?>
<Domain xmlns="http://www.onem2m.org/xml/sdt/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="deviceClass-test" >
<Products>
<Product id="TestProduct" semanticURI="http://example.com/TestProduct.rdf">
<Domain xmlns="http://www.onem2m.org/xml/sdt/4.0" xmlns:xi="http://www.w3.org/2001/XInclude" id="productClass-test" >
<ProductClasses>
<ProductClass id="TestProduct" semanticURI="http://example.com/TestProduct.rdf">
<Doc>This is a test product</Doc>
<Properties>
<Property name="aProperty">
......@@ -25,10 +25,21 @@
<DeviceClass>
<Extend domain="deviceClass.test" entity="Test" />
</DeviceClass>
</Product>
</ProductClass>
<!-- TODO: test <extends> element, but only when DeviceClas is optional
<Product id="AnotherTestProduct">
</Product> -->
</Products>
<!-- Derived ProductClass -->
<ProductClass id="DerivedProduct" semanticURI="http://example.com/DerivedProduct.rdf">
<ModuleClasses>
<ModuleClass name="anotherModuleClass">
<Extend domain="hgi.dal.core" entity="BooleanState" />
</ModuleClass>
</ModuleClasses>
<Extend domain="productClass.test" entity="TestProduct" />
</ProductClass>
</ProductClasses>
</Domain>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment