Hello,
I am relatively new to designing XSD's and have been fairly successful, aside from the problem listed below:
In this code, I am attempting to define a Column tag that has attributes that pertain either to the Text or Number attributeGroups, or the "value" attribute denoted as xs:date type. What is the syntax necessary to perform this choice selection on a group of attributes, as opposed to elements?
Thank you for your time.
Nick Ruiz
I am relatively new to designing XSD's and have been fairly successful, aside from the problem listed below:
Code:
<!-- Numeric tags -->
<xs:attributeGroup name="Number">
<xs:attribute name="precision" use="optional">
<xs:simpleType>
<!-- Precision must be 0-10 decimals -->
<xs:restriction base="xs:integer">
<xs:minInclusive value="0" />
<xs:maxInclusive value="10" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" type="xs:decimal" use="optional" />
</xs:attributeGroup>
<!-- Textual tags -->
<xs:attributeGroup name="Text">
<xs:attribute name="justification" use="optional">
<xs:simpleType>
<!-- Justification must be left/right/center -->
<xs:restriction base="xs:string">
<xs:enumeration value="left" />
<xs:enumeration value="center" />
<xs:enumeration value="right" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="value" type="xs:string" use="optional" />
</xs:attributeGroup>
<!-- Column data type -->
<xs:element name="Column">
<xs:complexType>
<xs:choice>
<xs:group ref="Text" />
<xs:group ref="Number" />
<xs:attribute name="value" type="xs:date"/>
</xs:choice>
<xs:attribute name="name" type="xs:string" />
</xs:complexType>
</xs:element>
In this code, I am attempting to define a Column tag that has attributes that pertain either to the Text or Number attributeGroups, or the "value" attribute denoted as xs:date type. What is the syntax necessary to perform this choice selection on a group of attributes, as opposed to elements?
Thank you for your time.
Nick Ruiz