<?xml version="1.0" encoding="UTF-8"?>
<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0" 
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <element name="cib">
      <ref name="element-cib"/>
    </element>
  </start>

  <define name="element-cib">
    <ref name="attribute-options"/>
    <element name="configuration">
      <interleave>
	<element name="crm_config">
	  <zeroOrMore>
	    <element name="cluster_property_set">
	      <externalRef href="nvset.rng"/>
	    </element>
	  </zeroOrMore>
	</element>
	<optional>
	  <element name="rsc_defaults">
	    <zeroOrMore>
	      <element name="meta_attributes">
		<externalRef href="nvset.rng"/>
	      </element>
	    </zeroOrMore>
	  </element>
	</optional>
	<optional>
	  <element name="op_defaults">
	    <zeroOrMore>
	      <element name="meta_attributes">
		<externalRef href="nvset.rng"/>
	      </element>
	    </zeroOrMore>
	  </element>
	</optional>
	<ref name="element-nodes"/>
	<element name="resources">
	  <externalRef href="resources-1.0.rng"/>
	</element>
	<element name="constraints">
	  <externalRef href="constraints-1.0.rng"/>
	</element>
      </interleave>
    </element>
    <element name="status">
      <ref name="element-status"/>
    </element>
  </define>

  <define name="attribute-options">
    <externalRef href="versions.rng"/>
    <optional>
      <attribute name="crm_feature_set"><text/></attribute>
    </optional>
    <optional>
      <attribute name="remote-tls-port"><data type="nonNegativeInteger"/></attribute>
    </optional>
    <optional>
      <attribute name="remote-clear-port"><data type="nonNegativeInteger"/></attribute>
    </optional>
    <optional>
      <attribute name="have-quorum"><data type="boolean"/></attribute>
    </optional>
    <optional>
      <attribute name="dc-uuid"><text/></attribute>
    </optional>
    <optional>
      <attribute name="cib-last-written"><text/></attribute>
    </optional>
    <optional>
      <attribute name="no-quorum-panic"><data type="boolean"/></attribute>
    </optional>
  </define>

  <define name="element-nodes">
    <element name="nodes">
      <zeroOrMore>
	<element name="node">
	  <attribute name="id"><text/></attribute>
	  <attribute name="uname"><text/></attribute>
	  <attribute name="type">
	    <choice>
	      <value>normal</value>
	      <value>member</value>
	      <value>ping</value>
	    </choice>
	  </attribute>
	  <optional>
	    <attribute name="description"><text/></attribute>
	  </optional>
	  <zeroOrMore>
	    <element name="instance_attributes">
	      <externalRef href="nvset.rng"/>
	    </element>
	  </zeroOrMore>
	</element>
      </zeroOrMore>
    </element>
  </define>

  <define name="element-status">
    <zeroOrMore>
      <choice>
        <attribute>
          <anyName/>
          <text/>
        </attribute>
        <element>
          <anyName/>
          <ref name="element-status"/>
        </element>
        <text/>
      </choice>
    </zeroOrMore>
  </define>

</grammar>
