inferable grammar

<rng:grammar>
  <rng:start combine="choice">
    <rng:ref name="global-top-level-element" />
  </rng:start>
  <rng:define>
    <rng:attribute>
      <rng:name name="..." ns="..."? />
      <text/> - or - <data .../>
    </rng:attribute>
  <rng:define>
    <rng:element>
      <rng:name name="..." ns="..."? />

      (0) attributes
	<rng:interleave>?
	  (a) local mandatory attribute
	  <rng:attribute name="..." ns="...">
	    <text/> - or - <data .../>
	  </rng:attribute>
	  (b) local optional attribute
	  <rng:optional>
	    <rng:attribute name="..." ns="...">
	      <text/> - or - <data .../>
	    </rng:attribute>
	  </rng:optional>
	  (c) mandatory reference to global attribute
	  <rng:ref name="..." />
	  (d) optional reference to global attribute
	  <rng:optional>
	    <rng:ref name="...">
	  </rng:optional>
	</rng:interleave>
      (1) mandatory ordered pattern
	<rng:group>
	  <rng:ref name="..." />
	    - or -
	  <rng:oneOrMore> (maxOccurs="unbounded")
	    <rng:ref name="..." />
	  </rng:oneOrMore>
	  - or -
	  <rng:mixed>
	      ...
	  </rng:mixed>
	</rng:group>
      (2) optional ordered pattern
	<rng:optional>
	  <rng:group>
	  ...
	  </rng:group>
	    - or -
	  <rng:mixed>
	    <rng:group>
	      ...
	    </rng:group>
	  </rng:mixed>
	</rng:optional>
      (3) unordered pattern
        <rng:zeroOrMore> or <rng:oneOrMore>
	  <rng:choice>
	    ...
	  </rng:choice>
	    - or -
	  <rng:mixed>
	    <rng:choice>
	      ...
	    </rng:choice>
	  </rng:mixed>
        </rng:zeroOrMore> or </rng:oneOrMore>
      (4) empty
        <rng:empty/>
      (5) simple type
	<rng:text/>
	<rng:data type="..." />
    </rng:element>
  </rng:define>
</rng:grammar>
