Initial import.
[mirror_edk2.git] / Tools / XMLSchema / NamingConvention.xsd
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.TianoCore.org/2006/Edk2.0" xmlns="http://www.TianoCore.org/2006/Edk2.0">
3 <!--
4 Filename: NamingConvention.xsd
5
6 Copyright (c) 2006, Intel Corp.
7 All rights reserved. This program and the accompanying materials
8 are licensed and made available under the terms and conditions of the BSD License
9 which may be found at http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 -->
15 <xs:annotation>
16 <xs:documentation xml:lang="en"> This schema defines various data types and naming conventions including: base name, filename and directory naming conventions. These are all simple data types.</xs:documentation>
17 </xs:annotation>
18 <xs:simpleType name="BaseNameConvention">
19 <xs:annotation>
20 <xs:documentation xml:lang="en"> Base Names must start with an upper case character, followed by one or more alphanumeric characters and/or an optional underscore (_) character followed by one or more alphanumeric characters. Examples: Base_name3, BASE_NAME3, BaseName3 </xs:documentation>
21 </xs:annotation>
22 <xs:restriction base="xs:string">
23 <xs:pattern value="[A-Z]([a-zA-Z0-9])*(_)?([a-zA-Z0-9])*"/>
24 </xs:restriction>
25 </xs:simpleType>
26 <xs:simpleType name="C_Name">
27 <xs:annotation>
28 <xs:documentation xml:lang="en"> C_Names must start with either an underscore (_) character followed by one or more alpha characters, followed by any combination of underscore or alphanumeric characters.</xs:documentation>
29 </xs:annotation>
30 <xs:restriction base="xs:string">
31 <xs:pattern value="((_)*([a-zA-Z])+((_)*[a-zA-Z0-9]*))*"/>
32 </xs:restriction>
33 </xs:simpleType>
34 <xs:simpleType name="DirectoryNamingConvention">
35 <xs:annotation>
36 <xs:documentation xml:lang="en"> Directory naming convention is a UNION of DOS an UNIX directory path names </xs:documentation>
37 </xs:annotation>
38 <xs:union memberTypes="Directory_DOS Directory_UNIX"/>
39 </xs:simpleType>
40 <xs:simpleType name="Directory_DOS">
41 <xs:annotation>
42 <xs:documentation xml:lang="en"> Directory naming convention for Windows backslash (\) directory path name </xs:documentation>
43 </xs:annotation>
44 <xs:restriction base="xs:string">
45 <xs:pattern value="([a-zA-Z]:\\)?(((\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*"/>
46 </xs:restriction>
47 </xs:simpleType>
48 <xs:simpleType name="Directory_UNIX">
49 <xs:annotation>
50 <xs:documentation xml:lang="en"> Directory naming convention for UNIX forwardslash (/) directory path name </xs:documentation>
51 </xs:annotation>
52 <xs:restriction base="xs:string">
53 <xs:pattern value="(\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\/)?)*"/>
54 </xs:restriction>
55 </xs:simpleType>
56 <xs:simpleType name="E-Mail">
57 <xs:restriction base="xs:string">
58 <xs:pattern value="[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*@[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*"/>
59 </xs:restriction>
60 </xs:simpleType>
61 <xs:simpleType name="FileNameConvention">
62 <xs:annotation>
63 <xs:documentation xml:lang="en"> This defines what a Filename is: Alphanumeric characters and optional underscore (_) or dash (-) characters, followed by a optional dot and more alphanumeric characters. </xs:documentation>
64 </xs:annotation>
65 <xs:restriction base="xs:string">
66 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*((_)*(-)*(.)*[a-zA-Z0-9]*)*"/>
67 </xs:restriction>
68 </xs:simpleType>
69 <xs:simpleType name="GuidArrayType">
70 <xs:annotation>
71 <xs:documentation xml:lang="en"> This defines the minimum specification for a GUID Array which is 8 Hex Digits - 4 Hex Digits - 4 Hex Digits - 8 Hex Bytes, the last 16 Hex Digits can be enclosed in sqiggle {} brackets.</xs:documentation>
72 </xs:annotation>
73 <xs:restriction base="xs:string">
74 <xs:pattern value="0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})?"/>
75 </xs:restriction>
76 </xs:simpleType>
77 <xs:simpleType name="GuidNamingConvention">
78 <xs:annotation>
79 <xs:documentation xml:lang="en"> A GUID must contain five different Hexadecimal character sets that are separated by a dash (-) character. </xs:documentation>
80 </xs:annotation>
81 <xs:restriction base="xs:string">
82 <xs:pattern value="[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}"/>
83 </xs:restriction>
84 </xs:simpleType>
85 <xs:simpleType name="GuidType">
86 <xs:annotation>
87 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
88 </xs:annotation>
89 <xs:union memberTypes="GuidArrayType GuidNamingConvention"/>
90 </xs:simpleType>
91 <xs:simpleType name="Hex64BitDataType">
92 <xs:annotation>
93 <xs:documentation xml:lang="en">Define a Hex 64 Bit Value to be 0x[a-f0-9]{16}</xs:documentation>
94 </xs:annotation>
95 <xs:restriction base="xs:string">
96 <xs:pattern value="(0x)?[a-fA-F0-9]{1,16}"/>
97 </xs:restriction>
98 </xs:simpleType>
99 <xs:simpleType name="HexAddressType">
100 <xs:annotation>
101 <xs:documentation xml:lang="en">Define a Hex Address, 0x[a-fA-F0-9]{1,16}</xs:documentation>
102 </xs:annotation>
103 <xs:restriction base="xs:string">
104 <xs:pattern value="0x[a-fA-F0-9]{1,16}"/>
105 </xs:restriction>
106 </xs:simpleType>
107 <xs:simpleType name="HexByteDataType">
108 <xs:annotation>
109 <xs:documentation xml:lang="en">Define a Hex Byte Value to be 0x[a-f0-9]{2}</xs:documentation>
110 </xs:annotation>
111 <xs:restriction base="xs:string">
112 <xs:pattern value="(0x)?[a-fA-F0-9]{1,2}"/>
113 </xs:restriction>
114 </xs:simpleType>
115 <xs:simpleType name="HexDataType">
116 <xs:annotation>
117 <xs:documentation xml:lang="en">Define a Hex Value to be 0x[a-f0-9]+</xs:documentation>
118 </xs:annotation>
119 <xs:restriction base="xs:string">
120 <xs:pattern value="0x[a-fA-F0-9]+"/>
121 </xs:restriction>
122 </xs:simpleType>
123 <xs:simpleType name="HexDigitType">
124 <xs:annotation>
125 <xs:documentation xml:lang="en">Define a Hex Diget to be 0x[a-f0-9]</xs:documentation>
126 </xs:annotation>
127 <xs:restriction base="xs:string">
128 <xs:pattern value="[a-fA-F0-9]{1}"/>
129 </xs:restriction>
130 </xs:simpleType>
131 <xs:simpleType name="HexDoubleWordDataType">
132 <xs:annotation>
133 <xs:documentation xml:lang="en">Define a Hex Double Word Value to be 0x[a-f0-9]{8}</xs:documentation>
134 </xs:annotation>
135 <xs:restriction base="xs:string">
136 <xs:pattern value="0x[a-fA-F0-9]{1,8}"/>
137 </xs:restriction>
138 </xs:simpleType>
139 <xs:simpleType name="HexWordDataType">
140 <xs:annotation>
141 <xs:documentation xml:lang="en">Define a Hex Word Value to be 0x[a-f0-9]{4}</xs:documentation>
142 </xs:annotation>
143 <xs:restriction base="xs:string">
144 <xs:pattern value="0x[a-fA-F0-9]{1,4}"/>
145 </xs:restriction>
146 </xs:simpleType>
147 <xs:simpleType name="LibraryNameConvention">
148 <xs:annotation>
149 <xs:documentation xml:lang="en"> This defines what a Library name is: alphanumeric characters and optional underscore (_) characters. </xs:documentation>
150 </xs:annotation>
151 <xs:restriction base="xs:string">
152 <xs:pattern value="[A-Z][a-zA-Z0-9]*(_*[a-zA-Z0-9])*"/>
153 </xs:restriction>
154 </xs:simpleType>
155 <xs:simpleType name="NameConvention">
156 <xs:annotation>
157 <xs:documentation xml:lang="en">What is a name, any series of alphanumeric characters and one or more underline characters that may occur in any position</xs:documentation>
158 </xs:annotation>
159 <xs:restriction base="xs:normalizedString">
160 <xs:pattern value="(_*[a-zA-Z0-9]*_*)+"/>
161 </xs:restriction>
162 </xs:simpleType>
163 <xs:simpleType name="Paragraph">
164 <xs:annotation>
165 <xs:documentation xml:lang="en">This describes the normal text of a paragraph that can be used in a license or description tag.</xs:documentation>
166 </xs:annotation>
167 <xs:restriction base="xs:normalizedString"/>
168 </xs:simpleType>
169 <xs:simpleType name="PlatformNamingConvention">
170 <xs:annotation>
171 <xs:documentation xml:lang="en"> This defines what a Platform Name is: Alphanumeric characters and optional underscore (_) or dash (-) characters, followed by a dot and more alphanumeric characters. </xs:documentation>
172 </xs:annotation>
173 <xs:restriction base="xs:string">
174 <xs:pattern value="(([a-zA-Z][a-zA-Z0-9]*)(_)*(.)*)+"/>
175 </xs:restriction>
176 </xs:simpleType>
177 <xs:simpleType name="Sentence">
178 <xs:annotation>
179 <xs:documentation xml:lang="en"> This data type requires two or more words </xs:documentation>
180 </xs:annotation>
181 <xs:restriction base="xs:normalizedString">
182 <xs:pattern value="(\w+\W*)+( )+(\W*\w*\W*\s*)*"/>
183 </xs:restriction>
184 </xs:simpleType>
185 <xs:simpleType name="ToolNameConvention">
186 <xs:annotation>
187 <xs:documentation xml:lang="en"> This defines what a Tool name is: Alphanumeric characters and optional underscore (_) or dash (-) characters, optionally followed by a dot and more alphanumeric characters. </xs:documentation>
188 </xs:annotation>
189 <xs:restriction base="xs:string">
190 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*(_*-*.*[a-zA-Z0-9])*"/>
191 </xs:restriction>
192 </xs:simpleType>
193 <xs:simpleType name="UCLetterType">
194 <xs:annotation>
195 <xs:documentation xml:lang="en"> Definition of a UpperCase Letter type, which can be any combination of upper case characters followed by zero or more underscore and/or uppercase alphanumeric characters </xs:documentation>
196 </xs:annotation>
197 <xs:restriction base="xs:string">
198 <xs:pattern value="[A-Z]{1}"/>
199 </xs:restriction>
200 </xs:simpleType>
201 <xs:simpleType name="UCNameType">
202 <xs:annotation>
203 <xs:documentation xml:lang="en"> Definition of a UpperCase Name, which can be any combination of upper case characters followed by zero or more underscore and/or uppercase alphanumeric characters </xs:documentation>
204 </xs:annotation>
205 <xs:restriction base="xs:string">
206 <xs:pattern value="[A-Z]+(_*[A-Z0-9]*( )*)*"/>
207 </xs:restriction>
208 </xs:simpleType>
209 <xs:simpleType name="UserName">
210 <xs:annotation>
211 <xs:documentation xml:lang="en">Specify a User Name</xs:documentation>
212 </xs:annotation>
213 <xs:restriction base="xs:string">
214 <xs:pattern value="[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*"/>
215 </xs:restriction>
216 </xs:simpleType>
217 <xs:simpleType name="V1">
218 <xs:annotation>
219 <xs:documentation xml:lang="en">%VAR%(Directory)*(File_Names)*</xs:documentation>
220 </xs:annotation>
221 <xs:restriction base="xs:string">
222 <xs:pattern value="((%[A-Z](_*[A-Z0-9]*)*%)+((((\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*)"/>
223 </xs:restriction>
224 </xs:simpleType>
225 <xs:simpleType name="V2">
226 <xs:annotation>
227 <xs:documentation xml:lang="en">($VAR | $( VAR) | ${VAR})(Directory)*(File_Names)</xs:documentation>
228 </xs:annotation>
229 <xs:restriction base="xs:string">
230 <xs:pattern value="(($[A-Z](_*[A-Z0-9]*)*)+||($\([A-Z](_*[A-Z0-9]*)*\))+||($\{[A-Z](_*[A-Z0-9]*)*\})+)+(\/)?(((((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\/)?)*)*)"/>
231 </xs:restriction>
232 </xs:simpleType>
233 <xs:simpleType name="VariableConvention">
234 <xs:annotation>
235 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR% and Directory and File Names</xs:documentation>
236 </xs:annotation>
237 <xs:union memberTypes="V1 V2"/>
238 </xs:simpleType>
239 <xs:simpleType name="VariableGuidType">
240 <xs:annotation>
241 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
242 </xs:annotation>
243 <xs:union memberTypes="GuidArrayType GuidNamingConvention Zero"/>
244 </xs:simpleType>
245 <xs:simpleType name="VariableNamingConvention">
246 <xs:annotation>
247 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR%</xs:documentation>
248 </xs:annotation>
249 <xs:union memberTypes="Variable_DOS Variable_UNIX Variable_UNIX_Scope1 Variable_UNIX_Scope2"/>
250 </xs:simpleType>
251 <xs:simpleType name="Variable_DOS">
252 <xs:annotation>
253 <xs:documentation xml:lang="en"> Definition of a DOS Variable Name: %VAR% It must start with an Upper Case character.</xs:documentation>
254 </xs:annotation>
255 <xs:restriction base="xs:string">
256 <xs:pattern value="%[A-Z](_*[A-Z0-9]*)*%"/>
257 </xs:restriction>
258 </xs:simpleType>
259 <xs:simpleType name="Variable_UNIX">
260 <xs:annotation>
261 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $VAR It must start with an Upper Case character.</xs:documentation>
262 </xs:annotation>
263 <xs:restriction base="xs:string">
264 <xs:pattern value="$[A-Z](_*[A-Z0-9]*)*"/>
265 </xs:restriction>
266 </xs:simpleType>
267 <xs:simpleType name="Variable_UNIX_Scope1">
268 <xs:annotation>
269 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $( VAR1) It must start with an Upper Case character.</xs:documentation>
270 </xs:annotation>
271 <xs:restriction base="xs:string">
272 <xs:pattern value="$\([A-Z](_*[A-Z0-9]*)*\)"/>
273 </xs:restriction>
274 </xs:simpleType>
275 <xs:simpleType name="Variable_UNIX_Scope2">
276 <xs:annotation>
277 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: ${ VAR1} It must start with an Upper Case character.</xs:documentation>
278 </xs:annotation>
279 <xs:restriction base="xs:string">
280 <xs:pattern value="$\{[A-Z](_*[A-Z0-9]*)*\}"/>
281 </xs:restriction>
282 </xs:simpleType>
283 <xs:simpleType name="VersionDataType">
284 <xs:annotation>
285 <xs:documentation xml:lang="en"> Definition of a Version Number, which can be any combination of a number followed by zero or more alphanumeric-dot-alphanumeric characters </xs:documentation>
286 </xs:annotation>
287 <xs:restriction base="xs:string">
288 <xs:pattern value="xs:normalizedString"/>
289 </xs:restriction>
290 </xs:simpleType>
291 <xs:simpleType name="Zero">
292 <xs:annotation>
293 <xs:documentation xml:lang="en">Define Zero as a vaild value</xs:documentation>
294 </xs:annotation>
295 <xs:restriction base="xs:int">
296 <xs:pattern value="0"/>
297 </xs:restriction>
298 </xs:simpleType>
299 <xs:simpleType name="OldVersionDataType">
300 <xs:annotation>
301 <xs:documentation xml:lang="en"> Definition of a Version Number, which can be any combination of a number followed by zero or more alphanumeric-dot-alphanumeric characters </xs:documentation>
302 </xs:annotation>
303 <xs:restriction base="xs:string">
304 <xs:pattern value="([0-9])+[a-zA-Z0-9]*(-?.?([a-zA-Z0-9])*)*"/>
305 </xs:restriction>
306 </xs:simpleType>
307 </xs:schema>