summaryrefslogtreecommitdiff
path: root/test/schemas/idc-keyref-err1_1.xsd
blob: 43c769f4642bd14395c27a8f1a1103262b281a25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0"?>
<xs:schema
    targetNamespace="urn:test:foo"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:foo="urn:test:foo"
    elementFormDefault="qualified"
    attributeFormDefault="qualified">
  
   <xs:element name="Link">
       <xs:complexType>
           <xs:simpleContent>
               <xs:extension base="xs:string">
                   <xs:attribute name="linkKey" type="xs:string" use="required"/>
               </xs:extension>
           </xs:simpleContent>
       </xs:complexType>
   </xs:element>
      
    
  <!--  -->
  <xs:element name="Foo">
    <xs:complexType>
      <xs:sequence>
	          
        <xs:element name="Def">
            <xs:complexType>
                <xs:sequence>
                    <xs:element ref="foo:Link"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
        
        <xs:element name="Ref">
            <xs:complexType>
                <xs:attribute name="linkRef" use="required"/>
            </xs:complexType>
        </xs:element>

      </xs:sequence>
	</xs:complexType>      

	<xs:key name="LinkKey">
	  <xs:selector xpath=".//foo:Link | .//foo:Link"/>
	  <xs:field xpath="@foo:linkKey"/>
	</xs:key>

	<xs:keyref name="LinkKeyRef" refer="foo:LinkKey">
	  <xs:selector xpath=".//foo:Ref"/>
	  <xs:field xpath="@foo:linkRef"/>
	</xs:keyref>    
  </xs:element>

</xs:schema>