Debian Codegraph @

schemas/cpe/2.3/cpe-language_2.3.xsd

raw symbols SCIP
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cpe="http://cpe.mitre.org/language/2.0"
3 xmlns:cpe-name="http://cpe.mitre.org/naming/2.0" xmlns:sch="http://purl.oclc.org/dsdl/schematron"
4 targetNamespace="http://cpe.mitre.org/language/2.0" elementFormDefault="qualified"
5 attributeFormDefault="unqualified" version="2.3">
6 <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="../../common/xml.xsd"/>
7 <xsd:import namespace="http://cpe.mitre.org/naming/2.0" schemaLocation="cpe-naming_2.3.xsd"/>
8 <xsd:annotation>
9 <xsd:documentation xml:lang="en">This XML Schema defines the CPE Applicability Language. An individual CPE Name
10 addresses a single part of an actual system. To identify more complex platform types, there needs to be a
11 way to combine different CPE Names using logical operators. For example, there may be a need to identify a
12 platform with a particular operating system AND a certain application. The CPE Applicability Language exists
13 to satisfy this need, enabling the CPE Name for the operating system to be combined with the CPE Name for
14 the application. For more information, consult the CPE Applicability Language Specification document. </xsd:documentation>
15 <xsd:appinfo>
16 <schema>CPE Applicability Language</schema>
17 <author>Neal Ziring, Andrew Buttner, David Waltermire</author>
18 <version>2.3</version>
19 <date>2011-07-29</date>
20 </xsd:appinfo>
21 <xsd:appinfo>
22 <!-- Declare the namespaces for schematron -->
23 <sch:ns prefix="cpe" uri="http://cpe.mitre.org/language/2.0"/>
24 </xsd:appinfo>
25 </xsd:annotation>
26
27 <!-- =============================================================================== -->
28 <!-- =============================================================================== -->
29 <!-- =============================================================================== -->
30 <xsd:element name="platform-specification" type="cpe:platformSpecificationType">
31 <xsd:annotation>
32 <xsd:documentation xml:lang="en">This element is the root element of a CPE Applicability Language XML
33 document and therefore acts as a container for child platform definitions.</xsd:documentation>
34 </xsd:annotation>
35 <xsd:key name="platformKey">
36 <xsd:selector xpath="cpe:platform"/>
37 <xsd:field xpath="@id"/>
38 </xsd:key>
39 </xsd:element>
40
41 <xsd:element name="platform" type="cpe:PlatformType"/>
42 <xsd:element name="platform-configuration" type="cpe:PlatformBaseType"/>
43
44 <xsd:element name="logical-test" type="cpe:LogicalTestType">
45 <xsd:annotation>
46 <xsd:appinfo>
47 <sch:pattern id="nonexistent-child">
48 <sch:rule context="cpe:logical-test">
49 <sch:assert
50 test="count(cpe:logical-test) > 0 or count(cpe:fact-ref) > 0 or count(cpe:check-fact-ref) > 0"
51 >All logical-test elements must contain one or more child logical-test, fact-ref, and/or
52 check-fact-ref elements.</sch:assert>
53 </sch:rule>
54 </sch:pattern>
55 </xsd:appinfo>
56 </xsd:annotation>
57 </xsd:element>
58
59 <xsd:element name="fact-ref" type="cpe:CPEFactRefType"/>
60 <xsd:element name="check-fact-ref" type="cpe:CheckFactRefType"/>
61
62 <!-- =============================================================================== -->
63 <!-- =========================== PLATFORM SPECIFICATION ============================ -->
64 <!-- =============================================================================== -->
65 <xsd:complexType name="platformSpecificationType">
66 <xsd:sequence>
67 <xsd:element ref="cpe:platform" minOccurs="1" maxOccurs="unbounded"/>
68 </xsd:sequence>
69 </xsd:complexType>
70
71 <!-- =============================================================================== -->
72 <!-- ================================== PLATFORM ================================= -->
73 <!-- =============================================================================== -->
74 <xsd:complexType name="PlatformBaseType">
75 <xsd:annotation>
76 <xsd:documentation xml:lang="en">The description or qualifications of a particular IT platform type. The
77 platform is defined by the logical-test child element.</xsd:documentation>
78 </xsd:annotation>
79 <xsd:sequence>
80 <xsd:element name="title" type="cpe:TextType" minOccurs="0" maxOccurs="unbounded">
81 <xsd:annotation>
82 <xsd:documentation xml:lang="en">A human-readable title for a platform. To support uses intended for
83 multiple languages, the title element supports the ‘xml:lang’ attribute. At most one title
84 element can appear for each language.</xsd:documentation>
85 </xsd:annotation>
86 </xsd:element>
87 <xsd:element name="remark" type="cpe:TextType" minOccurs="0" maxOccurs="unbounded">
88 <xsd:annotation>
89 <xsd:documentation xml:lang="en">An additional description. To support uses intended for multiple
90 languages, the remark element supports the ‘xml:lang’ attribute. There can be multiple remarks
91 for a single language.</xsd:documentation>
92 </xsd:annotation>
93 </xsd:element>
94 <xsd:element ref="cpe:logical-test" minOccurs="1" maxOccurs="1">
95 <xsd:annotation>
96 <xsd:documentation xml:lang="en">Definition of test using logical operators (AND, OR,
97 negate).</xsd:documentation>
98 </xsd:annotation>
99 </xsd:element>
100 </xsd:sequence>
101 </xsd:complexType>
102 <xsd:complexType name="PlatformType">
103 <xsd:complexContent>
104 <xsd:extension base="cpe:PlatformBaseType">
105 <xsd:attribute name="id" type="xsd:anyURI" use="required">
106 <xsd:annotation>
107 <xsd:documentation xml:lang="en">A locally unique name for the platform. There is no defined
108 format for this id; however, it must be unique within the containing CPE Applicability
109 Language document.</xsd:documentation>
110 </xsd:annotation>
111 </xsd:attribute>
112 </xsd:extension>
113 </xsd:complexContent>
114 </xsd:complexType>
115 <xsd:complexType name="LogicalTestType">
116 <xsd:annotation>
117 <xsd:documentation xml:lang="en">The logical-test element appears as a child of a platform element, and may
118 also be nested to create more complex logical tests. The content consists of one or more elements:
119 fact-ref, check-fact-ref, and logical-test children are permitted. The operator to be applied, and
120 optional negation of the test, are given as attributes.</xsd:documentation>
121 </xsd:annotation>
122 <xsd:sequence>
123 <xsd:element name="logical-test" type="cpe:LogicalTestType" minOccurs="0" maxOccurs="unbounded">
124 <xsd:annotation>
125 <xsd:documentation xml:lang="en">Definition of complex logical test using AND, OR, and/or negate
126 operators. Evaluates to a TRUE, FALSE, or ERROR result. </xsd:documentation>
127 </xsd:annotation>
128 </xsd:element>
129 <xsd:element ref="cpe:fact-ref" minOccurs="0" maxOccurs="unbounded">
130 <xsd:annotation>
131 <xsd:documentation xml:lang="en">A reference to a bound form of a WFN; the reference always
132 evaluates to a boolean result. The bound name contained within a fact-ref is meant to describe a
133 possible set of products and is not meant to identify a unique product
134 class.</xsd:documentation>
135 </xsd:annotation>
136 </xsd:element>
137 <xsd:element ref="cpe:check-fact-ref" minOccurs="0" maxOccurs="unbounded">
138 <xsd:annotation>
139 <xsd:documentation xml:lang="en">A reference to a check that always evaluates to TRUE, FALSE, or
140 ERROR. Examples of types of checks are OVAL and OCIL checks.</xsd:documentation>
141 </xsd:annotation>
142 </xsd:element>
143 </xsd:sequence>
144 <xsd:attribute name="operator" type="cpe:operatorEnumeration" use="required">
145 <xsd:annotation>
146 <xsd:documentation xml:lang="en">The operator applied to the results of evaluating the fact-ref,
147 check-fact-ref, and logical-test elements. The permitted operators are "AND" and
148 "OR".</xsd:documentation>
149 </xsd:annotation>
150 </xsd:attribute>
151 <xsd:attribute name="negate" type="xsd:boolean" use="required">
152 <xsd:annotation>
153 <xsd:documentation xml:lang="en">Whether the result of applying the operator should be negated. Possible
154 values are "TRUE" and "FALSE". This does not apply if the initial result is
155 ERROR.</xsd:documentation>
156 </xsd:annotation>
157 </xsd:attribute>
158 </xsd:complexType>
159 <xsd:complexType name="FactRefType">
160 <xsd:attribute name="description" type="xsd:normalizedString" use="optional"/>
161 </xsd:complexType>
162 <xsd:complexType name="CPEFactRefType">
163 <xsd:annotation>
164 <xsd:documentation xml:lang="en">A reference to a CPE Name that always evaluates to a Boolean
165 result.</xsd:documentation>
166 </xsd:annotation>
167 <xsd:complexContent>
168 <xsd:extension base="cpe:FactRefType">
169 <xsd:attribute name="name" type="cpe:namePattern" use="required"/>
170 </xsd:extension>
171 </xsd:complexContent>
172 </xsd:complexType>
173 <xsd:complexType name="CheckFactRefType">
174 <xsd:annotation>
175 <xsd:documentation xml:lang="en">A reference to a check that always evaluates to a TRUE, FALSE, or ERROR
176 result.</xsd:documentation>
177 <xsd:documentation xml:lang="en">The CheckFactRefType complex type is used to define an element for holding
178 information about an individual check. It includes a checking system specification URI, string content
179 identifying the check content to invoke, and an external reference. The checking system specification
180 should be the URI that uniquely identifies a revision of a check system language, and the id-ref will be
181 an identifier of a test written in that language. The external reference should be used to point to the
182 content in which the check identifier is defined.</xsd:documentation>
183 </xsd:annotation>
184 <xsd:complexContent>
185 <xsd:extension base="cpe:FactRefType">
186 <xsd:attribute name="system" type="xsd:anyURI" use="required"/>
187 <xsd:attribute name="href" type="xsd:anyURI" use="required"/>
188 <xsd:attribute name="id-ref" type="xsd:token" use="required"/>
189 </xsd:extension>
190 </xsd:complexContent>
191 </xsd:complexType>
192
193 <!-- =============================================================================== -->
194 <!-- =============================== ENUMERATIONS ================================ -->
195 <!-- =============================================================================== -->
196 <xsd:simpleType name="operatorEnumeration">
197 <xsd:annotation>
198 <xsd:documentation xml:lang="en">The OperatorEnumeration simple type defines acceptable operators. Each
199 operator defines how to evaluate multiple arguments.</xsd:documentation>
200 </xsd:annotation>
201 <xsd:restriction base="xsd:string">
202 <xsd:enumeration value="AND"/>
203 <xsd:enumeration value="OR"/>
204 </xsd:restriction>
205 </xsd:simpleType>
206 <!-- =============================================================================== -->
207 <!-- ============================== SUPPORTING TYPES ============================== -->
208 <!-- =============================================================================== -->
209 <xsd:complexType name="TextType">
210 <xsd:annotation>
211 <xsd:documentation xml:lang="en">This type allows the xml:lang attribute to associate a specific language
212 with an element's string content.</xsd:documentation>
213 </xsd:annotation>
214 <xsd:simpleContent>
215 <xsd:extension base="xsd:string">
216 <xsd:attribute ref="xml:lang"/>
217 </xsd:extension>
218 </xsd:simpleContent>
219 </xsd:complexType>
220 <!-- =============================================================================== -->
221 <!-- ================================ ID PATTERNS ================================ -->
222 <!-- =============================================================================== -->
223 <xsd:simpleType name="namePattern">
224 <xsd:union memberTypes="cpe-name:cpe22Type cpe-name:cpe23Type"/>
225 </xsd:simpleType>
226 <!-- ================================================== -->
227 <!-- ===== Change History -->
228 <!-- ================================================== -->
229 <!--
230 v2.2 - Initial working version
231 v2.3 - Various refactoring of types to use element refs. This enables more fine-grained reuse of this schema and allows XSD substitution to be possible.
232 Updated the name pattern.
233 -->
234 </xsd:schema>