I have the XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="UploadXSD"
elementFormDefault="qualified"
xmlns="http://tempuri.org/UploadXSD.xsd"
xmlns:mstns="http://tempuri.org/UploadXSD.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="video">
<xs:complexType>
<xs:sequence>
<xs:element name="title" minOccurs="1" type="xs:string"></xs:element>
<xs:element name="description" type="xs:string"></xs:element>
<xs:element name="contributor" type="xs:string"></xs:element>
<xs:element name="cateogry" type="xs:string"></xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The last element can be:
<category>
</category>
Or it can be:
<subject>
</subject>
But how do I represent his as optional (category|subject) in the XSD?
Try this: