<xsd:element name="variable_state" substitutionGroup="oval-def:state">
<xsd:annotation>
<xsd:documentation>The variable_state element contains two entities that are used to check the var_ref of the specified 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="var_ref" type="ind-def:EntityStateVariableRefType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The id of the variable.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="varstevar_ref" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:variable_state/ind-def:var_ref">
<sch:assert test="not(@datatype) or @datatype='string'">
<sch:value-of select="../@id" /> - datatype attribute for the var_ref entity of a variable_state should be 'string'</sch:assert>
</sch:rule>
</sch:pattern>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
<xsd:element name="value" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
<xsd:annotation>
<xsd:documentation>The value of the variable.</xsd:documentation>
<xsd:appinfo>
<sch:pattern id="varstevalue" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
<sch:rule context="ind-def:variable_state/ind-def:value">
<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>
|