Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

shchema keyref et key use

<xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="root">
    <xs:complexType>
        <xs:sequence>
            <xs:element name="referenced">
                <xs:complexType>
                    <xs:attribute name="id" type="xs:string" />
                </xs:complexType>
            </xs:element>
          
            <xs:element name="owner">
                <xs:complexType>
                    <xs:attribute name="id" type="xs:string" />
                </xs:complexType>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
   
 	 <xs:key name="aKey">
   	 	 <xs:selector xpath="owner" />
   		 <xs:field xpath="@id" />
	</xs:key>
    <xs:keyref name="aKeyRef" refer="aKey">
        <xs:selector xpath="referenced" />
        <xs:field xpath="@id" />
    </xs:keyref>
</xs:element>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #shchema #keyref #key
ADD COMMENT
Topic
Name
3+3 =