<xsd:element name="sql_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The sql_state element contains two entities that are used to check the name of the specified environment varible and the value associated with it.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:complexContent>
<xsd:extension base="oval-def:StateType">
<xsd:sequence>
<xsd:element name="engine" type="ind-def:EntityObjectEngineType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The engine entity defines a specific database engine.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="sqlsteengine" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:sql_state/ind-def:engine">
<sch:assert test="not(@datatype) or @datatype='string'">
<sch:value-of select="../@id" /> - datatype attribute for the engine entity of an sql_state should be 'string'</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="version" type="oval-def:EntityStateStringType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The version entity defines a specific version of a given database engine.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="sqlsteversion" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:sql_state/ind-def:version">
<sch:assert test="not(@datatype) or @datatype='string'">
<sch:value-of select="../@id" /> - datatype attribute for the version entity of an sql_state should be 'string'</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="connection_string" type="oval-def:EntityStateStringType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The connection_string entity defines a set of parameters that help identify the connection to the database.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="sqlsteconnection_string" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:sql_state/ind-def:connection_string">
<sch:assert test="not(@datatype) or @datatype='string'">
<sch:value-of select="../@id" /> - datatype attribute for the connection_string entity of an sql_state should be 'string'</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="sql" type="oval-def:EntityStateStringType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>the sql entity defines a query used to identify the object(s) to test against.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="sqlstesql" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:sql_state/ind-def:sql">
<sch:assert test="not(@datatype) or @datatype='string'">
<sch:value-of select="../@id" /> - datatype attribute for the sql entity of a sql_state should be 'string'</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="result" type="oval-def:EntityStateAnyType" minOccurs="0">
<xsd:annotation>
<xsd:documentation>The result entity specifies how to test objects in the result set of the specified SQL statement. Only one comparable field is allowed. So if the SQL statement look like 'SELECT name FROM ...', then a result entity with a value of 'Fred' would test the set of 'name' values returned by the SQL statement against the value 'Fred'.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="sqlsteresult" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:sql_state/ind-def:result">
<sch:assert test="(@datatype='int' and (floor(.) = number(.))) or not(@datatype='int') or not(node())">
<sch:value-of select="../@id" /> - The datatype has been set to 'int' but the value is not an integer.</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
|