I have the following XSD (part of the XSD)
<xs:element name="sourceValue" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:normalizedString">
<xs:attribute name="label" type="xs:normalizedString"
use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
In my XML I have:
<?xml version="1.0" encoding="UTF-8"?>
<Record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="assertion.xsd">
<SSN>33333332</SSN>
<sourceValue label="nrA">33333333</sourceValue>
<sourceValue label="nrB">111111111</sourceValue>
<Data>
<Patient>
<DateOfBirth>03-04-2000</DateOfBirth>
<Sexe>M</Sexe>
<Name>Patient A</Name>
</Patient>
</Data>
</Record>
I want to change my XSD in such a way that when sourceValue with label="nrA" is mandatory, but with label="nrB" is optional. But I cannot figure out how to do this.