<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:oval-sc="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5" xmlns:ind-sc="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#independent" xmlns:sch="http://purl.oclc.org/dsdl/schematron" targetNamespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#independent" elementFormDefault="qualified" version="5.1">
	<xsd:import namespace="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5" schemaLocation="oval-system-characteristics-schema.xsd"/>
	<xsd:annotation>
		<xsd:documentation>This document outlines the items of the OVAL System Characteristics XML schema that are independent of any specific family or platform.  Each iten is an extention of a basic System Characteristics item defined in the core System Characteristics XML schema.</xsd:documentation>
		<xsd:documentation>The OVAL Schema is maintained by The Mitre Corporation and developed by the public OVAL Community.  For more information, including how to get involved in the project and how to submit change requests, please visit the OVAL website at http://oval.mitre.org.</xsd:documentation>
		<xsd:appinfo>
			<schema>Independent System Characteristics</schema>
		    <version>5.2</version>
		    <date>31 January 2007</date>
		    <sch:title>schematron validation of the Independent portion of an OVAL System Characteristics file</sch:title>
			<sch:ns prefix="oval-sc" uri="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5"/>
			<sch:ns prefix="ind-sc" uri="http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#independent"/>
		</xsd:appinfo>
	</xsd:annotation>
	<!-- =============================================================================== -->
	<!-- ================================  FAMILY ITEM  ================================ -->
	<!-- =============================================================================== -->
	<xsd:element name="family_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>This element stores high level system OS type, otherwise known as the family.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="family" type="ind-sc:EntityItemFamilyType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>This element describes the name of an environment variable.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="famitemfamily">
										<sch:rule context="ind-sc:family_item/ind-sc:family">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the family entity of a family_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- =============================================================================== -->
	<!-- ===============================  FILE MD5 ITEM  =============================== -->
	<!-- =============================================================================== -->
	<xsd:element name="filemd5_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>This element stores md5 hash associated with a specific file.</xsd:documentation>
		    <xsd:documentation>This item has been deprecated.  You should use the filehash_item instead.  This item will be dropped in the major release of OVAL.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="path" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>Specifies the absolute path to a file on the machine.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="md5itempath">
										<sch:rule context="ind-sc:filemd5_item/ind-sc:path">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the path entity of a filemd5_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="filename" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The name of the file.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="md5itemfilename">
										<sch:rule context="ind-sc:filemd5_item/ind-sc:filename">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the filename entity of a filemd5_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="md5" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The md5 hash of the file</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="md5itemmd5">
										<sch:rule context="ind-sc:filemd5_item/ind-sc:md5">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the md5 entity of a filemd5_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
    <!-- =============================================================================== -->
    <!-- ==============================  FILE HASH ITEM  =============================== -->
    <!-- =============================================================================== -->
    <xsd:element name="filehash_item" substitutionGroup="oval-sc:item">
        <xsd:annotation>
            <xsd:documentation>This element stores the different hash values associated with a specific file.</xsd:documentation>
        </xsd:annotation>
        <xsd:complexType>
            <xsd:complexContent>
                <xsd:extension base="oval-sc:ItemType">
                    <xsd:sequence>
                        <xsd:element name="path" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                            <xsd:annotation>
                                <xsd:documentation>Specifies the absolute path to a file on the machine.</xsd:documentation>
                                <xsd:appinfo>
                                    <sch:pattern id="hashitempath">
                                        <sch:rule context="ind-sc:filehash_item/ind-sc:path">
                                            <sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the path entity of a filehash_item should be 'string'</sch:assert>
                                        </sch:rule>
                                    </sch:pattern>
                                </xsd:appinfo>
                            </xsd:annotation>
                        </xsd:element>
                        <xsd:element name="filename" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                            <xsd:annotation>
                                <xsd:documentation>The name of the file.</xsd:documentation>
                                <xsd:appinfo>
                                    <sch:pattern id="hashitemfilename">
                                        <sch:rule context="ind-sc:filehash_item/ind-sc:filename">
                                            <sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the filename entity of a filehash_item should be 'string'</sch:assert>
                                        </sch:rule>
                                    </sch:pattern>
                                </xsd:appinfo>
                            </xsd:annotation>
                        </xsd:element>
                        <xsd:element name="md5" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                            <xsd:annotation>
                                <xsd:documentation>The md5 hash of the file</xsd:documentation>
                                <xsd:appinfo>
                                    <sch:pattern id="hashitemmd5">
                                        <sch:rule context="ind-sc:filehash_item/ind-sc:md5">
                                            <sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the md5 entity of a filehash_item should be 'string'</sch:assert>
                                        </sch:rule>
                                    </sch:pattern>
                                </xsd:appinfo>
                            </xsd:annotation>
                        </xsd:element>
                        <xsd:element name="sha1" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                            <xsd:annotation>
                                <xsd:documentation>The sha1 hash of the file</xsd:documentation>
                                <xsd:appinfo>
                                    <sch:pattern id="hashitemsha1">
                                        <sch:rule context="ind-sc:filehash_item/ind-sc:sha1">
                                            <sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the sha1 entity of a filehash_item should be 'string'</sch:assert>
                                        </sch:rule>
                                    </sch:pattern>
                                </xsd:appinfo>
                            </xsd:annotation>
                        </xsd:element>
                    </xsd:sequence>
                </xsd:extension>
            </xsd:complexContent>
        </xsd:complexType>
    </xsd:element>
    <!-- =============================================================================== -->
	<!-- =======================  ENVIRONMENT VARIABLE ITEM  =========================== -->
	<!-- =============================================================================== -->
	<xsd:element name="environmentvariable_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>This item stores information about environment variables and their values.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="name" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>This element describes the name of an environment variable.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="envitemname">
										<sch:rule context="ind-sc:environmentvariable_item/ind-sc:name">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the name entity of an environmentvariable_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="value" type="oval-sc:EntityItemAnyType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The actual value of the specified environment variable.</xsd:documentation>
								<xsd:appinfo>
									<!-- no schematron restrictions -->
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- =============================================================================== -->
	<!-- ==========================  TEXT FILE CONTENT ITEM  =========================== -->
	<!-- =============================================================================== -->
	<xsd:element name="textfilecontent_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>The textfilecontent item looks at the contents of a text file (aka a configuration file) by looking at individual lines.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="path" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>Specifies the absolute path to a file on the machine.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="txtitempath">
										<sch:rule context="ind-sc:textfilecontent_item/ind-sc:path">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the path entity of a textfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="filename" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The filename element specifies the name of the file.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="txtitemfilename">
										<sch:rule context="ind-sc:textfilecontent_item/ind-sc:filename">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the filename entity of a textfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="line" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The line element represents a line in the file and is represented using a regular expression.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="txtitemline">
										<sch:rule context="ind-sc:textfilecontent_item/ind-sc:line">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the line entity of a textfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="subexpression" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="unbounded">
							<xsd:annotation>
								<xsd:documentation>Each subexpression in the regular expression of the line element is then tested against the value specified in the subexpression element.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="txtitemsubexpression">
										<sch:rule context="ind-sc:textfilecontent_item/ind-sc:subexpression">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the subexpression entity of a textfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- =============================================================================== -->
	<!-- ===============================  VARIABLE ITEM  =============================== -->
	<!-- =============================================================================== -->
	<xsd:element name="variable_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>This item stores information about OVAL Variables and their values.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="var_ref" type="ind-sc:EntityItemVariableRefType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The id of the variable.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="varitemvar_ref">
										<sch:rule context="ind-sc:variable_item/ind-sc:var_ref">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the var_ref entity of a variable_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="value" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="unbounded">
							<xsd:annotation>
								<xsd:documentation>The value of the variable.  If a variable represents and array of values, then multiple value elements should exist.</xsd:documentation>
								<xsd:appinfo>
									<!-- no schematron restrictions -->
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- =============================================================================== -->
	<!-- ===========================  XML FILE CONTENT ITEM  =========================== -->
	<!-- =============================================================================== -->
	<xsd:element name="xmlfilecontent_item" substitutionGroup="oval-sc:item">
		<xsd:annotation>
			<xsd:documentation>This item stores results from checking the contents of an xml file.</xsd:documentation>
		</xsd:annotation>
		<xsd:complexType>
			<xsd:complexContent>
				<xsd:extension base="oval-sc:ItemType">
					<xsd:sequence>
						<xsd:element name="path" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>Specifies the absolute path to a file on the machine.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="xmlitempath">
										<sch:rule context="ind-sc:xmlfilecontent_item/ind-sc:path">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the path entity of a xmlfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="filename" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The filename element specifies the name of the file.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="xmlitemfilename">
										<sch:rule context="ind-sc:xmlfilecontent_item/ind-sc:filename">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the filename entity of a xmlfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="xpath" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>Specifies an Xpath expression describing the nodes to look at.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="xmlitemxpath">
										<sch:rule context="ind-sc:xmlfilecontent_item/ind-sc:xpath">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the xpath entity of a xmlfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="value_of" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
							<xsd:annotation>
								<xsd:documentation>The value element checks the value of the nodes found.  How this is used is entirely controlled by operator attributes.</xsd:documentation>
								<xsd:appinfo>
									<sch:pattern id="xmlitemvalue_of">
										<sch:rule context="ind-sc:xmlfilecontent_item/ind-sc:value_of">
											<sch:assert test="not(@datatype) or @datatype='string'">item <value-of select="../@id"/> - datatype attribute for the value_of entity of a xmlfilecontent_item should be 'string'</sch:assert>
										</sch:rule>
									</sch:pattern>
								</xsd:appinfo>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
				</xsd:extension>
			</xsd:complexContent>
		</xsd:complexType>
	</xsd:element>
	<!-- =============================================================================== -->
	<!-- =============================================================================== -->
	<!-- =============================================================================== -->
	<xsd:complexType name="EntityItemFamilyType">
		<xsd:annotation>
			<xsd:documentation>The EntityItemFamilyType complex type defines a string entity value that is restricted to a set of enumerations.  Each valid enumeration is a high-level family of system operating system.</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:restriction base="oval-sc:EntityItemStringType">
				<xsd:enumeration value="ios"/>
				<xsd:enumeration value="macos"/>
				<xsd:enumeration value="unix"/>
				<xsd:enumeration value="windows"/>
			</xsd:restriction>
		</xsd:simpleContent>
	</xsd:complexType>
	<xsd:complexType name="EntityItemVariableRefType">
		<xsd:annotation>
			<xsd:documentation>The EntityItemVariableRefType complex type defines a string item entity that has a valid OVAL variable id as the value.</xsd:documentation>
		</xsd:annotation>
		<xsd:simpleContent>
			<xsd:restriction base="oval-sc:EntityItemStringType">
				<xsd:pattern value="oval:[A-Za-z\-\.]+:var:[1-9][0-9]*"/>
			</xsd:restriction>
		</xsd:simpleContent>
	</xsd:complexType>
</xsd:schema>
