Mam prostą strukturę XML:XML Schema Unique razem na dwa atrybuty
<foo>
<bar row="42" column="2"></bar>
<bar row="42" column="3"></bar>
</foo>
Chciałbym row
i column
z bar
być unikalne razem. Więc powyższy przykład sprawdza, natomiast nie następuje:
<foo>
<bar row="42" column="2"></bar>
<bar row="42" column="3"></bar>
<bar row="42" column="3"></bar>
</foo>
Próbowałem dodać klucz do poniższego schematu, ale nie znalazłem jeszcze rozwiązania.
<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>