Project

Profile

Help

Bug #4744 » UniqueKeyBug.xsd

XSD to validate test file against - Marek Skorek, 2020-09-22 10:31

 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xs:schema xmlns:meta="http://anicasystem.com.pl/XMLSchema/meta"
3
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
4
           attributeFormDefault="unqualified"
5
           elementFormDefault="unqualified"
6
		   version="1.1">
7
    
8
    <xs:element name="root">
9
        <xs:complexType>
10
            <xs:sequence>
11
                <xs:element ref="row" maxOccurs="unbounded" />
12
            </xs:sequence>
13
        </xs:complexType>
14
        <xs:unique name="uniqueKey">
15
            <xs:selector xpath="row" />
16
            <xs:field xpath="@A" />
17
            <xs:field xpath="@B" />
18
            <xs:field xpath="@C" />
19
            <xs:field xpath="@D" />
20
        </xs:unique>
21
    </xs:element>
22
    
23
    <xs:element name="row">
24
        <xs:complexType>
25
			<xs:attribute name="A" use="required" type="xs:string" />
26
			<xs:attribute name="B" use="required" type="xs:string" />
27
			<xs:attribute name="C" use="required" type="xs:string" />
28
			<xs:attribute name="D" use="required" type="xs:string" />
29
        </xs:complexType>
30
    </xs:element>
31
 
32
</xs:schema>
(2-2/2)