Project

Profile

Help

Bug #4193 ยป personal.xsd

Stepan RYBAR, 2019-04-08 16:16

 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.oxygenxml.com/ns/samples/personal" xmlns:p="http://www.oxygenxml.com/ns/samples/personal">
3

    
4
  <xs:element name="personnel">
5
    <xs:annotation>
6
      <xs:documentation>Defines the personnel as a collection of person elements.</xs:documentation>
7
    </xs:annotation>
8
    <xs:complexType>
9
      <xs:sequence>
10
        <xs:element ref="p:person" minOccurs="1" maxOccurs="unbounded"/>
11
      </xs:sequence>
12
    </xs:complexType>
13
    <xs:unique name="unique1">
14
      <xs:selector xpath="p:person"/>
15
      <xs:field xpath="p:name/p:given"/>
16
      <xs:field xpath="p:name/p:family"/>
17
    </xs:unique>
18
    <xs:key name="empid">
19
      <xs:selector xpath="p:person"/>
20
      <xs:field xpath="@id"/>
21
    </xs:key>
22
    <xs:keyref name="keyref1" refer="p:empid">
23
      <xs:selector xpath="p:person"/>
24
      <xs:field xpath="p:link/@manager"/>
25
    </xs:keyref>
26
  </xs:element>
27

    
28
  <xs:element name="person">
29
    <xs:annotation>
30
      <xs:documentation>Specifies information about a person.</xs:documentation>
31
    </xs:annotation>
32
    <xs:complexType>
33
      <xs:sequence>
34
        <xs:element ref="p:name"/>
35
        <xs:element ref="p:email" minOccurs="0" maxOccurs="unbounded"/>
36
        <xs:element ref="p:link" minOccurs="0" maxOccurs="1"/>
37
        <xs:element ref="p:url" minOccurs="0" maxOccurs="unbounded"/>
38
      </xs:sequence>
39
      <xs:attribute name="id" type="xs:ID" use="required">
40
        <xs:annotation>
41
          <xs:documentation>Specifies a required unique ID for this person.</xs:documentation>
42
        </xs:annotation>
43
      </xs:attribute>
44
      <xs:attribute name="note" type="xs:string">
45
        <xs:annotation>
46
          <xs:documentation>If there is anything to note about this person.</xs:documentation>
47
        </xs:annotation>
48
      </xs:attribute>
49
      <xs:attribute name="contr" default="false">
50
        <xs:simpleType>
51
          <xs:restriction base="xs:string">
52
            <xs:enumeration value="true"/>
53
            <xs:enumeration value="false"/>
54
          </xs:restriction>
55
        </xs:simpleType>
56
      </xs:attribute>
57
      <xs:attribute name="salary">
58
        <xs:annotation>
59
          <xs:documentation>Specifies the salary for this person.</xs:documentation>
60
        </xs:annotation>
61
        <xs:simpleType>
62
          <xs:restriction base="xs:integer">
63
            <xs:minInclusive value="1"/>
64
            <xs:maxInclusive value="10"/>
65
            <xs:totalDigits value="20"/>
66
            <xs:pattern value="[\-+]?[1-9]+"/>
67
          </xs:restriction>
68
        </xs:simpleType>
69
      </xs:attribute>
70
      <xs:attribute name="photo" type="xs:string"/>
71
    </xs:complexType>
72
  </xs:element>
73

    
74
  <xs:element name="name">
75
    <xs:annotation>
76
      <xs:documentation>Specifies the person family and given name.</xs:documentation>
77
    </xs:annotation>
78
    <xs:complexType>
79
      <xs:all>
80
        <xs:element ref="p:family"/>
81
        <xs:element ref="p:given"/>
82
      </xs:all>
83
    </xs:complexType>
84
  </xs:element>
85

    
86
  <xs:simpleType name="normalizable">
87
    <xs:restriction base="xs:string">
88
      <xs:whiteSpace value="collapse"/>
89
    </xs:restriction>
90
  </xs:simpleType>
91

    
92
  <xs:element name="family">
93
    <xs:annotation>
94
      <xs:documentation>The person last name.</xs:documentation>
95
    </xs:annotation>
96
    <xs:complexType>
97
      <xs:simpleContent>
98
        <xs:extension base="p:normalizable">
99
          <xs:attribute name="test" type="xs:decimal" default="25.0"></xs:attribute>
100
        </xs:extension>
101
      </xs:simpleContent>
102
    </xs:complexType>
103
  </xs:element>
104

    
105
  <xs:element name="given" type="p:normalizable">
106
    <xs:annotation>
107
      <xs:documentation>The person first name.</xs:documentation>
108
    </xs:annotation>
109
  </xs:element>
110

    
111
  <xs:element name="email" type="p:normalizable">
112
    <xs:annotation>
113
      <xs:documentation>Email address for this person.</xs:documentation>
114
    </xs:annotation>
115
  </xs:element>
116

    
117
  <xs:element name="url">
118
    <xs:annotation>
119
      <xs:documentation>Enter an URL for this person.</xs:documentation>
120
    </xs:annotation>
121
    <xs:complexType>
122
      <xs:attribute name="href" type="xs:string" default="http://">
123
        <xs:annotation>
124
          <xs:documentation>Enter an URL for this person.</xs:documentation>
125
        </xs:annotation>
126
      </xs:attribute>
127
    </xs:complexType>
128
  </xs:element>
129

    
130
  <xs:element name="link">
131
    <xs:annotation>
132
      <xs:documentation>Specifies who is the manager and who are the subordinates for this person.</xs:documentation>
133
    </xs:annotation>
134
    <xs:complexType>
135
      <xs:attribute name="manager" type="xs:IDREF">
136
        <xs:annotation>
137
          <xs:documentation>The manager ID.</xs:documentation>
138
        </xs:annotation>
139
      </xs:attribute>
140
      <xs:attribute name="subordinates" type="xs:IDREFS">
141
        <xs:annotation>
142
          <xs:documentation>Space separated list with the subordinates IDs.</xs:documentation>
143
        </xs:annotation>
144
      </xs:attribute>
145
    </xs:complexType>
146
  </xs:element>
147

    
148
  <xs:notation name="gif" public="-//APP/Photoshop/4.0" system="photoshop.exe"/>
149
</xs:schema>
    (1-1/1)