@likecoin/epubcheck-ts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +339 -0
  3. package/dist/index.cjs +1904 -0
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.cts +523 -0
  6. package/dist/index.d.ts +523 -0
  7. package/dist/index.js +1895 -0
  8. package/dist/index.js.map +1 -0
  9. package/package.json +69 -0
  10. package/schemas/applications.rng +429 -0
  11. package/schemas/aria.rng +3355 -0
  12. package/schemas/block.rng +488 -0
  13. package/schemas/common.rng +1076 -0
  14. package/schemas/container.rng +24 -0
  15. package/schemas/core-scripting.rng +950 -0
  16. package/schemas/data.rng +161 -0
  17. package/schemas/datatypes.rng +401 -0
  18. package/schemas/embed.rng +980 -0
  19. package/schemas/epub-mathml3-inc.rng +161 -0
  20. package/schemas/epub-nav-30.rnc +44 -0
  21. package/schemas/epub-nav-30.rng +19985 -0
  22. package/schemas/epub-nav-30.sch +87 -0
  23. package/schemas/epub-prefix-attr.rng +17 -0
  24. package/schemas/epub-shared-inc.rng +29 -0
  25. package/schemas/epub-ssml-attrs.rng +17 -0
  26. package/schemas/epub-svg-30.rnc +17 -0
  27. package/schemas/epub-svg-30.rng +19903 -0
  28. package/schemas/epub-svg-30.sch +7 -0
  29. package/schemas/epub-svg-forgiving-inc.rng +315 -0
  30. package/schemas/epub-switch.rng +121 -0
  31. package/schemas/epub-trigger.rng +90 -0
  32. package/schemas/epub-type-attr.rng +12 -0
  33. package/schemas/epub-xhtml-30.rnc +6 -0
  34. package/schemas/epub-xhtml-30.rng +19882 -0
  35. package/schemas/epub-xhtml-30.sch +409 -0
  36. package/schemas/epub-xhtml-inc.rng +151 -0
  37. package/schemas/epub-xhtml-integration.rng +565 -0
  38. package/schemas/epub-xhtml-svg-mathml.rng +17 -0
  39. package/schemas/form-datatypes.rng +54 -0
  40. package/schemas/mathml3-common.rng +336 -0
  41. package/schemas/mathml3-content.rng +1552 -0
  42. package/schemas/mathml3-inc.rng +30 -0
  43. package/schemas/mathml3-presentation.rng +2341 -0
  44. package/schemas/mathml3-strict-content.rng +205 -0
  45. package/schemas/media.rng +374 -0
  46. package/schemas/meta.rng +754 -0
  47. package/schemas/microdata.rng +192 -0
  48. package/schemas/ncx.rng +308 -0
  49. package/schemas/ocf-container-30.rnc +37 -0
  50. package/schemas/ocf-container-30.rng +568 -0
  51. package/schemas/opf.rng +15 -0
  52. package/schemas/opf20.rng +513 -0
  53. package/schemas/package-30.rnc +133 -0
  54. package/schemas/package-30.rng +1153 -0
  55. package/schemas/package-30.sch +444 -0
  56. package/schemas/phrase.rng +746 -0
  57. package/schemas/rdfa.rng +552 -0
  58. package/schemas/revision.rng +106 -0
  59. package/schemas/ruby.rng +141 -0
  60. package/schemas/sectional.rng +278 -0
  61. package/schemas/structural.rng +298 -0
  62. package/schemas/tables.rng +420 -0
  63. package/schemas/web-components.rng +184 -0
  64. package/schemas/web-forms.rng +975 -0
  65. package/schemas/web-forms2.rng +1236 -0
