<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         ns="http://jelix.org/ns/module/1.0"
    datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
    >

   <include href="item_infos.rng" />

   <start>
      <element name="module">
         <ref name="info" />
         <optional>
            <ref name="notes" />
         </optional>
         <ref name="dependencies" />
         <optional><ref name="autoloader" /></optional>
      </element>
   </start>

    <define name="autoloader">
        <element name="autoload">
            <zeroOrMore>
                <choice>
                    <element name="autoloader">
                        <attribute name="file" />
                    </element>
                    <element name="class">
                        <attribute name="name" />
                        <attribute name="file" />
                    </element>
                    <element name="classPattern">
                        <attribute name="pattern" />
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                    <element name="namespace">
                        <choice>
                            <attribute name="name" />
                            <attribute name="namespace" />
                        </choice>
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                    <element name="psr0">
                        <choice>
                            <attribute name="name" />
                            <attribute name="namespace" />
                        </choice>
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                    <element name="namespacePathMap">
                        <choice>
                            <attribute name="name" />
                            <attribute name="namespace" />
                        </choice>
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                    <element name="psr4">
                        <choice>
                            <attribute name="name" />
                            <attribute name="namespace" />
                        </choice>
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                    <element name="includePath">
                        <attribute name="dir" />
                        <optional>
                            <attribute name="suffix" />
                        </optional>
                    </element>
                </choice>
            </zeroOrMore>
        </element>
    </define>

</grammar>