I'm not sure if this is possible but I would like to allow the following:
<boolean id="x">true</boolean>
The closest I can get to this using an XSD Schema is the following:
<boolean id="x">
<value>true</value>
</boolean>
The problem appears to be with specifying the element type and allowing attributes which requires a "complexType".
I have tried the following:
<xs:element name="boolean" type="xs:boolean">
<xs:complexType>
<xs:attribute name="id" type="xs:ID" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
However I get the following error:
Element 'boolean' had both a 'type' attribute and a "annoynous type" child. Only one of these is allowed for an element.
I have tried various approaches using restrictions, extentsions, complexTypes and simpleTypes, however I can't find a solution that works.
As I mentioned earlier the closest I can get is using:
<xs:element name="boolean">
<xs:complexType>
<xs:all>
<xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:boolean"/>
</xs:all>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
However I find the requirement to have the boolean value stored in a child node (in this instance "values"), superfluous.
Any suggestions would be appreciated.
Thanks in advance
Parmy
<boolean id="x">true</boolean>
The closest I can get to this using an XSD Schema is the following:
<boolean id="x">
<value>true</value>
</boolean>
The problem appears to be with specifying the element type and allowing attributes which requires a "complexType".
I have tried the following:
<xs:element name="boolean" type="xs:boolean">
<xs:complexType>
<xs:attribute name="id" type="xs:ID" use="required"></xs:attribute>
</xs:complexType>
</xs:element>
However I get the following error:
Element 'boolean' had both a 'type' attribute and a "annoynous type" child. Only one of these is allowed for an element.
I have tried various approaches using restrictions, extentsions, complexTypes and simpleTypes, however I can't find a solution that works.
As I mentioned earlier the closest I can get is using:
<xs:element name="boolean">
<xs:complexType>
<xs:all>
<xs:element name="value" minOccurs="1" maxOccurs="1" type="xs:boolean"/>
</xs:all>
<xs:attribute name="id" type="xs:ID" use="required"/>
</xs:complexType>
</xs:element>
However I find the requirement to have the boolean value stored in a child node (in this instance "values"), superfluous.
Any suggestions would be appreciated.
Thanks in advance
Parmy