Definition Type: Element
Name: variable_test
Namespace: http://oval.mitre.org/XMLSchema/oval#independent
Type: oval:testType
Containing Schema: independent-schema.xsd
Abstract
Documentation:
A variable test allows the value of a variable to be compared to a defined value. An example use would be to validate that a variable being passed in from an external source falls within a specified range.
Collapse XSD Schema Diagram:
Drilldown into item in schema independent-schema_xsd Drilldown into notes in schema oval-schema_xsd Drilldown into comment in schema oval-schema_xsd Drilldown into id in schema oval-schema_xsd Drilldown into testType in schema oval-schema_xsd Drilldown into operation in schema independent-schema_xsdXSD Diagram of variable_test in schema independent-schema_xsd (Open Vulnerability and Assessment Language (OVAL®))
Collapse XSD Schema Code:
<xsd:element name="variable_test" substitutionGroup="oval:test">
    <xsd:annotation>
        <xsd:documentation>A variable test allows the value of a variable to be compared to a defined value.  An example use would be to validate that a variable being passed in from an external source falls within a specified range.</xsd:documentation>
        <xsd:appinfo>
            <test_name>Variable Test</test_name>
            <extends>TestType</extends>
            <valid_sections>[notes], item</valid_sections>
            <example>
                <variable_test id="vct-0" operation="AND" comment="an example variable test" xmlns="http://oval.mitre.org/XMLSchema/oval#independent">
                    <item variable="var-3" datatype="int" operator="greater than">6</item>
                    <item variable="var-3" datatype="int" operator="less than" var_ref="var-6" />
                </variable_test>
            </example>
        </xsd:appinfo>
    </xsd:annotation>
    <xsd:complexType>
        <xsd:complexContent>
            <xsd:extension base="oval:testType">
                <xsd:sequence>
                    <xsd:element name="item" minOccurs="1" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>An 'item' element defines a specific comparison to perform on a variable.  The required 'variable' attribute provides a link to a variable to use.  The optional datatype determines the type of data expected as the value of the 'item' element.  (the default datatype is 'string')  The required 'operator' attribute defines the operator to use for the comparision.  The optional var_ref attribute refers the value of the item to a variable element.  Note that the comparision should read: '*variable* is *operator* the value of the item'.  Also note that it is implied that the datatypes of the two value being compared are the same.</xsd:documentation>
                            <xsd:appinfo>
                                <parent_test>Variable Test</parent_test>
                                <cardinality>1</cardinality>
                                <content>none</content>
                                <valid_datatypes>binary, boolean, component, float, int, string, version</valid_datatypes>
                                <valid_operators>equals, not equal, greater than, less than, greater than or equal, less than or equal, bitwise and, bitwise or, pattern match</valid_operators>
                            </xsd:appinfo>
                        </xsd:annotation>
                        <xsd:complexType>
                            <xsd:complexContent>
                                <xsd:extension base="xsd:anyType">
                                    <xsd:attribute name="variable" type="oval:varid" use="required" />
                                    <xsd:attribute name="datatype" type="oval:datatypes" use="optional" default="string" />
                                    <xsd:attribute name="operator" type="oval:operators" use="optional" default="equals" />
                                    <xsd:attribute name="var_ref" type="oval:varid" use="optional" />
                                </xsd:extension>
                            </xsd:complexContent>
                        </xsd:complexType>
                    </xsd:element>
                </xsd:sequence>
                <xsd:attribute name="operation" type="oval:operations" use="required" />
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
Collapse Child Elements:
Name Type Min Occurs Max Occurs
notes oval:notes 0 1
item independent:item 1 unbounded
Collapse Child Attributes:
Name Type Default Value Use
id oval:id Required
comment oval:comment Required
operation independent:operation Required
Collapse Derivation Tree:
Collapse References:
oval:test