The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
<?xml version="1.0" encoding="UTF-8"?>

<!--
    Schema for eXist Server Configuration file server.xml
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
    <xs:simpleType name="yes_no">
        <xs:restriction base="xs:string">
            <xs:enumeration value="yes"/>
            <xs:enumeration value="no"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:attributeGroup name="service">
        <xs:attribute name="enabled" type="yes_no" default="yes"/>
        <xs:attribute name="context" type="xs:string">
            <xs:annotation>
                <xs:documentation>
                    The context path of the service. Specify an url-pattern as for a servlet-mapping.
                    Example: /xmlrpc/* forwards all paths beginning with /xmlrpc to the xmlrpc service
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:attributeGroup>
    <xs:element name="param">
        <xs:complexType>
            <xs:attribute name="name" type="xs:string"/>
            <xs:attribute name="value" type="xs:string"/>
        </xs:complexType>
    </xs:element>
    <xs:complexType name="service">
        <xs:sequence>
            <xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attributeGroup ref="service"/>
    </xs:complexType>
    <xs:element name="server">
        <xs:annotation>
            <xs:documentation>
                Configures the stand-alone server: the stand-alone server is a minimal
                webserver with just three services enabled by default:
                WebDAV, XML-RPC, REST
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="listener" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element ref="param" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                        <xs:attribute name="protocol" type="xs:string"/>
                        <xs:attribute name="port" type="xs:integer"/>
                        <xs:attribute name="host" type="xs:string" use="optional"/>
                        <xs:attribute name="address" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="webdav" type="service"/>
                <xs:element name="xmlrpc" type="service"/>
                <xs:element name="rest" type="service"/>
                <xs:element name="servlet" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attributeGroup ref="service"/>
                        <xs:attribute name="class" type="xs:string"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="filter" minOccurs="0" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="enabled" type="yes_no" default="yes"/>
                        <xs:attribute name="path" type="xs:string"/>
                        <xs:attribute name="class" type="xs:string"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="forwarding">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="root" minOccurs="0">
                                <xs:annotation>
                                    <xs:documentation>
                                        Define a forwarding for requests to the server root, i.e.
                                        if you access the server without specifying a path
                                    </xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:attribute name="destination" type="xs:string">
                                        <xs:annotation>
                                            <xs:documentation>
                                                The destination path to which the request will be
                                                forwarded.
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                            <xs:element name="forward" minOccurs="0" maxOccurs="unbounded">
                                <xs:annotation>
                                    <xs:documentation>
                                        Define URL forwardings
                                    </xs:documentation>
                                </xs:annotation>
                                <xs:complexType>
                                    <xs:attribute name="path" type="xs:string">
                                        <xs:annotation>
                                            <xs:documentation>
                                                Requests to the given path will be forwarded
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                    <xs:attribute name="destination" type="xs:string">
                                        <xs:annotation>
                                            <xs:documentation>
                                                The destination path to which the request will be
                                                forwarded
                                            </xs:documentation>
                                        </xs:annotation>
                                    </xs:attribute>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>