I have an attributeGroup defined in my XSD schema. From what I've read and tried out, there is no way I could specify the optionality of the usage of whole group (so that either all of the attributes are specified, or none), something like:
<xs:attributeGroup name="NameDesc">
<xs:attribute name="n" type="xs:string" use="required"/>
<xs:attribute name="d" type="xs:string" use="required"/>
<xs:attribute name="uinf" type="xs:string" use="required"/>
</xs:attributeGroup>
<xs:complexType name="g">
<xs:attributeGroup ref="tns:NameDesc" use="optional" />
</xs:complexType>
(note the use="required" I've added in the attributeGroup reference, which is not allowed). Am I right or is there a way to achieve this?
I've read http://stackoverflow.com/questions/511148/xsd-how-to-depend-the-use-attribute-required-optional-with-the-other-value, but I'm not sure this applies to my case.