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="DirectoryNamingConvention">
36 <xs:documentation xml:lang="en"> Directory naming convention is a UNION of DOS an UNIX directory path names </xs:documentation>
38 <xs:union memberTypes="Directory_DOS Directory_UNIX"/>
40 <xs:simpleType name="Directory_DOS">
42 <xs:documentation xml:lang="en"> Directory naming convention for Windows backslash (\) directory path name </xs:documentation>
44 <xs:restriction base="xs:string">
45 <xs:pattern value="([a-zA-Z]:\\)?(((\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*"/>
48 <xs:simpleType name="Directory_UNIX">
50 <xs:documentation xml:lang="en"> Directory naming convention for UNIX forwardslash (/) directory path name </xs:documentation>
52 <xs:restriction base="xs:string">
53 <xs:pattern value="(\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\/)?)*"/>
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]*)*"/>
61 <xs:simpleType name="FileNameConvention">
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>
65 <xs:restriction base="xs:string">
66 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*((_)*(-)*(.)*[a-zA-Z0-9]*)*"/>
69 <xs:simpleType name="GuidArrayType">
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>
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}( )*(\})?"/>
77 <xs:simpleType name="GuidNamingConvention">
79 <xs:documentation xml:lang="en"> A GUID must contain five different Hexadecimal character sets that are separated by a dash (-) character. </xs:documentation>
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}"/>
85 <xs:simpleType name="GuidType">
87 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
89 <xs:union memberTypes="GuidArrayType GuidNamingConvention"/>
91 <xs:simpleType name="Hex64BitDataType">
93 <xs:documentation xml:lang="en">Define a Hex 64 Bit Value to be 0x[a-f0-9]{16}</xs:documentation>
95 <xs:restriction base="xs:string">
96 <xs:pattern value="(0x)?[a-fA-F0-9]{1,16}"/>
99 <xs:simpleType name="HexAddressType">
101 <xs:documentation xml:lang="en">Define a Hex Address, 0x[a-fA-F0-9]{1,16}</xs:documentation>
103 <xs:restriction base="xs:string">
104 <xs:pattern value="0x[a-fA-F0-9]{1,16}"/>
107 <xs:simpleType name="HexByteDataType">
109 <xs:documentation xml:lang="en">Define a Hex Byte Value to be 0x[a-f0-9]{2}</xs:documentation>
111 <xs:restriction base="xs:string">
112 <xs:pattern value="(0x)?[a-fA-F0-9]{1,2}"/>
115 <xs:simpleType name="HexDataType">
117 <xs:documentation xml:lang="en">Define a Hex Value to be 0x[a-f0-9]+</xs:documentation>
119 <xs:restriction base="xs:string">
120 <xs:pattern value="0x[a-fA-F0-9]+"/>
123 <xs:simpleType name="HexDigitType">
125 <xs:documentation xml:lang="en">Define a Hex Diget to be 0x[a-f0-9]</xs:documentation>
127 <xs:restriction base="xs:string">
128 <xs:pattern value="[a-fA-F0-9]{1}"/>
131 <xs:simpleType name="HexDoubleWordDataType">
133 <xs:documentation xml:lang="en">Define a Hex Double Word Value to be 0x[a-f0-9]{8}</xs:documentation>
135 <xs:restriction base="xs:string">
136 <xs:pattern value="0x[a-fA-F0-9]{1,8}"/>
139 <xs:simpleType name="HexWordDataType">
141 <xs:documentation xml:lang="en">Define a Hex Word Value to be 0x[a-f0-9]{4}</xs:documentation>
143 <xs:restriction base="xs:string">
144 <xs:pattern value="0x[a-fA-F0-9]{1,4}"/>
147 <xs:simpleType name="LibraryNameConvention">
149 <xs:documentation xml:lang="en"> This defines what a Library name is: alphanumeric characters and optional underscore (_) characters. </xs:documentation>
151 <xs:restriction base="xs:string">
152 <xs:pattern value="[A-Z][a-zA-Z0-9]*(_*[a-zA-Z0-9])*"/>
155 <xs:simpleType name="NameConvention">
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>
159 <xs:restriction base="xs:normalizedString">
160 <xs:pattern value="(_*[a-zA-Z0-9]*_*)+"/>
163 <xs:simpleType name="Paragraph">
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>
167 <xs:restriction base="xs:normalizedString"/>
169 <xs:simpleType name="PathAndFilename">
171 <xs:documentation xml:lang="en"> Naming convention for a path and file name</xs:documentation>
173 <xs:union memberTypes="Directory_DOS Directory_UNIX"/>
175 <xs:simpleType name="PlatformNamingConvention">
177 <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>
179 <xs:restriction base="xs:string">
180 <xs:pattern value="(([a-zA-Z][a-zA-Z0-9]*)(_)*(.)*)+"/>
183 <xs:simpleType name="Polarity">
185 <xs:documentation xml:lang="en">Limit Polarity vaild values to -1, 0 and 1</xs:documentation>
187 <xs:restriction base="xs:int">
188 <xs:pattern value="-1|0|1"/>
191 <xs:simpleType name="Sentence">
193 <xs:documentation xml:lang="en"> This data type requires two or more words </xs:documentation>
195 <xs:restriction base="xs:normalizedString">
196 <xs:pattern value="(\w+\W*)+( )+(\W*\w*\W*\s*)*"/>
199 <xs:simpleType name="ToolNameConvention">
201 <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>
203 <xs:restriction base="xs:string">
204 <xs:pattern value="[a-zA-Z][a-zA-Z0-9]*(_*-*.*[a-zA-Z0-9])*"/>
207 <xs:simpleType name="UCLetterType">
209 <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>
211 <xs:restriction base="xs:string">
212 <xs:pattern value="[A-Z]{1}"/>
215 <xs:simpleType name="UCNameType">
217 <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>
219 <xs:restriction base="xs:string">
220 <xs:pattern value="[A-Z]+(_*[A-Z0-9]*( )*)*"/>
223 <xs:simpleType name="UserName">
225 <xs:documentation xml:lang="en">Specify a User Name</xs:documentation>
227 <xs:restriction base="xs:string">
228 <xs:pattern value="[a-zA-Z]+(( )*.?-?[a-zA-Z]*)*"/>
231 <xs:simpleType name="V1">
233 <xs:documentation xml:lang="en">%VAR%(Directory)*(File_Names)*</xs:documentation>
235 <xs:restriction base="xs:string">
236 <xs:pattern value="((%[A-Z](_*[A-Z0-9]*)*%)+((((\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\)?)*)"/>
239 <xs:simpleType name="V2">
241 <xs:documentation xml:lang="en">($VAR | $( VAR) | ${VAR})(Directory)*(File_Names)</xs:documentation>
243 <xs:restriction base="xs:string">
244 <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])*)+(\/)?)*)*)"/>
247 <xs:simpleType name="VariableConvention">
249 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR% and Directory and File Names</xs:documentation>
251 <xs:union memberTypes="V1 V2"/>
253 <xs:simpleType name="VariableGuidType">
255 <xs:documentation xml:lang="en"> The GUID data is union of GuidNaming Convetion and GuidArrayType. </xs:documentation>
257 <xs:union memberTypes="GuidArrayType GuidNamingConvention Zero"/>
259 <xs:simpleType name="VariableNamingConvention">
261 <xs:documentation xml:lang="en">VariableConvention is a UNION of: $VAR, $( VAR), ${VAR} and %VAR%</xs:documentation>
263 <xs:union memberTypes="Variable_DOS Variable_UNIX Variable_UNIX_Scope1 Variable_UNIX_Scope2"/>
265 <xs:simpleType name="Variable_DOS">
267 <xs:documentation xml:lang="en"> Definition of a DOS Variable Name: %VAR% It must start with an Upper Case character.</xs:documentation>
269 <xs:restriction base="xs:string">
270 <xs:pattern value="%[A-Z](_*[A-Z0-9]*)*%"/>
273 <xs:simpleType name="Variable_UNIX">
275 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $VAR It must start with an Upper Case character.</xs:documentation>
277 <xs:restriction base="xs:string">
278 <xs:pattern value="$[A-Z](_*[A-Z0-9]*)*"/>
281 <xs:simpleType name="Variable_UNIX_Scope1">
283 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: $( VAR1) It must start with an Upper Case character.</xs:documentation>
285 <xs:restriction base="xs:string">
286 <xs:pattern value="$\([A-Z](_*[A-Z0-9]*)*\)"/>
289 <xs:simpleType name="Variable_UNIX_Scope2">
291 <xs:documentation xml:lang="en"> Definition of a UNIX Variable Name: ${ VAR1} 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="VersionDataType">
299 <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>
301 <xs:restriction base="xs:string">
302 <xs:pattern value="xs:normalizedString"/>
305 <xs:simpleType name="Zero">
307 <xs:documentation xml:lang="en">Define Zero as a vaild value</xs:documentation>
309 <xs:restriction base="xs:int">
310 <xs:pattern value="0"/>
313 <xs:simpleType name="OldVersionDataType">
315 <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>
317 <xs:restriction base="xs:string">
318 <xs:pattern value="([0-9])+[a-zA-Z0-9]*(-?.?([a-zA-Z0-9])*)*"/>