Preferably without using XSD 1.1 - require an XML element if another is not provided and vice versa.
Say I have a Job element:
<Job>
<Ref>""</JobReferenceId>
<Title>""</JobTitle>
<Type>""</Type>
<Contract>""</Contract>
</Job>
Type
should be a required element if Contract
is not provided and Contract
should be a required element if Type
is not provided. Both shouldn't be provided together.
Can I do this without XSD 1.1?
Sounds like a straightforward xs:choice
:
xs:sequence
xs:element name="Ref"
xs:element name="Title"
xs:choice
xs:element name="Type"
xs:element name="Contract"