I have a simple XML structure:
<foo>
<bar row="42" column="2"></bar>
<bar row="42" column="3"></bar>
</foo>
I would like row
and column
of bar
to be unique together. So the above example validates, whereas the following does not:
<foo>
<bar row="42" column="2"></bar>
<bar row="42" column="3"></bar>
<bar row="42" column="3"></bar>
</foo>
I've been trying to add a key to the following schema, but I haven't found a solution yet.
<xs:element name="foo">
<xs:complexType>
<xs:sequence>
<xs:element name="bar" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="row" type="xs:positiveInteger" use="required"/>
<xs:attribute name="column" type="xs:positiveInteger" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>