<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:annotation>
        <xs:documentation>Standard part of any Resource Profile</xs:documentation>
    </xs:annotation>
    <xs:element name="RESOURCE_PROFILE">
        <xs:complexType>
            <xs:sequence>
                <xs:element type="HEADERType" name="HEADER"/>
                <xs:element type="BODYType" name="BODY"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="HEADERType">
        <xs:all>
            <xs:element name="RESOURCE_IDENTIFIER" type="RESOURCE_IDENTIFIERType"/>
            <xs:element type="RESOURCE_TYPEType" name="RESOURCE_TYPE"/>
            <xs:element type="RESOURCE_KINDType" name="RESOURCE_KIND"/>
            <xs:element type="RESOURCE_URIType" name="RESOURCE_URI"/>
            <xs:element name="DATE_OF_CREATION" type="DATEType"/>
        </xs:all>
    </xs:complexType>
    <xs:complexType name="BODYType">
        <xs:sequence>
            <xs:element name="CONFIGURATION" type="CONFIGURATIONType"/>
            <xs:element type="STATUSType" name="STATUS"/>
            <xs:element ref="SECURITY_PARAMETERS"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RESOURCE_IDENTIFIERType">
        <xs:attribute use="required" name="value" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="RESOURCE_TYPEType">
        <xs:attribute name="value" use="required">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="CleanerDSResourceType"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
    <xs:complexType name="RESOURCE_KINDType">
        <xs:attribute use="required" name="value">
            <xs:simpleType>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="CleanerDSResources"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:attribute>
    </xs:complexType>
    <xs:complexType name="RESOURCE_URIType">
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="DATEType">
        <xs:attribute use="required" name="value" type="xs:dateTime"/>
    </xs:complexType>
    <xs:annotation>
        <xs:documentation>Customisable part of any Resource Profile</xs:documentation>
    </xs:annotation>
    <xs:complexType name="CONFIGURATIONType">
        <xs:sequence>
            <xs:element type="xs:string" name="CLEANER_NAME"/>
   			<xs:element type="xs:string" name="CLEANER_DESCRIPTION"/>
            <xs:element type="CLEANERRULESType" name="CLEANER_RULES"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="CLEANERRULESType">
        <xs:sequence>
            <xs:element name="RULE" maxOccurs="unbounded" type="RULEType"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="RULEType">
        <xs:attribute type="xs:string" name="xpath" use="required"/>
        <xs:attribute type="xs:string" name="vocabularies" use="optional"/>
        <xs:attribute type="xs:string" name="groovy" use="optional" />
        <xs:attribute type="xs:boolean" name="strict" use="optional" />
    </xs:complexType>
    <xs:complexType name="STATUSType">
        <xs:all>
            <xs:element type="DATEType" name="LAST_UPDATE"/>
        </xs:all>
    </xs:complexType>
    
    <xs:element type="xs:string" name="SECURITY_PARAMETERS" />
</xs:schema>
