<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/NewXMLSchema" xmlns:tns="http://www.example.org/NewXMLSchema" elementFormDefault="qualified">

    <element name="configuration" type="tns:ParsingConfiguration"></element>
    
    <complexType name="ParsingConfiguration">
        <annotation>
        	<documentation>The parser's Parsing Configuration.
Here you have to define all sections of the document/log file to be parsed
and all parsing tokens (in other words lines of interest) within each section.</documentation>
        </annotation>
        <sequence maxOccurs="unbounded" minOccurs="1">
    		<element name="section" type="tns:ParsingSection"
    			maxOccurs="unbounded" minOccurs="1">
    		</element>
    	</sequence>
    	<attribute name="version" type="string">
    		<annotation>
    			<documentation>The parser's Parsing Configuration. Here you have to define all sections of the document/log file to up</documentation>
    		</annotation></attribute>
    	<attribute name="author" type="string"></attribute>
    	<attribute name="date" type="date"></attribute>
    	<attribute name="comment" type="string"></attribute>
    </complexType>

    <complexType name="ParsingSection">
        <annotation>
        	<documentation>This represents a section of the target file. If the document has more than one sections, then for each them an entry token must be configured, 
denoting this way to the parser that  the parsing section changed. In case all file is parsed within one section, then an entry token is not needed.
Specify the parsing tokens within each section.</documentation>
        </annotation>
        <sequence maxOccurs="unbounded" minOccurs="1">
    		<element name="entryToken" type="tns:ParsingToken"
    			maxOccurs="1" minOccurs="0">
                <annotation>
                	<documentation>This token denotes to the parser that the section has changed to this one.</documentation>
                </annotation>
    		</element>
    		<element name="token" type="tns:ParsingToken"
    			maxOccurs="unbounded" minOccurs="1">
                <annotation>
                	<documentation>The lines to be parsed</documentation>
                </annotation>
    		</element>
    	</sequence>
    	<attribute name="name" type="string" use="required">
    		<annotation>
    			<documentation>Required. This value will be stored in the LogGuard Database as the section of the log file the result value has been parsed into.</documentation>
    		</annotation></attribute>
    	<attribute name="description" type="string" use="optional">
    		<annotation>
    			<documentation>Optional what this section is</documentation>
    		</annotation></attribute>
    	<attribute name="doKeepUnparsedLines" use="optional"
    		default="true" type="tns:TBool">
    		<annotation>
    			<documentation>
    				Denotes if the unparsed lines of the current section
    				will be kept or not. Unparsed lines are those
    				matched but not parsed.
    			</documentation>
    		</annotation>
    	</attribute>
    </complexType>

    <complexType name="ParsingToken">
        <annotation>
        	<documentation>This represents "a line of interest". The attributes denote how to treat the matching and parsing of the line </documentation>
        </annotation>
        <sequence maxOccurs="unbounded" minOccurs="1">
            <annotation>
            	<documentation>The values to be used for matching the lines of the log to the one that interests us.</documentation>
            </annotation>
            <element name="value" type="tns:Value"></element>
    	</sequence>
    	<attribute name="name" type="string" use="required"></attribute>
    	<attribute name="matchRule" use="required" type="tns:TMatchingRule">
    	</attribute>
    	<attribute name="ignoreCase" type="tns:TBool" use="optional"
    		default="false">
    	</attribute>
    	<attribute name="parsingMethod" use="required" type="tns:TParsingMethod">
    		<annotation>
    			<documentation>
    				The method to be used in order to extract a value
    				from a line previously matched.
    			</documentation>
    		</annotation>
    	</attribute>
    	<attribute name="beginIndex" type="int" use="optional"
    		default="0">
    		<annotation>
    			<documentation>
    				If parsing method is ParsingMethod.UseDualOffset
    				then this is the starting index of the string.
    			</documentation>
    		</annotation>
    	</attribute>
    	<attribute name="endIndex" type="int" use="optional"
    		fixed="0">
    		<annotation>
    			<documentation>
    				If parsing method is ParsingMethod.UseDualOffset
    				then this is the end index of the string.
    			</documentation>
    		</annotation>
    	</attribute>
    	<attribute name="beginDelimiter" type="string" use="optional"></attribute>
    	<attribute name="endDelimiter" type="string" use="optional"></attribute>
    	<attribute name="tokenOrder" type="int" use="optional"></attribute>
    	<attribute name="regularExpression" type="string"
    		use="optional">
    	</attribute>
    	<attribute name="className" type="string" use="optional"></attribute>
    	<attribute name="classUri" type="string" use="optional"></attribute>
    </complexType>

    <complexType name="Value">
        <annotation>
        	<documentation>The value to be used for matching</documentation>
        </annotation>
        <attribute name="val" type="string" use="required"></attribute>
    </complexType>

    <simpleType name="TBool">
    	<restriction base="string"></restriction>
    </simpleType>

    <simpleType name="TMatchingRule">
    	<restriction base="string"></restriction>
    </simpleType>

    <simpleType name="TParsingMethod">
    	<restriction base="string"></restriction>
    </simpleType>
</schema>
