source: NonGTP/Xerces/xerces-c_2_8_0/samples/data/personal.xsd @ 2674

Revision 2674, 3.1 KB checked in by mattausch, 17 years ago (diff)
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema'>
3
4 <xs:import namespace="http://www.w3.org/XML/1998/namespace">
5   <xs:annotation>
6     <xs:documentation>
7        The schemaLocation of the relevant file is
8        "http://www.w3.org/2001/xml.xsd"; however,
9        we don't want to assume people are always
10        connected to the 'net when playing with this file.
11     </xs:documentation>
12   </xs:annotation>
13 </xs:import>
14
15 <xs:element name="personnel">
16  <xs:complexType>
17   <xs:sequence>
18     <xs:element ref="person" minOccurs='1' maxOccurs='unbounded'/>
19   </xs:sequence>
20  </xs:complexType>
21
22  <xs:unique name="unique1">
23   <xs:selector xpath="person"/>
24   <xs:field xpath="name/given"/>
25   <xs:field xpath="name/family"/>
26  </xs:unique>
27  <xs:key name='empid'>
28   <xs:selector xpath="person"/>
29   <xs:field xpath="@id"/>
30  </xs:key>
31  <xs:keyref name="keyref1" refer='empid'>
32   <xs:selector xpath="person"/>
33   <xs:field xpath="link/@manager"/> 
34  </xs:keyref>
35
36 </xs:element>
37
38 <xs:element name="person">
39  <xs:complexType>
40   <xs:sequence>
41     <xs:element ref="name"/>
42     <xs:element ref="email" minOccurs='0' maxOccurs='unbounded'/>
43     <xs:element ref="url"   minOccurs='0' maxOccurs='unbounded'/>
44     <xs:element ref="link"  minOccurs='0' maxOccurs='1'/>
45   </xs:sequence>
46   <xs:attribute name="id"  type="xs:ID" use='required'/>
47   <xs:attribute name="note" type="xs:string"/>
48   <xs:attribute name="contr" default="false">
49    <xs:simpleType>
50     <xs:restriction base = "xs:string">
51       <xs:enumeration value="true"/>
52       <xs:enumeration value="false"/>
53     </xs:restriction>
54    </xs:simpleType>
55   </xs:attribute>
56   <xs:attribute name="salary" type="xs:integer"/>
57   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
58  </xs:complexType>
59 </xs:element>
60
61 <xs:element name="name">
62  <xs:complexType>
63   <xs:all>
64    <xs:element ref="family"/>
65    <xs:element ref="given"/>
66   </xs:all>
67   <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
68  </xs:complexType>
69 </xs:element>
70
71 <xs:element name="family">
72   <xs:complexType>
73     <xs:simpleContent>
74       <xs:extension base='xs:string'>
75          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
76        </xs:extension>
77     </xs:simpleContent>
78   </xs:complexType>
79 </xs:element>
80
81 <xs:element name="given" >
82   <xs:complexType>
83     <xs:simpleContent>
84       <xs:extension base='xs:string'>
85          <xs:anyAttribute namespace="http://www.w3.org/XML/1998/namespace" processContents="skip"/>
86        </xs:extension>
87     </xs:simpleContent>
88   </xs:complexType>
89 </xs:element>
90
91 <xs:element name="email" type='xs:string'/>
92
93 <xs:element name="url">
94  <xs:complexType>
95   <xs:attribute name="href" type="xs:string" default="http://"/>
96  </xs:complexType>
97 </xs:element>
98
99 <xs:element name="link">
100  <xs:complexType>
101   <xs:attribute name="manager" type="xs:IDREF"/>
102   <xs:attribute name="subordinates" type="xs:IDREFS"/>
103  </xs:complexType>
104 </xs:element>
105
106 <xs:notation name='gif' public='-//APP/Photoshop/4.0' system='photoshop.exe'/>
107
108</xs:schema>
Note: See TracBrowser for help on using the repository browser.