<?xml version="1.0" encoding="UTF-8" ?>
<xsd:schema xmlns="http://www.springframework.net/nvelocity"
        xmlns:objects="http://www.springframework.net"
		xmlns:xsd="http://www.w3.org/2001/XMLSchema"
		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
		xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense"
        targetNamespace="http://www.springframework.net/nvelocity"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified"
        vs:friendlyname="Spring.NET NVelocity Templating Framework Configuration"
        vs:ishtmlschema="false"
        vs:iscasesensitive="true"
        vs:requireattributequotes="true"
        vs:defaultnamespacequalifier=""
        vs:defaultnsprefix="">

    <xsd:import namespace="http://www.springframework.net"/>
    <xsd:import namespace="http://www.springframework.net/tool"/>

    <xsd:annotation>
        <xsd:documentation>
            <![CDATA[
            Spring.NET Template Framework Config Schema Definition

            Author: Erez Mazor

            This file defines a configuration schema for the template framework
            object definitions. Using elements from this schema instead of the
            standard object definitions can greatly simplify templating engine configuration.
        ]]>
        </xsd:documentation>
    </xsd:annotation>


    <xsd:complexType name="nvelocityTemplate">
        <xsd:annotation>
            <xsd:documentation><![CDATA[Defines an NVelocity template configuration]]></xsd:documentation>
        </xsd:annotation>
        <xsd:sequence>
            <xsd:element name="nvelocity-properties" type="objects:objectMap" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="resource-loader" type="resourceLoader" minOccurs="0" maxOccurs="1" />
        </xsd:sequence>
        <xsd:attribute name="id" type="objects:nonNullString" use="required">
            <xsd:annotation>
                <xsd:documentation>
                    <![CDATA[The id of the NVelocity template instance to be referenced.]]>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="config-file" use="optional">
            <xsd:simpleType>
                <xsd:annotation>
                    <xsd:documentation><![CDATA[Optional location of a properties file defining the 
                    NVelocity configuration.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:restriction base="objects:nonNullString"/>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="prefer-file-system-access" use="optional" default="true">
            <xsd:simpleType>
                <xsd:annotation>
                    <xsd:documentation><![CDATA[Optional. Instructs the NVelocity engine factory to 
                    attempt use NVelocity's file loader with hot tracking.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:restriction base="xsd:boolean"/>
            </xsd:simpleType>
        </xsd:attribute>
        <xsd:attribute name="override-logging" use="optional" default="true">
            <xsd:simpleType>
                <xsd:annotation>
                    <xsd:documentation><![CDATA[Optional. Instructs the NVelocity engine factory to use the provided 
                    spring commons logging based logging system.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:restriction base="xsd:boolean"/>
            </xsd:simpleType>
        </xsd:attribute>
    </xsd:complexType>


    <xsd:complexType name="resourceLoader">
        <xsd:annotation>
            <xsd:documentation><![CDATA[Defines Assembly based template loader.]]></xsd:documentation>
        </xsd:annotation>
        <xsd:choice>
            <xsd:element name="assembly" minOccurs="1" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation><![CDATA[An assembly based resource loader, when used 
                    NVelocity's AssemblyResourceLoader will be used.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:attribute name="name" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[The name of the assembly.]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:complexType>

            </xsd:element>
            <xsd:element name="file" minOccurs="1" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation><![CDATA[A file based resource loader, when used NVelocity's 
                    FileResourceLoader will be used.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:attribute name="path" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[The qualified path where the template files exists.]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="spring" minOccurs="1" maxOccurs="unbounded">
                <xsd:annotation>
                    <xsd:documentation><![CDATA[A spring resource loader based on spring's resource abstraction. 
                    When used detection of template changes is disabled]]></xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:attribute name="uri" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[A fully qualified spring resource locator 
                            (e.g., file://, assembly://, http://) uri]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="custom" minOccurs="1" maxOccurs="1">
                <xsd:annotation>
                    <xsd:documentation><![CDATA[A custom resource loader.]]></xsd:documentation>
                </xsd:annotation>
                <xsd:complexType>
                    <xsd:attribute name="name" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[A logical name (resource.loader property) for the resource loader 
                            (e.g., custom), cannot contain whitespace.]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                    <xsd:attribute name="description" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[Description (<name>.loader.description property) of the resource loader]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                    <xsd:attribute name="type" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[The type (<name>.resource.loader.class property) of the resource loader]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                    <xsd:attribute name="path" type="objects:nonNullString" use="required">
                        <xsd:annotation>
                            <xsd:documentation><![CDATA[The paths (<name>.resource.loader.path property) of the resource loader]]></xsd:documentation>
                        </xsd:annotation>
                    </xsd:attribute>
                </xsd:complexType>
            </xsd:element>
        </xsd:choice>
        <xsd:attribute name="default-cache-size" type="xsd:integer" use="optional">
            <xsd:annotation>
                <xsd:documentation>
                    <![CDATA[Optional (default is 89, resource.manager.defaultcache.size property), 
                    defines resource manager global cache size
                    applies when caching is turned on]]>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="template-caching" type="xsd:boolean" use="optional">
            <xsd:annotation>
                <xsd:documentation>
                    <![CDATA[Enabled or disables template caching 
                (<name>.resource.loader.cache property) of the resource loader).]]>
                </xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="modification-check-interval" type="xsd:integer" use="optional">
            <xsd:annotation>
                <xsd:documentation><![CDATA[The modification check interval value 
                (<name>.resource.loader.modificationCheckInterval property) of the resource loader, 
                applies only to resource loader with change detection capabilities (file or custom)]]></xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>
    <xsd:element name="engine" type="nvelocityTemplate" />
</xsd:schema>