@@ -0,0 +1,409 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
3
+
4
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
5
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
6
+ <ns uri="http://www.w3.org/1998/Math/MathML" prefix="math"/>
7
+ <ns uri="http://www.w3.org/2001/10/synthesis" prefix="ssml"/>
8
+ <ns uri="http://www.w3.org/2001/xml-events" prefix="ev"/>
9
+ <ns uri="http://www.w3.org/2000/svg" prefix="svg"/>
10
+
11
+ <let name="id-set" value="//*[@id]"/>
12
+
13
+ <pattern id="encoding.decl.state">
14
+ <rule context="h:meta[lower-case(@http-equiv)='content-type']">
15
+ <assert test="matches(normalize-space(@content),'text/html;\s*charset=utf-8','i')">The
16
+ meta element in encoding declaration state (http-equiv='content-type') must have the
17
+ value "text/html; charset=utf-8"</assert>
18
+ <assert test="empty(../h:meta[@charset])">A document must not contain both a meta element
19
+ in encoding declaration state (http-equiv='content-type') and a meta element with
20
+ the charset attribute present.</assert>
21
+ </rule>
22
+ </pattern>
23
+
24
+ <pattern id="title.present">
25
+ <rule context="h:head">
26
+ <assert test="exists(h:title)"
27
+ >WARNING: The "head" element should have a "title" child element.</assert>
28
+ </rule>
29
+ </pattern>
30
+
31
+ <pattern id="title.non-empty">
32
+ <rule context="h:title">
33
+ <assert test="normalize-space(.)"
34
+ >Element "title" must not be empty.</assert>
35
+ </rule>
36
+ </pattern>
37
+
38
+ <pattern id="epub.switch.deprecated">
39
+ <rule context="epub:switch">
40
+ <report test="true()"
41
+ >WARNING: The "epub:switch" element is deprecated.</report>
42
+ </rule>
43
+ </pattern>
44
+
45
+ <pattern id="epub.trigger.deprecated">
46
+ <rule context="epub:trigger">
47
+ <report test="true()"
48
+ >WARNING: The "epub:trigger" element is deprecated.</report>
49
+ </rule>
50
+ </pattern>
51
+
52
+ <pattern id="ancestor-area-map" is-a="required-ancestor">
53
+ <param name="descendant" value="h:area"/>
54
+ <param name="ancestor" value="h:map"/>
55
+ </pattern>
56
+
57
+ <pattern id="ancestor-imgismap-ahref" is-a="required-ancestor">
58
+ <param name="descendant" value="h:img[@ismap]"/>
59
+ <param name="ancestor" value="h:a[@href]"/>
60
+ </pattern>
61
+
62
+ <pattern id="descendant-a-interactive" is-a="no-interactive-content-descendants">
63
+ <param name="ancestor" value="h:a"/>
64
+ </pattern>
65
+
66
+ <pattern id="descendant-button-interactive" is-a="no-interactive-content-descendants">
67
+ <param name="ancestor" value="h:button"/>
68
+ </pattern>
69
+
70
+ <pattern id="descendant-audio-audio" is-a="disallowed-descendants">
71
+ <param name="ancestor" value="h:audio"/>
72
+ <param name="descendant" value="h:audio"/>
73
+ </pattern>
74
+
75
+ <pattern id="descendant-audio-video" is-a="disallowed-descendants">
76
+ <param name="ancestor" value="h:audio"/>
77
+ <param name="descendant" value="h:video"/>
78
+ </pattern>
79
+
80
+ <pattern id="descendant-video-video" is-a="disallowed-descendants">
81
+ <param name="ancestor" value="h:video"/>
82
+ <param name="descendant" value="h:video"/>
83
+ </pattern>
84
+
85
+ <pattern id="descendant-video-audio" is-a="disallowed-descendants">
86
+ <param name="ancestor" value="h:video"/>
87
+ <param name="descendant" value="h:audio"/>
88
+ </pattern>
89
+
90
+ <pattern id="descendant-address-address" is-a="disallowed-descendants">
91
+ <param name="ancestor" value="h:address"/>
92
+ <param name="descendant" value="h:address"/>
93
+ </pattern>
94
+
95
+ <pattern id="descendant-address-header" is-a="disallowed-descendants">
96
+ <param name="ancestor" value="h:address"/>
97
+ <param name="descendant" value="h:header"/>
98
+ </pattern>
99
+
100
+ <pattern id="descendant-address-footer" is-a="disallowed-descendants">
101
+ <param name="ancestor" value="h:address"/>
102
+ <param name="descendant" value="h:footer"/>
103
+ </pattern>
104
+
105
+ <pattern id="descendant-form-form" is-a="disallowed-descendants">
106
+ <param name="ancestor" value="h:form"/>
107
+ <param name="descendant" value="h:form"/>
108
+ </pattern>
109
+
110
+ <pattern id="descendant-progress-progress" is-a="disallowed-descendants">
111
+ <param name="ancestor" value="h:progress"/>
112
+ <param name="descendant" value="h:progress"/>
113
+ </pattern>
114
+
115
+ <pattern id="descendant-meter-meter" is-a="disallowed-descendants">
116
+ <param name="ancestor" value="h:meter"/>
117
+ <param name="descendant" value="h:meter"/>
118
+ </pattern>
119
+
120
+ <pattern id="descendant-dfn-dfn" is-a="disallowed-descendants">
121
+ <param name="ancestor" value="h:dfn"/>
122
+ <param name="descendant" value="h:dfn"/>
123
+ </pattern>
124
+
125
+ <pattern id="descendant-caption-table" is-a="disallowed-descendants">
126
+ <param name="ancestor" value="h:caption"/>
127
+ <param name="descendant" value="h:table"/>
128
+ </pattern>
129
+
130
+ <pattern id="descendant-header-header" is-a="disallowed-descendants">
131
+ <param name="ancestor" value="h:header"/>
132
+ <param name="descendant" value="h:header"/>
133
+ </pattern>
134
+
135
+ <pattern id="descendant-header-footer" is-a="disallowed-descendants">
136
+ <param name="ancestor" value="h:header"/>
137
+ <param name="descendant" value="h:footer"/>
138
+ </pattern>
139
+
140
+ <pattern id="descendant-footer-footer" is-a="disallowed-descendants">
141
+ <param name="ancestor" value="h:footer"/>
142
+ <param name="descendant" value="h:footer"/>
143
+ </pattern>
144
+
145
+ <pattern id="descendant-footer-header" is-a="disallowed-descendants">
146
+ <param name="ancestor" value="h:footer"/>
147
+ <param name="descendant" value="h:header"/>
148
+ </pattern>
149
+
150
+ <pattern id="descendant-label-label" is-a="disallowed-descendants">
151
+ <param name="ancestor" value="h:label"/>
152
+ <param name="descendant" value="h:label"/>
153
+ </pattern>
154
+
155
+ <pattern id="bdo-dir" is-a="required-attr">
156
+ <param name="elem" value="h:bdo"/>
157
+ <param name="attr" value="dir"/>
158
+ </pattern>
159
+
160
+ <pattern id="idrefs-aria-describedby" is-a="idrefs-any">
161
+ <param name="element" value="*"/>
162
+ <param name="idrefs-attr-name" value="aria-describedby"/>
163
+ </pattern>
164
+
165
+ <pattern id="idrefs-output-for" is-a="idrefs-any">
166
+ <param name="element" value="h:output"/>
167
+ <param name="idrefs-attr-name" value="for"/>
168
+ </pattern>
169
+
170
+ <pattern id="idrefs-aria-flowto" is-a="idrefs-any">
171
+ <param name="element" value="*"/>
172
+ <param name="idrefs-attr-name" value="aria-flowto"/>
173
+ </pattern>
174
+
175
+ <pattern id="idrefs-aria-labelledby" is-a="idrefs-any">
176
+ <param name="element" value="*"/>
177
+ <param name="idrefs-attr-name" value="aria-labelledby"/>
178
+ </pattern>
179
+
180
+ <pattern id="idrefs-aria-owns" is-a="idrefs-any">
181
+ <param name="element" value="*"/>
182
+ <param name="idrefs-attr-name" value="aria-owns"/>
183
+ </pattern>
184
+
185
+ <pattern id="idrefs-aria-controls" is-a="idrefs-any">
186
+ <param name="element" value="*"/>
187
+ <param name="idrefs-attr-name" value="aria-controls"/>
188
+ </pattern>
189
+
190
+ <pattern id="idref-mathml-xref" is-a="idref-any">
191
+ <param name="element" value="math:*"/>
192
+ <param name="idref-attr-name" value="xref"/>
193
+ </pattern>
194
+
195
+ <pattern id="idref-mathml-indenttarget" is-a="idref-any">
196
+ <param name="element" value="math:*"/>
197
+ <param name="idref-attr-name" value="indenttarget"/>
198
+ </pattern>
199
+
200
+ <pattern id="idref-input-list" is-a="idref-named">
201
+ <param name="element" value="h:input"/>
202
+ <param name="idref-attr-name" value="list"/>
203
+ <param name="target-name" value="h:datalist"/>
204
+ </pattern>
205
+
206
+ <pattern id="idref-forms-form" is-a="idref-named">
207
+ <param name="element" value="h:*"/>
208
+ <param name="idref-attr-name" value="form"/>
209
+ <param name="target-name" value="h:form"/>
210
+ </pattern>
211
+
212
+ <pattern id="idref-aria-activedescendant">
213
+ <rule context="*[@aria-activedescendant]">
214
+ <assert test="descendant::*[@id = current()/@aria-activedescendant]">The
215
+ aria-activedescendant attribute must refer to a descendant element.</assert>
216
+ </rule>
217
+ </pattern>
218
+
219
+ <pattern id="idref-label-for">
220
+ <rule context="h:label[@for]">
221
+ <assert
222
+ test="some $elem in $id-set satisfies $elem/@id eq current()/@for and
223
+ (local-name($elem) eq 'button'
224
+ or (local-name($elem) eq 'input' and not($elem/@type='hidden'))
225
+ or local-name($elem) eq 'meter'
226
+ or local-name($elem) eq 'output'
227
+ or local-name($elem) eq 'progress'
228
+ or local-name($elem) eq 'select'
229
+ or local-name($elem) eq 'textarea')"
230
+ >The for attribute does not refer to an allowed target element (expecting:
231
+ button|meter|output|progress|select|textarea|input[not(@type='hidden')]).</assert>
232
+ </rule>
233
+ </pattern>
234
+
235
+ <pattern id="idrefs-headers">
236
+ <rule context="h:*[@headers]">
237
+ <let name="table" value="ancestor::h:table"/>
238
+ <assert
239
+ test="every $idref in tokenize(normalize-space(@headers), '\s+') satisfies (some $elem in $table//h:th satisfies ($elem/@id eq $idref))"
240
+ >The headers attribute must refer to th elements in the same table.</assert>
241
+ </rule>
242
+ </pattern>
243
+
244
+ <pattern id="idref-trigger-observer" is-a="idref-any">
245
+ <param name="element" value="epub:trigger"/>
246
+ <param name="idref-attr-name" value="ev:observer"/>
247
+ </pattern>
248
+
249
+ <pattern id="idref-trigger-ref" is-a="idref-any">
250
+ <param name="element" value="epub:trigger"/>
251
+ <param name="idref-attr-name" value="ref"/>
252
+ </pattern>
253
+
254
+ <pattern id="map.name">
255
+ <rule context="h:map[@name]">
256
+ <let name="name-set" value="//h:map[@name]"/>
257
+ <assert test="count($name-set[@name = current()/@name]) = 1">Duplicate map name
258
+ "<value-of select="current()/@name"/>"</assert>
259
+ </rule>
260
+ </pattern>
261
+
262
+ <pattern id="map.id">
263
+ <rule context="h:map[@id and @name]">
264
+ <assert test="@id = @name">The id attribute on the map element must have the same value
265
+ as the name attribute.</assert>
266
+ </rule>
267
+ </pattern>
268
+
269
+ <pattern id="lang-xmllang">
270
+ <rule context="h:*[@lang and @xml:lang]">
271
+ <assert test="lower-case(@xml:lang) = lower-case(@lang)">The lang and xml:lang
272
+ attributes must have the same value.</assert>
273
+ </rule>
274
+ </pattern>
275
+
276
+ <pattern id="id-unique">
277
+ <rule context="*[@id]">
278
+ <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID "<value-of
279
+ select="current()/@id"/>"</assert>
280
+ </rule>
281
+ </pattern>
282
+
283
+ <pattern id="select-multiple">
284
+ <rule context="h:select[not(@multiple)]">
285
+ <report test="count(descendant::h:option[@selected]) > 1">A select element whose
286
+ multiple attribute is not specified must not have more than one descendant option
287
+ element with its selected attribute set.</report>
288
+ </rule>
289
+ </pattern>
290
+
291
+ <pattern id="track">
292
+ <rule context="h:track">
293
+ <report test="@label and normalize-space(@label) = ''">The track element label attribute
294
+ value must not be the empty string.</report>
295
+ <report test="@default and preceding-sibling::h:track[@default]">There must not be more
296
+ than one track child of a media element element with the default attribute
297
+ specified.</report>
298
+ </rule>
299
+ </pattern>
300
+
301
+ <pattern id="ssml-ph">
302
+ <rule context="*[@ssml:ph]">
303
+ <report test="ancestor::*[@ssml:ph]">The ssml:ph attribute must not be specified on a
304
+ descendant of an element that also carries this attribute.</report>
305
+ </rule>
306
+ </pattern>
307
+
308
+ <pattern id="link-sizes">
309
+ <rule context="h:link[@sizes]">
310
+ <assert test="@rel='icon'">The sizes attribute must not be specified on link elements
311
+ that do not have a rel attribute that specifies the icon keyword.</assert>
312
+ </rule>
313
+ </pattern>
314
+
315
+ <pattern id="meta-charset">
316
+ <rule context="h:meta[@charset]">
317
+ <assert test="count(preceding-sibling::h:meta[@charset]) = 0">There must not be more
318
+ than one meta element with a charset attribute per document.</assert>
319
+ </rule>
320
+ </pattern>
321
+
322
+ <pattern id="md-a-area">
323
+ <rule context="h:a[@itemprop] | h:area[@itemprop]">
324
+ <assert test="@href">If the itemprop is specified on an a element, then the href
325
+ attribute must also be specified.</assert>
326
+ </rule>
327
+ </pattern>
328
+
329
+ <pattern id="md-iframe-embed-object">
330
+ <rule context="h:iframe[@itemprop] | h:embed[@itemprop] | h:object[@itemprop]">
331
+ <assert test="@data">If the itemprop is specified on an iframe, embed or object element,
332
+ then the data attribute must also be specified.</assert>
333
+ </rule>
334
+ </pattern>
335
+
336
+ <pattern id="md-media">
337
+ <rule context="h:audio[@itemprop] | h:video[@itemprop]">
338
+ <assert test="@src">If the itemprop is specified on an video or audio element, then the
339
+ src attribute must also be specified.</assert>
340
+ </rule>
341
+ </pattern>
342
+
343
+ <pattern abstract="true" id="idref-any">
344
+ <rule context="$element[@$idref-attr-name]">
345
+ <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@$idref-attr-name"
346
+ >The <name path="@$idref-attr-name"/> attribute must refer to an element in the same
347
+ document (the ID "<value-of select="current()/@$idref-attr-name"/>" does not
348
+ exist).</assert>
349
+ </rule>
350
+ </pattern>
351
+
352
+ <pattern abstract="true" id="idrefs-any">
353
+ <rule context="$element[@$idrefs-attr-name]">
354
+ <assert
355
+ test="every $idref in tokenize(normalize-space(@$idrefs-attr-name),'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))"
356
+ >The <name path="@$idrefs-attr-name"/> attribute must refer to elements in the same
357
+ document (target ID missing)</assert>
358
+ </rule>
359
+ </pattern>
360
+
361
+ <pattern abstract="true" id="idref-named">
362
+ <rule context="$element[@$idref-attr-name]">
363
+ <assert test="//$target-name[@id = current()/@$idref-attr-name]">The <name
364
+ path="@$idref-attr-name"/> attribute does not refer to an allowed target element
365
+ (expecting: <value-of select="replace('$target-name','h:','')"/>).</assert>
366
+ </rule>
367
+ </pattern>
368
+
369
+ <pattern abstract="true" id="required-attr">
370
+ <rule context="$elem">
371
+ <assert test="@$attr">The <name/> element must have a <value-of select="'$attr'"/>
372
+ attribute.</assert>
373
+ </rule>
374
+ </pattern>
375
+
376
+ <pattern abstract="true" id="disallowed-descendants">
377
+ <rule context="$descendant">
378
+ <report test="ancestor::$ancestor">The <name/> element must not appear inside <value-of
379
+ select="local-name(ancestor::$ancestor)"/> elements.</report>
380
+ </rule>
381
+ </pattern>
382
+
383
+ <pattern abstract="true" id="required-ancestor">
384
+ <rule context="$descendant">
385
+ <assert test="ancestor::$ancestor">The <value-of select="replace('$descendant','h:','')"
386
+ /> element must have an ancestor <value-of select="replace('$ancestor','h:','')"/>
387
+ element.</assert>
388
+ </rule>
389
+ </pattern>
390
+
391
+ <pattern abstract="true" id="no-interactive-content-descendants">
392
+ <rule
393
+ context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')]
394
+ |h:label|h:menu|h:object[@usemap]|h:select|h:textarea|h:video[@controls]">
395
+ <report test="ancestor::$ancestor">The <name/> element must not appear inside <value-of
396
+ select="local-name(ancestor::$ancestor)"/> elements.</report>
397
+ </rule>
398
+ </pattern>
399
+
400
+ <pattern id="dpub-aria.doc-endnote.deprecated">
401
+ <rule context="h:*[@role]">
402
+ <report test="tokenize(@role,'\s+')='doc-endnote'"
403
+ >WARNING: The "doc-endnote" role is deprecated and should not be used.</report>
404
+ <report test="tokenize(@role,'\s+')='doc-biblioentry'"
405
+ >WARNING: The "doc-biblioentry" role is deprecated and should not be used.</report>
406
+ </rule>
407
+ </pattern>
408
+
409
+ </schema>
@@ -0,0 +1,151 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- Credit: integration adapted from the Nu Html Checker drivers -->
3
+ <grammar ns="http://www.w3.org/1999/xhtml" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
4
+ <!-- ##################################################################### -->
5
+ <include href="common.rng">
6
+ <a:documentation> RELAX NG Schema for XHTML 5 #</a:documentation>
7
+ <!--
8
+ #####################################################################
9
+
10
+ XHTML validation based on the schemas from the Nu Html Checker,
11
+ with the following changes:
12
+ - datatypes replaced to use the patterns in datatype.rnc
13
+ - title element not required (a missing title element will be
14
+ reported as a WARNING in Schematron
15
+ - allows meta http-equiv in encoding declaration state
16
+ - allows the border attribute on tables
17
+ - allow EPUB extensions (epub:type, epub:switch, epub:trigger,
18
+ ssml:* attributes, etc)
19
+
20
+ #####################################################################
21
+ -->
22
+ <a:documentation>Schema Framework &amp; Parameters</a:documentation>
23
+ <!-- XHTML flavor # -->
24
+ <define name="XMLonly">
25
+ <empty/>
26
+ </define>
27
+ <define name="HTMLonly">
28
+ <notAllowed/>
29
+ </define>
30
+ <!-- HTML 4 compat # -->
31
+ <define name="v5only">
32
+ <empty/>
33
+ </define>
34
+ </include>
35
+ <!-- ##################################################################### -->
36
+ <start>
37
+ <a:documentation>Language Definitions</a:documentation>
38
+ <ref name="html.elem"/>
39
+ </start>
40
+ <!--
41
+ Note: these are too simplistic. The Nu HTML Checker performs
42
+ a significant part of the checking in its Java-based datatype
43
+ library.
44
+ -->
45
+ <include href="datatypes.rng">
46
+ <a:documentation>Static datatypes</a:documentation>
47
+ </include>
48
+ <include href="meta.rng">
49
+ <a:documentation>Modules from the Nu HTML Checker</a:documentation>
50
+ <!--
51
+ make the title element optional, since one could see the publication title
52
+ as defining a proper "higher-level protocol"
53
+ the lack of `title` will however raise a WARNING in a Schematron rule
54
+ -->
55
+ <define name="head.inner">
56
+ <interleave>
57
+ <optional>
58
+ <ref name="title.elem"/>
59
+ </optional>
60
+ <optional>
61
+ <ref name="base.elem"/>
62
+ </optional>
63
+ <!-- REVISIT need a non-schema checker or Schematron -->
64
+ <ref name="common.inner.metadata"/>
65
+ </interleave>
66
+ <!-- Limit encoding decl position in Schematron -->
67
+ </define>
68
+ <!--
69
+ Allow http-equiv in encoding declaration state in XHTML too
70
+ (W3C allows that, but not WHATWG)
71
+ -->
72
+ <define name="meta.http-equiv.content-type.elem">
73
+ <element name="meta">
74
+ <interleave>
75
+ <ref name="meta.inner"/>
76
+ <ref name="meta.http-equiv.content-type.attrs"/>
77
+ </interleave>
78
+ </element>
79
+ </define>
80
+ <!--
81
+ Make http-equiv case-insensitive
82
+ This is an ugly hack. Case-insensitiveness would better be solved
83
+ at parsing time.
84
+ -->
85
+ <define name="meta.http-equiv.attrs.http-equiv.content-type">
86
+ <attribute name="http-equiv">
87
+ <data type="string">
88
+ <param name="pattern">[cC][oO][nN][tT][eE][nN][tT]-[tT][yY][pP][eE]</param>
89
+ </data>
90
+ </attribute>
91
+ </define>
92
+ <define name="meta.http-equiv.attrs.http-equiv.refresh">
93
+ <attribute name="http-equiv">
94
+ <data type="string">
95
+ <param name="pattern">[rR][eE][fF][rR][eE][sS][hH]</param>
96
+ </data>
97
+ </attribute>
98
+ </define>
99
+ <define name="meta.http-equiv.attrs.http-equiv.default-style">
100
+ <attribute name="http-equiv">
101
+ <data type="string">
102
+ <param name="pattern">[dD][eE][fF][aA][uU][lL][tT]-[sS][tT][yY][lL][eE]</param>
103
+ </data>
104
+ </attribute>
105
+ </define>
106
+ <define name="meta.http-equiv.attrs.http-equiv.content-security-policy">
107
+ <attribute name="http-equiv">
108
+ <data type="string">
109
+ <param name="pattern">[cC][oO][nN][tT][eE][nN][tT]-[sS][eE][cC][uU][rR][iI][tT][yY]-[pP][oO][lL][iI][cC][yY]</param>
110
+ </data>
111
+ </attribute>
112
+ </define>
113
+ <define name="meta.http-equiv.attrs.http-equiv.x-ua-compatible">
114
+ <attribute name="http-equiv">
115
+ <data type="string">
116
+ <param name="pattern">[xX]-[uU][aA]-[cC][oO][mM][pP][aA][tT][iI][bB][lL][eE]</param>
117
+ </data>
118
+ </attribute>
119
+ </define>
120
+ </include>
121
+ <include href="phrase.rng"/>
122
+ <include href="block.rng"/>
123
+ <include href="sectional.rng"/>
124
+ <include href="structural.rng"/>
125
+ <include href="revision.rng"/>
126
+ <include href="embed.rng"/>
127
+ <include href="ruby.rng"/>
128
+ <include href="media.rng"/>
129
+ <include href="core-scripting.rng"/>
130
+ <include href="tables.rng"/>
131
+ <include href="form-datatypes.rng"/>
132
+ <include href="web-forms.rng"/>
133
+ <include href="web-forms2.rng"/>
134
+ <include href="applications.rng"/>
135
+ <include href="data.rng"/>
136
+ <include href="aria.rng"/>
137
+ <include href="microdata.rng"/>
138
+ <include href="web-components.rng"/>
139
+ <include href="rdfa.rng"/>
140
+ <!-- More tweaks for W3C-allowed features -->
141
+ <define name="table.attrs" combine="interleave">
142
+ <optional>
143
+ <attribute name="border">
144
+ <choice>
145
+ <value/>
146
+ <value>1</value>
147
+ </choice>
148
+ </attribute>
149
+ </optional>
150
+ </define>
151
+ </grammar>