-
Notifications
You must be signed in to change notification settings - Fork 1
/
ruby.isosch
399 lines (399 loc) · 19 KB
/
ruby.isosch
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<?xml version="1.0" encoding="utf-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<title>ISO Schematron rules</title>
<!-- This file generated 2021-01-30T14:51:52Z by 'extract-isosch.xsl'. -->
<!-- ********************* -->
<!-- namespaces, declared: -->
<!-- ********************* -->
<ns prefix="tei" uri="http://www.tei-c.org/ns/1.0"/>
<ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
<ns prefix="rng" uri="http://relaxng.org/ns/structure/1.0"/>
<ns prefix="r" uri="http://www.tei-c.org/ns/proposal/ruby"/>
<!-- ********************* -->
<!-- namespaces, implicit: -->
<!-- ********************* -->
<ns prefix="dcr" uri="http://www.isocat.org/ns/dcr"/>
<!-- ************ -->
<!-- constraints: -->
<!-- ************ -->
<pattern id="schematron-constraint-ruby-att.datable.w3c-att-datable-w3c-when-1">
<rule context="tei:*[@when]">
<report test="@notBefore|@notAfter|@from|@to" role="nonfatal">The @when attribute cannot be used with any other att.datable.w3c attributes.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.datable.w3c-att-datable-w3c-from-2">
<rule context="tei:*[@from]">
<report test="@notBefore" role="nonfatal">The @from and @notBefore attributes cannot be used together.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.datable.w3c-att-datable-w3c-to-3">
<rule context="tei:*[@to]">
<report test="@notAfter" role="nonfatal">The @to and @notAfter attributes cannot be used together.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.datable-calendar-calendar-4">
<rule context="tei:*[@calendar]">
<assert test="string-length(.) gt 0"> @calendar indicates the system or calendar to
which the date represented by the content of this element belongs, but this
<name/> element has no textual content.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.measurement-att-measurement-unitRef-5">
<rule context="tei:*[@unitRef]">
<report test="@unit" role="info">The @unit attribute may be unnecessary when @unitRef is present.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.typed-subtypeTyped-6">
<rule context="tei:*[@subtype]">
<assert test="@type">The <name/> element should not be categorized in detail with @subtype unless also categorized in general with @type</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.pointing-targetLang-targetLang-7">
<rule context="tei:*[not(self::tei:schemaSpec)][@targetLang]">
<assert test="@target">@targetLang should only be used on <name/> if @target is specified.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.spanning-spanTo-spanTo-2-8">
<rule context="tei:*[@spanTo]">
<assert test="id(substring(@spanTo,2)) and following::*[@xml:id=substring(current()/@spanTo,2)]">
The element indicated by @spanTo (<value-of select="@spanTo"/>) must follow the current element <name/>
</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-att.styleDef-schemeVersion-schemeVersionRequiresScheme-9">
<rule context="tei:*[@schemeVersion]">
<assert test="@scheme and not(@scheme = 'free')">
@schemeVersion can only be used if @scheme is specified.
</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-p-abstractModel-structure-p-10">
<rule context="tei:p">
<report test="not(ancestor::tei:floatingText) and (ancestor::tei:p or ancestor::tei:ab) and not(parent::tei:exemplum |parent::tei:item |parent::tei:note |parent::tei:q |parent::tei:quote |parent::tei:remarks |parent::tei:said |parent::tei:sp |parent::tei:stage |parent::tei:cell |parent::tei:figure )">
Abstract model violation: Paragraphs may not occur inside other paragraphs or ab elements.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-p-abstractModel-structure-l-11">
<rule context="tei:p">
<report test="ancestor::tei:l[not(.//tei:note//tei:p[. = current()])]">
Abstract model violation: Lines may not contain higher-level structural elements such as div, p, or ab.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-desc-deprecationInfo-only-in-deprecated-12">
<rule context="tei:desc[ @type eq 'deprecationInfo']">
<assert test="../@validUntil">Information about a
deprecation should only be present in a specification element
that is being deprecated: that is, only an element that has a
@validUntil attribute should have a child <desc
type="deprecationInfo">.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-ptr-ptrAtts-13">
<rule context="tei:ptr">
<report test="@target and @cRef">Only one of the
attributes @target and @cRef may be supplied on <name/>.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-ref-refAtts-14">
<rule context="tei:ref">
<report test="@target and @cRef">Only one of the
attributes @target' and @cRef' may be supplied on <name/>
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-list-gloss-list-must-have-labels-15">
<rule context="tei:list[@type='gloss']">
<assert test="tei:label">The content of a "gloss" list should include a sequence of one or more pairs of a label element followed by an item element</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-relatedItem-targetorcontent1-16">
<rule context="tei:relatedItem">
<report test="@target and count( child::* ) > 0">
If the @target attribute on <name/> is used, the
relatedItem element must be empty</report>
<assert test="@target or child::*">A relatedItem element should have either a 'target' attribute
or a child element to indicate the related bibliographic item</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-l-abstractModel-structure-l-17">
<rule context="tei:l">
<report test="ancestor::tei:l[not(.//tei:note//tei:l[. = current()])]">
Abstract model violation: Lines may not contain lines or lg elements.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-lg-atleast1oflggapl-18">
<rule context="tei:lg">
<assert test="count(descendant::tei:lg|descendant::tei:l|descendant::tei:gap) > 0">An lg element
must contain at least one child l, lg, or gap element.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-lg-abstractModel-structure-l-19">
<rule context="tei:lg">
<report test="ancestor::tei:l[not(.//tei:note//tei:lg[. = current()])]">
Abstract model violation: Lines may not contain line groups.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-s-noNestedS-20">
<rule context="tei:s">
<report test="tei:s">You may not nest one s element within
another: use seg instead</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-span-targetfrom-21">
<rule context="tei:span">
<report test="@from and @target">
Only one of the attributes @target and @from may be supplied on <name/>
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-span-targetto-22">
<rule context="tei:span">
<report test="@to and @target">
Only one of the attributes @target and @to may be supplied on <name/>
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-span-tonotfrom-23">
<rule context="tei:span">
<report test="@to and not(@from)">
If @to is supplied on <name/>, @from must be supplied as well</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-span-tofrom-24">
<rule context="tei:span">
<report test="contains(normalize-space(@to),' ') or contains(normalize-space(@from),' ')">
The attributes @to and @from on <name/> may each contain only a single value</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-quotation-quotationContents-25">
<rule context="tei:quotation">
<report test="not(@marks) and not (tei:p)">
On <name/>, either the @marks attribute should be used, or a paragraph of description provided</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-link-linkTargets3-26">
<rule context="tei:link">
<assert test="contains(normalize-space(@target),' ')">You must supply at least two values for @target or on <name/>
</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-ab-abstractModel-structure-ab-27">
<rule context="tei:ab">
<report test="not(ancestor::tei:floatingText) and (ancestor::tei:p or ancestor::tei:ab) and not(parent::tei:exemplum |parent::tei:item |parent::tei:note |parent::tei:q |parent::tei:quote |parent::tei:remarks |parent::tei:said |parent::tei:sp |parent::tei:stage |parent::tei:cell |parent::tei:figure)">
Abstract model violation: ab may not occur inside paragraphs or other ab elements.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-ab-abstractModel-structure-l-28">
<rule context="tei:ab">
<report test="ancestor::tei:l or ancestor::tei:lg">
Abstract model violation: Lines may not contain higher-level divisions such as p or ab.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-join-joinTargets3-29">
<rule context="tei:join">
<assert test="contains(@target,' ')">
You must supply at least two values for @target on <name/>
</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-standOff-nested_standOff_should_be_typed-30">
<rule context="tei:standOff">
<assert test="@type or not(ancestor::tei:standOff)">This
<name/> element must have a @type attribute, since it is
nested inside a <name/>
</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-catchwords-catchword_in_msDesc-31">
<rule context="tei:catchwords">
<assert test="ancestor::tei:msDesc or ancestor::tei:egXML">The <name/> element should not be used outside of msDesc.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-dimensions-duplicateDim-32">
<rule context="tei:dimensions">
<report test="count(tei:width)> 1">
The element <name/> may appear once only
</report>
<report test="count(tei:height)> 1">
The element <name/> may appear once only
</report>
<report test="count(tei:depth)> 1">
The element <name/> may appear once only
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-secFol-secFol_in_msDesc-33">
<rule context="tei:secFol">
<assert test="ancestor::tei:msDesc or ancestor::tei:egXML">The <name/> element should not be used outside of msDesc.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-signatures-signatures_in_msDesc-34">
<rule context="tei:signatures">
<assert test="ancestor::tei:msDesc or ancestor::tei:egXML">The <name/> element should not be used outside of msDesc.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-msIdentifier-msId_minimal-35">
<rule context="tei:msIdentifier">
<report test="not(parent::tei:msPart) and (local-name(*[1])='idno' or local-name(*[1])='altIdentifier' or normalize-space(.)='')">An msIdentifier must contain either a repository or location.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-relation-reforkeyorname-36">
<rule context="tei:relation">
<assert test="@ref or @key or @name">One of the attributes 'name', 'ref' or 'key' must be supplied</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-relation-activemutual-37">
<rule context="tei:relation">
<report test="@active and @mutual">Only one of the attributes @active and @mutual may be supplied</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-relation-activepassive-38">
<rule context="tei:relation">
<report test="@passive and not(@active)">the attribute 'passive' may be supplied only if the attribute 'active' is supplied</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-objectIdentifier-objectIdentifier_minimal-39">
<rule context="tei:objectIdentifier">
<report test="not(count(*) gt 0)">An objectIdentifier must contain at minimum a single piece of locating or identifying information.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-shift-shiftNew-40">
<rule context="tei:shift">
<assert test="@new" role="warning">
The @new attribute should always be supplied; use the special value
"normal" to indicate that the feature concerned ceases to be
remarkable at this point.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-rdgGrp-only1lem-41">
<rule context="tei:rdgGrp">
<assert test="count(tei:lem) < 2">Only one <lem> element may appear within a <rdgGrp></assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-variantEncoding-location-variantEncodingLocation-42">
<rule context="tei:variantEncoding">
<assert test="(@location != 'external') or (@method != 'parallel-segmentation')">
The @location value "external" is inconsistent with the
parallel-segmentation method of apparatus markup.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-div-abstractModel-structure-l-45">
<rule context="tei:div">
<report test="ancestor::tei:l">
Abstract model violation: Lines may not contain higher-level structural elements such as div.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-div-abstractModel-structure-p-46">
<rule context="tei:div">
<report test="ancestor::tei:p or ancestor::tei:ab and not(ancestor::tei:floatingText)">
Abstract model violation: p and ab may not contain higher-level structural elements such as div.
</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-path-pathmustnotbeclosed-47">
<rule context="tei:path[@points]">
<let name="firstPair" value="tokenize( normalize-space( @points ), ' ')[1]"/>
<let name="lastPair"
value="tokenize( normalize-space( @points ), ' ')[last()]"/>
<let name="firstX" value="xs:float( substring-before( $firstPair, ',') )"/>
<let name="firstY" value="xs:float( substring-after( $firstPair, ',') )"/>
<let name="lastX" value="xs:float( substring-before( $lastPair, ',') )"/>
<let name="lastY" value="xs:float( substring-after( $lastPair, ',') )"/>
<report test="$firstX eq $lastX and $firstY eq $lastY">The first and
last elements of this path are the same. To specify a closed polygon, use
the zone element rather than the path element. </report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-addSpan-spanTo-48">
<rule context="tei:addSpan">
<assert test="@spanTo">The @spanTo attribute of <name/> is required.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-damageSpan-spanTo-50">
<rule context="tei:damageSpan">
<assert test="@spanTo">
The @spanTo attribute of <name/> is required.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-delSpan-spanTo-52">
<rule context="tei:delSpan">
<assert test="@spanTo">The @spanTo attribute of <name/> is required.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-subst-substContents1-54">
<rule context="tei:subst">
<assert test="child::tei:add and (child::tei:del or child::tei:surplus)">
<name/> must have at least one child add and at least one child del or surplus</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-rt-target-rt-target-not-span-56">
<rule context="r:rt/@target">
<report test="../@from | ../@to">When target= is
present, neither from= nor to= should be.</report>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-rt-from-rt-from-57">
<rule context="r:rt/@from">
<assert test="../@to">When from= is present, the to=
attribute of <name/> is required.</assert>
</rule>
</pattern>
<pattern id="schematron-constraint-ruby-rt-to-rt-to-58">
<rule context="r:rt/@to">
<assert test="../@from">When to= is present, the from=
attribute of <name/> is required.</assert>
</rule>
</pattern>
<!-- *********** -->
<!-- deprecated: -->
<!-- *********** -->
<pattern>
<rule context="tei:value">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:unicodeName">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:localName">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:glyphName">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:charProp">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
<pattern>
<rule context="tei:charName">
<report test="true()" role="nonfatal">
WARNING: use of deprecated element — The <name/> element will be removed from the TEI on 2022-02-15.
</report>
</rule>
</pattern>
</schema>