nora_mark 0.2beta3 → 0.2beta4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +5 -0
  3. data/Gemfile +2 -0
  4. data/README.md +17 -12
  5. data/example/nora-simple.css +52 -0
  6. data/example/noramark-reference-ja.nora +246 -0
  7. data/example/noramark-reference-ja_00001.xhtml +187 -0
  8. data/lib/nora_mark/html/{abstract_item_writer.rb → abstract_node_writer.rb} +3 -3
  9. data/lib/nora_mark/html/context.rb +3 -21
  10. data/lib/nora_mark/html/frontmatter_writer.rb +33 -0
  11. data/lib/nora_mark/html/generator.rb +122 -100
  12. data/lib/nora_mark/html/pages.rb +3 -9
  13. data/lib/nora_mark/html/paragraph_writer.rb +27 -23
  14. data/lib/nora_mark/html/tag_writer.rb +33 -34
  15. data/lib/nora_mark/html/writer_selector.rb +3 -3
  16. data/lib/nora_mark/node.rb +31 -0
  17. data/lib/nora_mark/parser.kpeg +133 -79
  18. data/lib/nora_mark/parser.kpeg.rb +1822 -1526
  19. data/lib/nora_mark/parser.rb +4 -23
  20. data/lib/nora_mark/version.rb +1 -1
  21. data/lib/nora_mark.rb +7 -2
  22. data/nora_mark.gemspec +1 -0
  23. data/spec/epub30-schemas/epub-nav-30.nvdl +16 -0
  24. data/spec/epub30-schemas/epub-nav-30.rnc +10 -0
  25. data/spec/epub30-schemas/epub-nav-30.sch +72 -0
  26. data/spec/epub30-schemas/epub-svg-30.nvdl +15 -0
  27. data/spec/epub30-schemas/epub-svg-30.rnc +15 -0
  28. data/spec/epub30-schemas/epub-svg-30.sch +10 -0
  29. data/spec/epub30-schemas/epub-xhtml-30.nvdl +15 -0
  30. data/spec/epub30-schemas/epub-xhtml-30.rnc +37 -0
  31. data/spec/epub30-schemas/epub-xhtml-30.sch +377 -0
  32. data/spec/epub30-schemas/epub30-catalog.xml +335 -0
  33. data/spec/epub30-schemas/media-overlay-30.nvdl +14 -0
  34. data/spec/epub30-schemas/media-overlay-30.rnc +46 -0
  35. data/spec/epub30-schemas/media-overlay-30.sch +9 -0
  36. data/spec/epub30-schemas/mod/datatypes.rnc +143 -0
  37. data/spec/epub30-schemas/mod/epub-mathml3-30.rnc +74 -0
  38. data/spec/epub30-schemas/mod/epub-prefix-attr.rnc +8 -0
  39. data/spec/epub30-schemas/mod/epub-ssml-attrs.rnc +11 -0
  40. data/spec/epub30-schemas/mod/epub-svg11-30.rnc +12 -0
  41. data/spec/epub30-schemas/mod/epub-svg11-re.sch +7 -0
  42. data/spec/epub30-schemas/mod/epub-switch.rnc +32 -0
  43. data/spec/epub30-schemas/mod/epub-trigger.rnc +17 -0
  44. data/spec/epub30-schemas/mod/epub-type-attr.rnc +7 -0
  45. data/spec/epub30-schemas/mod/epub-xhtml-mathml3-30.rnc +5 -0
  46. data/spec/epub30-schemas/mod/epub-xhtml-svg11-30.rnc +6 -0
  47. data/spec/epub30-schemas/mod/html5/LICENSE +23 -0
  48. data/spec/epub30-schemas/mod/html5/README +21 -0
  49. data/spec/epub30-schemas/mod/html5/html5-aria-30.rnc +105 -0
  50. data/spec/epub30-schemas/mod/html5/html5-attrib-30.rnc +44 -0
  51. data/spec/epub30-schemas/mod/html5/html5-document-30.rnc +44 -0
  52. data/spec/epub30-schemas/mod/html5/html5-edit-30.rnc +24 -0
  53. data/spec/epub30-schemas/mod/html5/html5-embed-30.rnc +155 -0
  54. data/spec/epub30-schemas/mod/html5/html5-forms-30.rnc +431 -0
  55. data/spec/epub30-schemas/mod/html5/html5-grouping-30.rnc +115 -0
  56. data/spec/epub30-schemas/mod/html5/html5-interactive-30.rnc +86 -0
  57. data/spec/epub30-schemas/mod/html5/html5-models-30.rnc +10 -0
  58. data/spec/epub30-schemas/mod/html5/html5-phrasing-30.rnc +134 -0
  59. data/spec/epub30-schemas/mod/html5/html5-script-30.rnc +164 -0
  60. data/spec/epub30-schemas/mod/html5/html5-sections-30.rnc +58 -0
  61. data/spec/epub30-schemas/mod/html5/html5-style-30.rnc +18 -0
  62. data/spec/epub30-schemas/mod/id-unique.sch +10 -0
  63. data/spec/epub30-schemas/mod/mathml/LICENSE +3 -0
  64. data/spec/epub30-schemas/mod/mathml/mathml3-common.rnc +84 -0
  65. data/spec/epub30-schemas/mod/mathml/mathml3-content.rnc +373 -0
  66. data/spec/epub30-schemas/mod/mathml/mathml3-presentation.rnc +536 -0
  67. data/spec/epub30-schemas/mod/mathml/mathml3-strict-content.rnc +60 -0
  68. data/spec/epub30-schemas/mod/security/LICENSE +4 -0
  69. data/spec/epub30-schemas/mod/security/Lenient-Encryption11-ghc.rnc +41 -0
  70. data/spec/epub30-schemas/mod/security/Lenient-Encryption11.rnc +39 -0
  71. data/spec/epub30-schemas/mod/security/Lenient-Signature-exclusiveC14N.rnc +25 -0
  72. data/spec/epub30-schemas/mod/security/Lenient-Signature11-properties-exclusiveC14N.rnc +32 -0
  73. data/spec/epub30-schemas/mod/security/Lenient-Signature11-properties.rnc +30 -0
  74. data/spec/epub30-schemas/mod/security/Lenient-Signature11.rnc +28 -0
  75. data/spec/epub30-schemas/mod/security/Strict-Encryption.rnc +27 -0
  76. data/spec/epub30-schemas/mod/security/Strict-Signature.rnc +22 -0
  77. data/spec/epub30-schemas/mod/security/exc-c14n.rnc +39 -0
  78. data/spec/epub30-schemas/mod/security/security_any.rnc +15 -0
  79. data/spec/epub30-schemas/mod/security/xenc-allowAnyForeign.rnc +25 -0
  80. data/spec/epub30-schemas/mod/security/xenc-schema-11.rnc +96 -0
  81. data/spec/epub30-schemas/mod/security/xenc-schema.rnc +145 -0
  82. data/spec/epub30-schemas/mod/security/xenc11-allowAnyForeign.rnc +19 -0
  83. data/spec/epub30-schemas/mod/security/xmldsig-allowAnyForeign.rnc +47 -0
  84. data/spec/epub30-schemas/mod/security/xmldsig-core-schema.rnc +276 -0
  85. data/spec/epub30-schemas/mod/security/xmldsig-filter2.rnc +16 -0
  86. data/spec/epub30-schemas/mod/security/xmldsig-properties-schema.rnc +34 -0
  87. data/spec/epub30-schemas/mod/security/xmldsig11-allowAnyForeign.rnc +18 -0
  88. data/spec/epub30-schemas/mod/security/xmldsig11-schema.rnc +133 -0
  89. data/spec/epub30-schemas/mod/security/xmlsec-ghc-allowAnyForeign.rnc +21 -0
  90. data/spec/epub30-schemas/mod/security/xmlsec-ghc-schema.rnc +42 -0
  91. data/spec/epub30-schemas/mod/svg11/LICENSE +1 -0
  92. data/spec/epub30-schemas/mod/svg11/README.txt +8 -0
  93. data/spec/epub30-schemas/mod/svg11/svg11-flat.rnc +3999 -0
  94. data/spec/epub30-schemas/ocf-container-30.rnc +16 -0
  95. data/spec/epub30-schemas/ocf-encryption-30.rnc +12 -0
  96. data/spec/epub30-schemas/ocf-signatures-30.rnc +8 -0
  97. data/spec/epub30-schemas/package-30.nvdl +14 -0
  98. data/spec/epub30-schemas/package-30.rnc +91 -0
  99. data/spec/epub30-schemas/package-30.sch +137 -0
  100. data/spec/jing-20091111/bin/jing.jar +0 -0
  101. data/spec/nora_mark_spec.rb +229 -68
  102. data/spec/spec_helper.rb +16 -0
  103. metadata +179 -6
  104. data/lib/nora_mark/html/header_writer.rb +0 -35
  105. data/spec/fixture/test_src_ja.nora +0 -50
