summaryrefslogtreecommitdiffstats
path: root/xml/nvset-3.0.rng
blob: 7555dcb078b5807e1dd93688ce726260066ef128 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?xml version="1.0" encoding="UTF-8"?>
<!-- just as nvset-2.9.rng, but allows for instantiated @name restrictions -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0" 
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="element-nvset"/>
  </start>

  <!-- nvpair/@name:
       * generic string by default, parent grammar may want to prohibit
         enumerated names -->
  <define name="element-nvset.name">
    <attribute name="name">
      <text/>
    </attribute>
  </define>

  <!-- nvpair/@name:
       * defer element-nvset.name grammar item
       nvpair/@value:
       generic string by default, parent grammar may want to restrict
       enumerated pairs (i.e. related to @name) at once -->
  <define name="element-nvset.name-value">
    <ref name="element-nvset.name"/>
    <optional>
      <attribute name="value"><text/></attribute>
    </optional>
  </define>

  <define name="element-nvset">
   <choice>
   <attribute name="id-ref"><data type="IDREF"/></attribute>
   <group>
    <attribute name="id"><data type="ID"/></attribute>
    <interleave>
      <optional>
        <externalRef href="rule-2.9.rng"/>
      </optional>
        <zeroOrMore>
          <element name="nvpair">
            <choice>
              <group>
                <attribute name="id-ref"><data type="IDREF"/></attribute>
                <optional>
                  <attribute name="name"><text/></attribute>
                </optional>
              </group>
              <group>
                <attribute name="id"><data type="ID"/></attribute>
                <ref name="element-nvset.name-value"/>
              </group>
            </choice>
          </element>
        </zeroOrMore>
      <optional>
        <externalRef href="score.rng"/>
      </optional>
    </interleave>
   </group>
   </choice>
  </define>

</grammar>