I have this in the XML:
<Const Name="a" Value="1.0"/>
<Const Name="b" Value="1"/>
<Const Name="c" Value="A"/>
<Const Name="d" Value="B"/>
I have these two cases:
- For a
Const
element withName="b"
theValue
must be one of1
,2
,3
or4
. No other values are allowed. - Other
Const
elements may contain other values, as shown.
How do I express that in XSD?
So far I have this:
<xs:element name="Const">
<xs:complexType>
<xs:attribute name="Value" type="xs:string" use="required"/>
<xs:attribute name="Name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
I use XSD 1.0, it seems: VS2013... so "Alternative" does not work for me... sadly...