I try to inherit and restrict an element, but I get the following error (in eclipse check):
A type particle is not an acceptable limitation of a base particle.
The Description element must not be part of the TypeDevice element. I just can't understand why. This should be possible (according to this tutorial ):
Can anybody help me?
hello
Bill
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.com" xmlns="http://www.example.com" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:complexType name="AbstractDevice" abstract="true">
<xs:sequence>
<xs:element name="Name" type="xs:string" />
<xs:element name="Description" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:string" />
</xs:complexType>
<xs:complexType name="TypeDevice">
<xs:complexContent>
<xs:restriction base="AbstractDevice">
<xs:sequence>
<xs:element name="Name" type="xs:string" />
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required" />
</xs:restriction>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="TypeRoot">
<xs:sequence>
<xs:element name="Device" type="TypeDevice" />
</xs:sequence>
</xs:complexType>
<xs:element name="Configuration" type="TypeRoot" />
</xs:schema>
source
share