Definition Type: Element
Name: textfilecontent_item
Namespace: http://oval.mitre.org/XMLSchema/oval-system-characteristics-5#independent
Type: oval-sc:ItemType
Containing Schema: independent-system-characteristics-schema.xsd
Abstract
Documentation:
The textfilecontent_item looks at the contents of a text file (aka a configuration file) by looking at individual lines.
Collapse XSD Schema Diagram:
Drilldown into subexpression in schema independent-system-characteristics-schema_xsd Drilldown into text in schema independent-system-characteristics-schema_xsd Drilldown into line in schema independent-system-characteristics-schema_xsd Drilldown into instance in schema independent-system-characteristics-schema_xsd Drilldown into pattern in schema independent-system-characteristics-schema_xsd Drilldown into filename in schema independent-system-characteristics-schema_xsd Drilldown into path in schema independent-system-characteristics-schema_xsd Drilldown into message in schema oval-system-characteristics-schema_xsd Drilldown into status in schema oval-system-characteristics-schema_xsd Drilldown into id in schema oval-system-characteristics-schema_xsd Drilldown into ItemType in schema oval-system-characteristics-schema_xsdXSD Diagram of textfilecontent_item in schema independent-system-characteristics-schema_xsd (Open Vulnerability and Assessment Language (OVAL®))
Collapse XSD Schema Code:
<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>The path entity specifies the absolute path (without the filename) to the file that is being represented.  Note that the trailing slash should be included.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtitempath" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:path">
                                        <sch:assert test="not(@datatype) or @datatype='string'">item <sch: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 entity specifies the name of the file (without the path) that is being represented.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtitemfilename" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:filename">
                                        <sch:assert test="not(@datatype) or @datatype='string'">item <sch: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="pattern" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>The pattern entity represents a regular expression that is used to define a block of text.  Subexpression notation (parenthesis) is used to call out a value(s) to test against.  For example, the pattern abc(.*)xyz would look for a block of text in the file that starts with abc and ends with xyz, with the subexpression being all the characters that exist inbetween.  Note that if the pattern can match more than one block of text starting at the same point, then it matches the longest. Subexpressions also match the longest possible substrings, subject to the constraint that the whole match be as long as possible, with subexpressions starting earlier in the pattern taking priority over ones starting later.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtitempattern" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:pattern">
                                        <sch:assert test="not(@datatype) or @datatype='string'">item <sch:value-of select="../@id" /> - datatype attribute for the pattern entity of a textfilecontent_item should be 'string'</sch:assert>
                                    </sch:rule>
                                </sch:pattern>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                    <xsd:element name="instance" type="oval-sc:EntityItemIntType" minOccurs="0" maxOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>The instance entity calls out which match of the pattern is being represented by this item.  The main purpose of this entity is too provide uniqueness for different textfilecontent_items that results from multiple matches of a given pattern against the same file.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtiteminstance" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:instance">
                                        <sch:assert test="@datatype='int'">item <sch:value-of select="../@id" /> - datatype attribute for the instance entity of a textfilecontent_item should be 'int'</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 entity has been deprecated and will be removed in version 6.0 of the language.</xsd:documentation>
                            <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" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:line">
                                        <sch:assert test="not(@datatype) or @datatype='string'">item <sch: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="text" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
                        <xsd:annotation>
                            <xsd:documentation>The text entity represents the block of text that matched the specified pattern.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtitemtext" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:text">
                                        <sch:assert test="not(@datatype) or @datatype='string'">item <sch:value-of select="../@id" /> - datatype attribute for the text 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:EntityItemAnyType" minOccurs="0" maxOccurs="unbounded">
                        <xsd:annotation>
                            <xsd:documentation>The subexpression entity represents the value of a subexpression in the specified pattern.  If multiple subexpressions are specified in the pattern, then multiple entities are presented.  Note that the textfilecontent_state in the definition schema only allows a single subexpression entity.  This means that the test will check that all (or at least one, none, etc.) the subexpressions pass the same check.  This means that the order of multiple subexpression entities in the item does not matter.</xsd:documentation>
                            <xsd:appinfo>
                                <sch:pattern id="txtitemsubexpression" xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                                    <sch:rule context="ind-sc:textfilecontent_item/ind-sc:subexpression">
                                        <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>
                                        <!-- we can use the xpath 2.0 function matches() to define assertions for other datatypes -->
                                    </sch:rule>
                                </sch:pattern>
                            </xsd:appinfo>
                        </xsd:annotation>
                    </xsd:element>
                </xsd:sequence>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
Collapse Child Elements:
Name Type Min Occurs Max Occurs
message oval-sc:message 0 1
path ind-sc:path 0 1
filename ind-sc:filename 0 1
pattern ind-sc:pattern 0 1
instance ind-sc:instance 0 1
line ind-sc:line 0 1
text ind-sc:text 0 1
subexpression ind-sc:subexpression 0 unbounded
Collapse Child Attributes:
Name Type Default Value Use
id oval-sc:id Required
status oval-sc:status exists Optional
Collapse Derivation Tree:
Collapse References:
oval-sc:item