xsd restriction
XML / XSL
1
Posts
1
Posters
0
Views
1
Watching
-
In my xsd file I have a bool element. I want to set a restriction so that it can only be set to true if a previous element is present and has a particular value. Something like this
<xs:simpleType name="someEnum">
<xs:restriction base="xs:string">
<xs:enumeration value="Value1" />
<xs:enumeration value="Value2" />
</xs:restriction>
</xs:simpleType>...
<xs:element name="Field1" type="someEnum" minOccurs="0" maxOccurs="1" />
<xs:element name="Field2" type="xs:boolean" minOccurs="0" maxOccurs="1" />I want to change it so that Field2 can only be true if Field1 is Value2 from the enum