summaryrefslogtreecommitdiffstats
path: root/xml/constraints-1.0.rng
blob: ce273a3fc433975318b3d65d89982a070027ceac (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" 
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
      <ref name="element-constraints"/>
  </start>

  <define name="element-constraints">
    <element name="constraints">
      <zeroOrMore>
        <choice>
          <ref name="element-location"/>
          <ref name="element-colocation"/>
          <ref name="element-order"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>

  <define name="element-location">
    <element name="rsc_location">
      <attribute name="id"><data type="ID"/></attribute>
      <attribute name="rsc"><data type="IDREF"/></attribute>
      <choice>
        <group>
          <externalRef href="score.rng"/>
          <attribute name="node"><text/></attribute>
        </group>
        <oneOrMore>
          <externalRef href="rule.rng"/>
        </oneOrMore>
      </choice>
      <optional>
        <ref name="element-lifetime"/>
      </optional>
    </element>
  </define>

  <define name="element-resource-set">
    <element name="resource_set">
      <choice>
        <attribute name="id-ref"><data type="IDREF"/></attribute>
        <group>
          <attribute name="id"><data type="ID"/></attribute>
          <optional>
            <attribute name="sequential"><data type="boolean"/></attribute>
          </optional>
          <optional>
            <attribute name="action">
              <ref name="attribute-actions"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="role">
              <ref name="attribute-roles"/>
            </attribute>
          </optional>
          <optional>
            <externalRef href="score.rng"/>
          </optional>
          <oneOrMore>
            <element name="resource_ref">
              <attribute name="id"><data type="IDREF"/></attribute>
            </element>
          </oneOrMore>
        </group>
      </choice>
    </element>
  </define>

  <define name="element-colocation">
    <element name="rsc_colocation">
      <attribute name="id"><data type="ID"/></attribute>
      <optional>
        <choice>
          <externalRef href="score.rng"/>
          <attribute name="score-attribute"><text/></attribute>
          <attribute name="score-attribute-mangle"><text/></attribute>
        </choice>
      </optional>
      <optional>
        <ref name="element-lifetime"/>
      </optional>
      <choice>
        <oneOrMore>
          <ref name="element-resource-set"/>
        </oneOrMore>
        <group>
          <attribute name="rsc"><data type="IDREF"/></attribute>
          <attribute name="with-rsc"><data type="IDREF"/></attribute>
          <optional>
            <attribute name="node-attribute"><text/></attribute>
          </optional>
          <optional>
            <attribute name="rsc-role">
              <ref name="attribute-roles"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="with-rsc-role">
              <ref name="attribute-roles"/>
            </attribute>
          </optional>
        </group>
      </choice>
    </element>
  </define>

  <define name="element-order">
    <element name="rsc_order">
      <attribute name="id"><data type="ID"/></attribute>
      <optional>
        <ref name="element-lifetime"/>
      </optional>
      <optional>
        <attribute name="symmetrical"><data type="boolean"/></attribute>
      </optional>
      <optional>
        <choice>
          <externalRef href="score.rng"/>
          <attribute name="kind">
            <ref name="order-types"/>
          </attribute>
        </choice>
      </optional>
      <choice>
        <oneOrMore>
          <ref name="element-resource-set"/>
        </oneOrMore>
        <group>
          <attribute name="first"><data type="IDREF"/></attribute>
          <attribute name="then"><data type="IDREF"/></attribute>
          <optional>
            <attribute name="first-action">
              <ref name="attribute-actions"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="then-action">
              <ref name="attribute-actions"/>
            </attribute>
          </optional>
        </group>
      </choice>
    </element>
  </define>
 
  <define name="attribute-actions">
    <choice>
      <value>start</value>
      <value>promote</value>
      <value>demote</value>
      <value>stop</value>
    </choice>
  </define>
      
  <define name="attribute-roles">
    <choice>
      <value>Stopped</value>
      <value>Started</value>
      <value>Master</value>
      <value>Slave</value>
    </choice>
  </define>

  <define name="order-types">
    <choice>
      <value>Optional</value>
      <value>Mandatory</value>
      <value>Serialize</value>
    </choice>
  </define>

  <define name="element-lifetime">
    <element name="lifetime">
      <oneOrMore>
        <externalRef href="rule.rng"/>
      </oneOrMore>
    </element>
  </define>
  
</grammar>