Reputation: 111
I need to check that if imagetype
= I
then docext
should only be TIFF/tiff
and if imagetype
= N
then docext
should be PDF/pdf
. Else the validation should fail. I am writing a XSD for this and do not know how to implement this constraint. Currently I am using XSD 1.0.
<xs:element name="docext" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="((T|t)(I|i)(F|f)(F|f))|((P|p)(D|d)(F|f))" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="imagetype" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="N" />
<xs:enumeration value="I" />
</xs:restriction>
</xs:simpleType>
</xs:element>
Upvotes: 2
Views: 429
Reputation: 111581
XSD 1.0 cannot meet your requirements as stated.
Your options include either of the following:
docext
and imagetype
. You'll
need to consider more of your XSD than shown if you have to go this route.Upvotes: 3