<?xml version="1.0" encoding="UTF-8"?>
<rng:grammar xmlns:rng="http://relaxng.org/ns/structure/1.0"
             xmlns:a="http://relaxng.org/ns/annotation/1.0"
             datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
    <!-- Handling of element overloading when inheriting from a base
         template
    -->
    <rng:include href="common.rng"/>
    <rng:define name="gantt">
        <rng:element name="gantt">
            <rng:attribute name="date_start"/>
            <rng:attribute name="date_stop"/>

            <rng:optional><rng:attribute name="class"/></rng:optional>
            <rng:optional><rng:attribute name="js_class"/></rng:optional>
            <rng:optional><rng:attribute name="form_view_id"/></rng:optional>
            <rng:optional><rng:attribute name="progress"/></rng:optional>
            <rng:optional><rng:attribute name="consolidation"/></rng:optional>
            <rng:optional><rng:attribute name="consolidation_max"/></rng:optional>
            <rng:optional><rng:attribute name="consolidation_exclude"/></rng:optional>
            <rng:optional><rng:attribute name="string"/></rng:optional>
            <rng:optional><rng:attribute name="create"/></rng:optional>
            <rng:optional><rng:attribute name="on_create"/></rng:optional>
            <rng:optional><rng:attribute name="edit"/></rng:optional>
            <rng:optional><rng:attribute name="plan"/></rng:optional>
            <rng:optional><rng:attribute name="default_group_by"/></rng:optional>
            <rng:optional><rng:attribute name="display_unavailability"/></rng:optional>
            <rng:optional><rng:attribute name="total_row"/></rng:optional>
            <rng:optional><rng:attribute name="collapse_first_level"/></rng:optional>
            <rng:optional><rng:attribute name="offset"/></rng:optional>
            <rng:optional><rng:attribute name="scales"/></rng:optional>
            <rng:optional><rng:attribute name="thumbnails"/></rng:optional>

            <rng:optional>
                <rng:attribute name="default_scale">
                    <rng:choice>
                        <rng:value>day</rng:value>
                        <rng:value>week</rng:value>
                        <rng:value>month</rng:value>
                        <rng:value>year</rng:value>
                    </rng:choice>
                </rng:attribute>
            </rng:optional>

            <rng:optional><rng:attribute name="precision"/></rng:optional>

            <rng:optional><rng:attribute name="color"/></rng:optional>

            <rng:optional><rng:attribute name="decoration-secondary"/></rng:optional>
            <rng:optional><rng:attribute name="decoration-success"/></rng:optional>
            <rng:optional><rng:attribute name="decoration-info"/></rng:optional>
            <rng:optional><rng:attribute name="decoration-warning"/></rng:optional>
            <rng:optional><rng:attribute name="decoration-danger"/></rng:optional>

            <rng:interleave>
                <rng:zeroOrMore><rng:ref name="field"/></rng:zeroOrMore>
                <rng:optional>
                    <rng:element name="templates">
                        <rng:oneOrMore>
                            <rng:ref name="any"/>
                        </rng:oneOrMore>
                    </rng:element>
                </rng:optional>
            </rng:interleave>

            <rng:empty/>
        </rng:element>
    </rng:define>
    <rng:start>
        <rng:choice>
            <rng:ref name="gantt" />
        </rng:choice>
    </rng:start>
</rng:grammar>
