summaryrefslogtreecommitdiff
path: root/Tools/XMLSchema/NamingConvention.xsd
blob: 978a365ff4b0e25994082067b9ea73ee2eeda3b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?xml version="1.0" encoding="UTF-8"?>
<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">
  <!--
    Filename: NamingConvention.xsd
    
    Copyright (c) 2006, Intel Corp.
    All rights reserved. This program and the accompanying materials
    are licensed and made available under the terms and conditions of the BSD License
    which may be found at http://opensource.org/licenses/bsd-license.php
    
    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
    
  -->
  <xs:annotation>
    <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>
  </xs:annotation>
  <xs:simpleType name="C_NameType">
    <xs:annotation>
      <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>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*(_)*[a-zA-Z]+((_)*[a-zA-Z0-9]*)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="FileNameConvention">
    <xs:annotation>
      <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>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*[a-zA-Z](\.?[\-_a-zA-Z0-9]+)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="GuidType">
    <xs:annotation>
      <xs:documentation xml:lang="en"> The GUID data was a union of GuidType1 and GuidType2; standardizing on GuidType2. </xs:documentation>
    </xs:annotation>
    <xs:union memberTypes="GuidType2"/>
  </xs:simpleType>
  <xs:simpleType name="GuidType1">
    <xs:annotation>
      <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>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*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}( )*(\})?\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="GuidType2">
    <xs:annotation>
      <xs:documentation xml:lang="en"> A GUID must contain five different Hexadecimal character sets that are separated by a dash (-) character. </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*[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}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Hex64BitDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex 64 Bit Value to be 0x[a-f0-9]{16}</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*(0x)?[a-fA-F0-9]{1,16}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexAddressType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Address, 0x[a-fA-F0-9]{1,16}</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*0x[a-fA-F0-9]{1,16}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexByteDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Byte Value to be 0x[a-f0-9]{2}</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*(0x)?[a-fA-F0-9]{1,2}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Value to be 0x[a-f0-9]+</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*0x[a-fA-F0-9]+\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexDigitType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Diget to be 0x[a-f0-9]</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*[a-fA-F0-9]{1}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexDoubleWordDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Double Word Value to be 0x[a-f0-9]{8}</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*0x[a-fA-F0-9]{1,8}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="HexWordDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define a Hex Word Value to be 0x[a-f0-9]{4}</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*0x[a-fA-F0-9]{1,4}\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="KeywordList">
    <xs:restriction base="xs:string">
      <xs:minLength value="1"/>
      <xs:pattern value="\s*[a-zA-Z]+(\ *_*[a-zA-Z0-9]*)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="KeywordType">
    <xs:restriction base="xs:normalizedString">
      <xs:pattern value="\s*[a-zA-Z]+(_*[a-zA-Z0-9]*)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Paragraph">
    <xs:annotation>
      <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>
    </xs:annotation>
    <xs:restriction base="xs:string"/>
  </xs:simpleType>
  <xs:simpleType name="PathAndFilename">
    <xs:annotation>
      <xs:documentation xml:lang="en"> Naming convention for a path and file name</xs:documentation>
    </xs:annotation>
    <xs:union memberTypes="xs:normalizedString xs:anyURI"/>
  </xs:simpleType>
  <xs:simpleType name="Polarity">
    <xs:annotation>
      <xs:documentation xml:lang="en">Limit Polarity vaild values to 0 and 1</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:int">
      <xs:pattern value="\s*0|1\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Sentence">
    <xs:annotation>
      <xs:documentation xml:lang="en"> This data type requires two or more words </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:normalizedString">
      <xs:pattern value="\s*(\w+\W*)+( )+(\W*\w*\W*\s*)*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="ToolsNameConvention">
    <xs:annotation>
      <xs:documentation xml:lang="en">This data type is used for ToolCommand, ToolChainFamily and TagName.</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:NCName">
      <xs:pattern value="\s*[a-zA-Z][a-zA-Z0-9]*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="UCNameType">
    <xs:annotation>
      <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>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*[A-Z]+(_*[A-Z0-9]*)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="VersionDataType">
    <xs:annotation>
      <xs:documentation xml:lang="en"> Definition of a Version Number, which is one or more strings of decimal digits separated by dots. </xs:documentation>
      <xs:documentation>
        The algorithm to compare two versions A and B is as follows. if A==B, then A is the same version as B. Otherwise, say A is a1.a2.a3...an and B is b1.b2.b3...bn. For the first pair (ai, bi), for i less than n and i less than m, where ai is not equal to bi, if ai is less than bi, then A is less than B. If ai is greater than bi, then A is greater than B.   
      </xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:string">
      <xs:pattern value="\s*\d+(\.\d+)*\s*"/>
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="Zero">
    <xs:annotation>
      <xs:documentation xml:lang="en">Define Zero as a vaild value</xs:documentation>
    </xs:annotation>
    <xs:restriction base="xs:int">
      <xs:pattern value="\s*0\s*"/>
    </xs:restriction>
  </xs:simpleType>
</xs:schema>