@@ -0,0 +1,377 @@
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="ancestor-area-map" is-a="required-ancestor">
14
+ <param name="descendant" value="h:area"/>
15
+ <param name="ancestor" value="h:map"/>
16
+ </pattern>
17
+
18
+ <pattern id="ancestor-imgismap-ahref" is-a="required-ancestor">
19
+ <param name="descendant" value="h:img[@ismap]"/>
20
+ <param name="ancestor" value="h:a[@href]"/>
21
+ </pattern>
22
+
23
+ <pattern id="descendant-a-interactive" is-a="no-interactive-content-descendants">
24
+ <param name="ancestor" value="h:a"/>
25
+ </pattern>
26
+
27
+ <pattern id="descendant-button-interactive" is-a="no-interactive-content-descendants">
28
+ <param name="ancestor" value="h:button"/>
29
+ </pattern>
30
+
31
+ <pattern id="descendant-audio-audio" is-a="disallowed-descendants">
32
+ <param name="ancestor" value="h:audio"/>
33
+ <param name="descendant" value="h:audio"/>
34
+ </pattern>
35
+
36
+ <pattern id="descendant-audio-video" is-a="disallowed-descendants">
37
+ <param name="ancestor" value="h:audio"/>
38
+ <param name="descendant" value="h:video"/>
39
+ </pattern>
40
+
41
+ <pattern id="descendant-video-video" is-a="disallowed-descendants">
42
+ <param name="ancestor" value="h:video"/>
43
+ <param name="descendant" value="h:video"/>
44
+ </pattern>
45
+
46
+ <pattern id="descendant-video-audio" is-a="disallowed-descendants">
47
+ <param name="ancestor" value="h:video"/>
48
+ <param name="descendant" value="h:audio"/>
49
+ </pattern>
50
+
51
+ <pattern id="descendant-address-address" is-a="disallowed-descendants">
52
+ <param name="ancestor" value="h:address"/>
53
+ <param name="descendant" value="h:address"/>
54
+ </pattern>
55
+
56
+ <pattern id="descendant-address-header" is-a="disallowed-descendants">
57
+ <param name="ancestor" value="h:address"/>
58
+ <param name="descendant" value="h:header"/>
59
+ </pattern>
60
+
61
+ <pattern id="descendant-address-footer" is-a="disallowed-descendants">
62
+ <param name="ancestor" value="h:address"/>
63
+ <param name="descendant" value="h:footer"/>
64
+ </pattern>
65
+
66
+ <pattern id="descendant-form-form" is-a="disallowed-descendants">
67
+ <param name="ancestor" value="h:form"/>
68
+ <param name="descendant" value="h:form"/>
69
+ </pattern>
70
+
71
+ <pattern id="descendant-progress-progress" is-a="disallowed-descendants">
72
+ <param name="ancestor" value="h:progress"/>
73
+ <param name="descendant" value="h:progress"/>
74
+ </pattern>
75
+
76
+ <pattern id="descendant-meter-meter" is-a="disallowed-descendants">
77
+ <param name="ancestor" value="h:meter"/>
78
+ <param name="descendant" value="h:meter"/>
79
+ </pattern>
80
+
81
+ <pattern id="descendant-dfn-dfn" is-a="disallowed-descendants">
82
+ <param name="ancestor" value="h:dfn"/>
83
+ <param name="descendant" value="h:dfn"/>
84
+ </pattern>
85
+
86
+ <pattern id="descendant-time-time" is-a="disallowed-descendants">
87
+ <param name="ancestor" value="h:time"/>
88
+ <param name="descendant" value="h:time"/>
89
+ </pattern>
90
+
91
+ <pattern id="descendant-caption-table" is-a="disallowed-descendants">
92
+ <param name="ancestor" value="h:caption"/>
93
+ <param name="descendant" value="h:table"/>
94
+ </pattern>
95
+
96
+ <pattern id="descendant-header-header" is-a="disallowed-descendants">
97
+ <param name="ancestor" value="h:header"/>
98
+ <param name="descendant" value="h:header"/>
99
+ </pattern>
100
+
101
+ <pattern id="descendant-header-footer" is-a="disallowed-descendants">
102
+ <param name="ancestor" value="h:header"/>
103
+ <param name="descendant" value="h:footer"/>
104
+ </pattern>
105
+
106
+ <pattern id="descendant-footer-footer" is-a="disallowed-descendants">
107
+ <param name="ancestor" value="h:footer"/>
108
+ <param name="descendant" value="h:footer"/>
109
+ </pattern>
110
+
111
+ <pattern id="descendant-footer-header" is-a="disallowed-descendants">
112
+ <param name="ancestor" value="h:footer"/>
113
+ <param name="descendant" value="h:header"/>
114
+ </pattern>
115
+
116
+ <pattern id="descendant-label-label" is-a="disallowed-descendants">
117
+ <param name="ancestor" value="h:label"/>
118
+ <param name="descendant" value="h:label"/>
119
+ </pattern>
120
+
121
+ <pattern id="descendant-annotation-xml-math" is-a="disallowed-descendants">
122
+ <param name="ancestor" value="math:annotation-xml[@encoding='application/xhtml+xml' and @name='alternate-representation']"/>
123
+ <param name="descendant" value="math:*"/>
124
+ </pattern>
125
+
126
+ <pattern id="descendant-svgtitle-svg" is-a="disallowed-descendants">
127
+ <param name="ancestor" value="svg:title"/>
128
+ <param name="descendant" value="svg:*"/>
129
+ </pattern>
130
+
131
+ <pattern id="bdo-dir" is-a="required-attr">
132
+ <param name="elem" value="h:bdo"/>
133
+ <param name="attr" value="dir"/>
134
+ </pattern>
135
+
136
+ <pattern id="idrefs-aria-describedby" is-a="idrefs-any">
137
+ <param name="element" value="*"/>
138
+ <param name="idrefs-attr-name" value="aria-describedby"/>
139
+ </pattern>
140
+
141
+ <pattern id="idrefs-output-for" is-a="idrefs-any">
142
+ <param name="element" value="h:output"/>
143
+ <param name="idrefs-attr-name" value="for"/>
144
+ </pattern>
145
+
146
+ <pattern id="idrefs-aria-flowto" is-a="idrefs-any">
147
+ <param name="element" value="*"/>
148
+ <param name="idrefs-attr-name" value="aria-flowto"/>
149
+ </pattern>
150
+
151
+ <pattern id="idrefs-aria-labelledby" is-a="idrefs-any">
152
+ <param name="element" value="*"/>
153
+ <param name="idrefs-attr-name" value="aria-labelledby"/>
154
+ </pattern>
155
+
156
+ <pattern id="idrefs-aria-owns" is-a="idrefs-any">
157
+ <param name="element" value="*"/>
158
+ <param name="idrefs-attr-name" value="aria-owns"/>
159
+ </pattern>
160
+
161
+ <pattern id="idrefs-aria-controls" is-a="idrefs-any">
162
+ <param name="element" value="*"/>
163
+ <param name="idrefs-attr-name" value="aria-controls"/>
164
+ </pattern>
165
+
166
+ <pattern id="idref-mathml-xref" is-a="idref-any">
167
+ <param name="element" value="math:*"/>
168
+ <param name="idref-attr-name" value="xref"/>
169
+ </pattern>
170
+
171
+ <pattern id="idref-mathml-indenttarget" is-a="idref-any">
172
+ <param name="element" value="math:*"/>
173
+ <param name="idref-attr-name" value="indenttarget"/>
174
+ </pattern>
175
+
176
+ <pattern id="idref-contextmenu" is-a="idref-named">
177
+ <param name="element" value="h:*"/>
178
+ <param name="idref-attr-name" value="contextmenu"/>
179
+ <param name="target-name" value="h:menu"/>
180
+ </pattern>
181
+
182
+ <pattern id="idref-input-list" is-a="idref-named">
183
+ <param name="element" value="h:input"/>
184
+ <param name="idref-attr-name" value="list"/>
185
+ <param name="target-name" value="h:datalist"/>
186
+ </pattern>
187
+
188
+ <pattern id="idref-forms-form" is-a="idref-named">
189
+ <param name="element" value="h:*"/>
190
+ <param name="idref-attr-name" value="form"/>
191
+ <param name="target-name" value="h:form"/>
192
+ </pattern>
193
+
194
+ <pattern id="idref-aria-activedescendant">
195
+ <rule context="*[@aria-activedescendant]">
196
+ <assert test="descendant::*[@id = current()/@aria-activedescendant]"
197
+ >The aria-activedescendant attribute must refer to a descendant element.</assert>
198
+ </rule>
199
+ </pattern>
200
+
201
+ <pattern id="idref-label-for">
202
+ <rule context="h:label[@for]">
203
+ <assert
204
+ test="some $elem in $id-set satisfies $elem/@id eq current()/@for and
205
+ (local-name($elem) eq 'button'
206
+ or (local-name($elem) eq 'input' and not($elem/@type='hidden'))
207
+ or local-name($elem) eq 'keygen'
208
+ or local-name($elem) eq 'meter'
209
+ or local-name($elem) eq 'output'
210
+ or local-name($elem) eq 'progress'
211
+ or local-name($elem) eq 'select'
212
+ or local-name($elem) eq 'textarea')"
213
+ >The for attribute does not refer to an allowed target element (expecting: button|keygen|meter|output|progress|select|textarea|input[not(@type='hidden')]).</assert>
214
+ </rule>
215
+ </pattern>
216
+
217
+ <pattern id="idrefs-headers">
218
+ <rule context="h:*[@headers]">
219
+ <let name="table" value="ancestor::h:table"/>
220
+ <assert test="every $idref in tokenize(@headers, '\s+') satisfies (some $elem in $table//h:th satisfies ($elem/@id eq $idref))"
221
+ >The headers attribute must refer to th elements in the same table.</assert>
222
+ </rule>
223
+ </pattern>
224
+
225
+ <pattern id="idref-trigger-observer" is-a="idref-any">
226
+ <param name="element" value="epub:trigger"/>
227
+ <param name="idref-attr-name" value="ev:observer"/>
228
+ </pattern>
229
+
230
+ <pattern id="idref-trigger-ref" is-a="idref-any">
231
+ <param name="element" value="epub:trigger"/>
232
+ <param name="idref-attr-name" value="ref"/>
233
+ </pattern>
234
+
235
+ <pattern id="map.name" >
236
+ <rule context='h:map[@name]'>
237
+ <let name="name-set" value="//h:map[@name]"/>
238
+ <assert test="count($name-set[@name = current()/@name]) = 1">Duplicate map name '<value-of
239
+ select="current()/@name"/>'</assert>
240
+ </rule>
241
+ </pattern>
242
+
243
+ <pattern id="map.id" >
244
+ <rule context='h:map[@id and @name]'>
245
+ <assert test='@id = @name'
246
+ >The id attribute on the map element must have the same value as the name attribute.</assert>
247
+ </rule>
248
+ </pattern>
249
+
250
+ <pattern id='lang-xmllang'>
251
+ <rule context='h:*[@lang and @xml:lang]'>
252
+ <assert test="lower-case(@xml:lang) = lower-case(@lang)"
253
+ >The lang and xml:lang attributes must have the same value.</assert>
254
+ </rule>
255
+ </pattern>
256
+
257
+ <pattern id="id-unique">
258
+ <rule context="*[@id]">
259
+ <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of
260
+ select="current()/@id"/>'</assert>
261
+ </rule>
262
+ </pattern>
263
+
264
+ <pattern id="select-multiple">
265
+ <rule context="h:select[not(@multiple)]">
266
+ <report test='count(descendant::h:option[@selected]) > 1'
267
+ >A select element whose multiple attribute is not specified must not have more than one descendant option element with its selected attribute set.</report>
268
+ </rule>
269
+ </pattern>
270
+
271
+ <pattern id="track">
272
+ <rule context="h:track">
273
+ <report test="@label and normalize-space(@label) = ''"
274
+ >The track element label attribute value must not be the empty string.</report>
275
+ <report test="@default and preceding-sibling::h:track[@default]"
276
+ >There must not be more than one track child of a media element element with the default attribute specified.</report>
277
+ </rule>
278
+ </pattern>
279
+
280
+ <pattern id="ssml-ph">
281
+ <rule context="*[@ssml:ph]">
282
+ <report test="ancestor::*[@ssml:ph]"
283
+ >The ssml:ph attribute must not be specified on a descendant of an element that also carries this attribute.</report>
284
+ </rule>
285
+ </pattern>
286
+
287
+ <pattern id="style-scoped">
288
+ <rule context="h:style[ancestor::h:body]">
289
+ <assert test="every $elem in preceding-sibling::* satisfies local-name($elem) eq 'style'"
290
+ >The scoped style element must occur before any other flow content other than other style elements and inter-element whitespace.</assert>
291
+ </rule>
292
+ </pattern>
293
+
294
+ <pattern id="link-sizes">
295
+ <rule context="h:link[@sizes]">
296
+ <assert test="@rel='icon'"
297
+ >The sizes attribute must not be specified on link elements that do not have a rel attribute that specifies the icon keyword.</assert>
298
+ </rule>
299
+ </pattern>
300
+
301
+ <pattern id="meta-charset">
302
+ <rule context="h:meta[@charset]">
303
+ <assert test="count(preceding-sibling::h:meta[@charset]) = 0"
304
+ >There must not be more than one meta element with a charset attribute per document.</assert>
305
+ </rule>
306
+ </pattern>
307
+
308
+ <pattern id="article-pubdate">
309
+ <rule context="h:article[h:time]">
310
+ <assert test="count(./h:time[@pubdate]) &lt; 2"
311
+ >For each article element, there must be no more than one time element child with a pubdate attribute</assert>
312
+ </rule>
313
+ </pattern>
314
+
315
+ <pattern id="document-pubdate">
316
+ <rule context="h:time[not (ancestor::h:article)]">
317
+ <assert test="count(//h:time[@pubdate and not (ancestor::h:article)]) &lt; 2"
318
+ >For each Document, there must be no more than one time element with a pubdate
319
+ attribute that does not have an ancestor article element.</assert>
320
+ </rule>
321
+ </pattern>
322
+
323
+ <pattern abstract="true" id="idref-any">
324
+ <rule context="$element[@$idref-attr-name]">
325
+ <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@$idref-attr-name"
326
+ >The <name path="@$idref-attr-name"/> attribute must refer to an element in the same document (the ID '<value-of
327
+ select="current()/@$idref-attr-name"/>' does not exist).</assert>
328
+ </rule>
329
+ </pattern>
330
+
331
+ <pattern abstract="true" id="idrefs-any">
332
+ <rule context="$element[@$idrefs-attr-name]">
333
+ <assert test="every $idref in tokenize(@$idrefs-attr-name,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))"
334
+ >The <name path="@$idrefs-attr-name"/> attribute must refer to elements in the same document (target ID missing)</assert>
335
+ </rule>
336
+ </pattern>
337
+
338
+ <pattern abstract="true" id="idref-named">
339
+ <rule context="$element[@$idref-attr-name]">
340
+ <assert test="//$target-name[@id = current()/@$idref-attr-name]">The <name
341
+ path="@$idref-attr-name"/> attribute does not refer to an allowed target element (expecting: <value-of
342
+ select="replace('$target-name','h:','')"/>).</assert>
343
+ </rule>
344
+ </pattern>
345
+
346
+ <pattern abstract="true" id="required-attr">
347
+ <rule context="$elem">
348
+ <assert test="@$attr"
349
+ >The <name/> element must have a <value-of select="'$attr'"/> attribute.</assert>
350
+ </rule>
351
+ </pattern>
352
+
353
+ <pattern abstract="true" id="disallowed-descendants">
354
+ <rule context="$descendant">
355
+ <report test="ancestor::$ancestor"
356
+ >The <name/> element must not appear inside <value-of select="local-name(ancestor::$ancestor)"/> elements.</report>
357
+ </rule>
358
+ </pattern>
359
+
360
+ <pattern abstract="true" id="required-ancestor">
361
+ <rule context='$descendant'>
362
+ <assert test='ancestor::$ancestor'
363
+ >The <value-of select="replace('$descendant','h:','')"/> element must have an ancestor <value-of select="replace('$ancestor','h:','')"/> element.</assert>
364
+ </rule>
365
+ </pattern>
366
+
367
+ <pattern abstract="true" id="no-interactive-content-descendants">
368
+ <rule context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')]
369
+ |h:keygen|h:label|h:menu[@type='toolbar']|h:object[@usemap]|h:select|h:textarea|h:video[@controls]">
370
+ <report test="ancestor::$ancestor"
371
+ >The <name/> element must not appear inside <value-of select="local-name(ancestor::$ancestor)"/> elements.</report>
372
+ </rule>
373
+ </pattern>
374
+
375
+ <include href="./mod/epub-svg11-re.sch"/>
376
+
377
+ </schema>