summaryrefslogtreecommitdiffstats
path: root/xml/cibtr-2.rng
blob: 36e832817ccae4ace1746d5974fc92e33b14d607 (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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!--
 Copyright 2018 Red Hat, Inc.
 Author: Jan Pokorny <jpokorny@redhat.com>
 Part of pacemaker project
 SPDX-License-Identifier: GPL-2.0-or-later
 -->
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
         xmlns:cibtr="http://clusterlabs.org/ns/pacemaker/cibtr-2"
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <start>
    <ref name="cibtr-2"/>
  </start>

  <define name="cibtr-2">
    <element name="cibtr:map">
      <zeroOrMore>
        <ref name="cibtr-2.table"/>
      </zeroOrMore>
    </element>
  </define>

  <define name="cibtr-2.table">
    <element name="cibtr:table">
      <attribute name="for">
        <data type="ID"/>
      </attribute>
      <attribute name="msg-prefix">
        <data type="string"/>
      </attribute>
      <choice>
        <zeroOrMore>
          <ref name="cibtr-2.replace.nonwhereaware"/>
        </zeroOrMore>
        <group>
          <attribute name="where-cases">
            <!-- pipe-delimited enumeration-->
            <data type="string">
              <param name="minLength">1</param>
            </data>
          </attribute>
          <!-- cannot arrange this as an interleave of
               cibtr-2.replace.whereaware+ and
               cibtr-2.replace.nonwhereaware* because of
               http://relaxng.org/spec-20011203.html#attribute-restrictions -->
          <zeroOrMore>
            <ref name="cibtr-2.replace.whereaware"/>
          </zeroOrMore>
        </group>
      </choice>
    </element>
  </define>

  <!-- leaf attributes -->

  <define name="cibtr-2.replace.attr-in-case-of">
    <attribute name="in-case-of">
      <!-- pipe-delimited enumeration-->
      <data type="string"/>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-in-case-of-droppable-prefix">
    <attribute name="in-case-of-droppable-prefix">
      <!-- just a single argument taken verbatim -->
      <data type="string">
        <param name="minLength">1</param>
      </data>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-msg-extra">
    <attribute name="msg-extra">
      <data type="string">
        <param name="minLength">1</param>
      </data>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-msg-severity">
    <attribute name="msg-severity">
      <choice>
        <value>WARNING</value>
        <value>INFO</value>
        <value>DEBUG</value>
      </choice>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-redefined-as">
    <attribute name="redefined-as">
      <data type="string">
        <param name="minLength">1</param>
      </data>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-what">
    <attribute name="what">
      <data type="NCName"/>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-where">
    <attribute name="where">
      <data type="NCName"/>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-with-possibly">
    <attribute name="with">
      <choice>
        <data type="NCName"/>
        <empty/>
      </choice>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attr-with-surely">
    <attribute name="with">
      <choice>
        <data type="NCName"/>
      </choice>
    </attribute>
  </define>

  <define name="cibtr-2.replace.attrs-common">
    <ref name="cibtr-2.replace.attr-what"/>
    <optional>
      <ref name="cibtr-2.replace.attr-msg-extra"/>
    </optional>
    <optional>
      <ref name="cibtr-2.replace.attr-msg-severity"/>
    </optional>
  </define>

  <define name="cibtr-2.replace.attrs-redefined-as-in-case-of">
   <ref name="cibtr-2.replace.attr-redefined-as"/>
    <!-- can be combined with in-case-of, but cannot be combined
         with in-case-of-droppable-prefix -->
    <optional>
      <ref name="cibtr-2.replace.attr-in-case-of"/>
    </optional>
  </define>

  <!-- leaf production using the above attribute definitions -->

  <define name="cibtr-2.replace.nonwhereaware">
    <element name="cibtr:replace">
      <ref name="cibtr-2.replace.attrs-common"/>
      <choice>
        <group>
          <ref name="cibtr-2.replace.attr-with-possibly"/>
          <optional>
            <choice>
              <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/>
              <ref name="cibtr-2.replace.attr-in-case-of"/>
            </choice>
          </optional>
        </group>
        <group>
          <ref name="cibtr-2.replace.attr-with-surely"/>
          <optional>
            <choice>
              <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/>
              <ref name="cibtr-2.replace.attr-in-case-of"/>
              <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/>
            </choice>
          </optional>
        </group>
      </choice>
    </element>
  </define>

  <define name="cibtr-2.replace.whereaware">
    <element name="cibtr:replace">
      <ref name="cibtr-2.replace.attrs-common"/>
      <!-- cf. comment at cibtr-2.table -->
      <choice>
        <group>
          <ref name="cibtr-2.replace.attr-with-surely"/>
          <ref name="cibtr-2.replace.attr-where"/>
          <optional>
            <choice>
              <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/>
              <ref name="cibtr-2.replace.attr-in-case-of"/>
              <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/>
            </choice>
          </optional>
        </group>
        <group>
          <ref name="cibtr-2.replace.attr-with-surely"/>
          <optional>
            <ref name="cibtr-2.replace.attr-where"/>
          </optional>
          <choice>
            <ref name="cibtr-2.replace.attrs-redefined-as-in-case-of"/>
            <ref name="cibtr-2.replace.attr-in-case-of"/>
            <ref name="cibtr-2.replace.attr-in-case-of-droppable-prefix"/>
          </choice>
        </group>
        <group>
          <ref name="cibtr-2.replace.attr-with-possibly"/>
          <optional>
            <ref name="cibtr-2.replace.attr-in-case-of"/>
          </optional>
        </group>
      </choice>
    </element>
  </define>

</grammar>