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">
4 Filename: NamingConvention.xsd
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
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.
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>
18 <xs:simpleType name="BaseNameConvention">
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>
22 <xs:restriction base="xs:string">
23 <xs:pattern value="[A-Z]([a-zA-Z0-9])*(_)?([a-zA-Z0-9])*"/>
26 <xs:simpleType name="C_Name">
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>
30 <xs:restriction base="xs:string">
31 <xs:pattern value="((_)*([a-zA-Z])+((_)*[a-zA-Z0-9]*))*"/>
34 <xs:simpleType name="C_NameType">
36 <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>
38 <xs:restriction base="xs:string">
39 <xs:pattern value="((_)*([a-zA-Z])+((_)*[a-zA-Z0-9]*))*"/>
42 <xs:simpleType name="DirectoryNamingConvention">
44 <xs:documentation xml:lang="en"> Directory naming convention is a UNION of DOS an UNIX directory path names </xs:documentation>
46 <xs:union memberTypes="Directory_DOS Directory_UNIX"/>
48 <xs:simpleType name="Directory_DOS">
50 <xs:documentation xml:lang="en"> Directory naming convention for Windows backslash (\) directory path name </xs:documentation>
52 <xs:restriction base="xs:string">
53 <xs:pattern value="([a-zA-Z]:\\)?(((\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*"/>
56 <xs:simpleType name="Directory_UNIX">
58 <xs:documentation xml:lang="en"> Directory naming convention for UNIX forwardslash (/) directory path name </xs:documentation>
60 <xs:restriction base="xs:string">
61 <xs:pattern value="(\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\/)?)*"/>
64 <xs:simpleType name="E-Mail">
65 <xs:restriction base="xs:string">
66 <xs:pattern value="[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*@[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*"/>
69 <xs:simpleType name="FileNameConvention">
71 <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>
73 <xs:restriction base="xs:string">
74 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*((_)*(-)*(.)*[a-zA-Z0-9]*)*"/>
77 <xs:simpleType name="GuidArrayType">
79 <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>
81 <xs:restriction base="xs:string">
82 <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}( )*(\})?"/>
85 <xs:simpleType name="GuidC_NameType">
87 <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>
89 <xs:restriction base="xs:string">
90 <xs:pattern value="((_)*([a-zA-Z])+((_)*[a-zA-Z0-9]*))*"/>
93 <xs:simpleType name="GuidNamingConvention">
95 <xs:documentation xml:lang="en"> A GUID must contain five different Hexadecimal character sets that are separated by a dash (-) character. </xs:documentation>
97 <xs:restriction base="xs:string">
98 <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}"/>
101 <xs:simpleType name="GuidType">
103 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
105 <xs:union memberTypes="GuidArrayType GuidNamingConvention"/>
107 <xs:simpleType name="Hex64BitDataType">
109 <xs:documentation xml:lang="en">Define a Hex 64 Bit Value to be 0x[a-f0-9]{16}</xs:documentation>
111 <xs:restriction base="xs:string">
112 <xs:pattern value="(0x)?[a-fA-F0-9]{1,16}"/>
115 <xs:simpleType name="HexAddressType">
117 <xs:documentation xml:lang="en">Define a Hex Address, 0x[a-fA-F0-9]{1,16}</xs:documentation>
119 <xs:restriction base="xs:string">
120 <xs:pattern value="0x[a-fA-F0-9]{1,16}"/>
123 <xs:simpleType name="HexByteDataType">
125 <xs:documentation xml:lang="en">Define a Hex Byte Value to be 0x[a-f0-9]{2}</xs:documentation>
127 <xs:restriction base="xs:string">
128 <xs:pattern value="(0x)?[a-fA-F0-9]{1,2}"/>
131 <xs:simpleType name="HexDataType">
133 <xs:documentation xml:lang="en">Define a Hex Value to be 0x[a-f0-9]+</xs:documentation>
135 <xs:restriction base="xs:string">
136 <xs:pattern value="0x[a-fA-F0-9]+"/>
139 <xs:simpleType name="HexDigitType">
141 <xs:documentation xml:lang="en">Define a Hex Diget to be 0x[a-f0-9]</xs:documentation>
143 <xs:restriction base="xs:string">
144 <xs:pattern value="[a-fA-F0-9]{1}"/>
147 <xs:simpleType name="HexDoubleWordDataType">
149 <xs:documentation xml:lang="en">Define a Hex Double Word Value to be 0x[a-f0-9]{8}</xs:documentation>
151 <xs:restriction base="xs:string">
152 <xs:pattern value="0x[a-fA-F0-9]{1,8}"/>
155 <xs:simpleType name="HexWordDataType">
157 <xs:documentation xml:lang="en">Define a Hex Word Value to be 0x[a-f0-9]{4}</xs:documentation>
159 <xs:restriction base="xs:string">
160 <xs:pattern value="0x[a-fA-F0-9]{1,4}"/>
163 <xs:simpleType name="LibraryNameConvention">
165 <xs:documentation xml:lang="en"> This defines what a Library name is: alphanumeric characters and optional underscore (_) characters. </xs:documentation>
167 <xs:restriction base="xs:string">
168 <xs:pattern value="[A-Z][a-zA-Z0-9]*(_*[a-zA-Z0-9])*"/>
171 <xs:simpleType name="NameConvention">
173 <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>
175 <xs:restriction base="xs:normalizedString">
176 <xs:pattern value="(_*[a-zA-Z0-9]*_*)+"/>
179 <xs:simpleType name="Paragraph">
181 <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>
183 <xs:restriction base="xs:string"/>
185 <xs:simpleType name="PathAndFilename">
187 <xs:documentation xml:lang="en"> Naming convention for a path and file name</xs:documentation>
189 <xs:union memberTypes="Directory_DOS Directory_UNIX"/>
191 <xs:simpleType name="PlatformNamingConvention">
193 <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>
195 <xs:restriction base="xs:NCName">
196 <xs:pattern value="(([a-zA-Z][a-zA-Z0-9]*)(_)*(.)*)+"/>
199 <xs:simpleType name="Polarity">
201 <xs:documentation xml:lang="en">Limit Polarity vaild values to -1, 0 and 1</xs:documentation>
203 <xs:restriction base="xs:int">
204 <xs:pattern value="-1|0|1"/>
207 <xs:simpleType name="Sentence">
209 <xs:documentation xml:lang="en"> This data type requires two or more words </xs:documentation>
211 <xs:restriction base="xs:normalizedString">
212 <xs:pattern value="(\w+\W*)+( )+(\W*\w*\W*\s*)*"/>
215 <xs:simpleType name="ToolNameConvention">
217 <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>
219 <xs:restriction base="xs:string">
220 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*(_*-*.*[a-zA-Z0-9])*"/>
223 <xs:simpleType name="ToolsNameConvention">
225 <xs:documentation xml:lang="en">This data type is used for ToolCommand, ToolChainFamily and TagName.</xs:documentation>
227 <xs:restriction base="xs:NCName">
228 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*"/>
231 <xs:simpleType name="UCLetterType">
233 <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>
235 <xs:restriction base="xs:string">
236 <xs:pattern value="[A-Z]{1}"/>
239 <xs:simpleType name="UCNameType">
241 <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>
243 <xs:restriction base="xs:string">
244 <xs:pattern value="[A-Z]+(_*[A-Z0-9]*( )*)*"/>
247 <xs:simpleType name="UserName">
249 <xs:documentation xml:lang="en">Specify a User Name</xs:documentation>
251 <xs:restriction base="xs:string">
252 <xs:pattern value="[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*"/>
255 <xs:simpleType name="V1">
257 <xs:documentation xml:lang="en">%VAR%(Directory)*(File_Names)*</xs:documentation>
259 <xs:restriction base="xs:string">
260 <xs:pattern value="((%[A-Z](_*[A-Z0-9]*)*%)+((((\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*)"/>
263 <xs:simpleType name="V2">
265 <xs:documentation xml:lang="en">($VAR | $( VAR) | ${VAR})(Directory)*(File_Names)</xs:documentation>
267 <xs:restriction base="xs:string">
268 <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])*)+(\/)?)*)*)"/>
271 <xs:simpleType name="VariableConvention">
273 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR% and Directory and File Names</xs:documentation>
275 <xs:union memberTypes="V1 V2"/>
277 <xs:simpleType name="VariableGuidType">
279 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
281 <xs:union memberTypes="GuidArrayType GuidNamingConvention Zero"/>
283 <xs:simpleType name="VariableNamingConvention">
285 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR%</xs:documentation>
287 <xs:union memberTypes="Variable_DOS Variable_UNIX Variable_UNIX_Scope1 Variable_UNIX_Scope2"/>
289 <xs:simpleType name="Variable_DOS">
291 <xs:documentation xml:lang="en"> Definition of a DOS Variable Name: %VAR% It must start with an Upper Case character.</xs:documentation>
293 <xs:restriction base="xs:string">
294 <xs:pattern value="%[A-Z](_*[A-Z0-9]*)*%"/>
297 <xs:simpleType name="Variable_UNIX">
299 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $VAR It must start with an Upper Case character.</xs:documentation>
301 <xs:restriction base="xs:string">
302 <xs:pattern value="$[A-Z](_*[A-Z0-9]*)*"/>
305 <xs:simpleType name="Variable_UNIX_Scope1">
307 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $( VAR1) It must start with an Upper Case character.</xs:documentation>
309 <xs:restriction base="xs:string">
310 <xs:pattern value="$\([A-Z](_*[A-Z0-9]*)*\)"/>
313 <xs:simpleType name="Variable_UNIX_Scope2">
315 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: ${ VAR1} It must start with an Upper Case character.</xs:documentation>
317 <xs:restriction base="xs:string">
318 <xs:pattern value="$\{[A-Z](_*[A-Z0-9]*)*\}"/>
321 <xs:simpleType name="VersionDataType">
323 <xs:documentation xml:lang="en"> Definition of a Version Number, which must be a decimal number (or Zero) </xs:documentation>
325 <xs:restriction base="xs:string">
326 <xs:pattern value="(\d)+(.)?(\d)+"/>
329 <xs:simpleType name="Zero">
331 <xs:documentation xml:lang="en">Define Zero as a vaild value</xs:documentation>
333 <xs:restriction base="xs:int">
334 <xs:pattern value="0"/>
337 <xs:simpleType name="OldVersionDataType">
339 <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>
341 <xs:restriction base="xs:string">
342 <xs:pattern value="([0-9])+[a-zA-Z0-9]*(-?.?([a-zA-Z0-9])*)*"/>
345 <xs:simpleType name="KeywordType">
346 <xs:restriction base="xs:normalizedString">
347 <xs:pattern value="[a-zA-Z]+(_*[a-zA-Z0-9]*)*"/>