Schematron rules for Nordic EPUB 2020-1

Rule Global description Detailed description
8 Only allow pagebreak w/page-front in frontmatter [nordic08] <span epub:type="pagebreak" class="page-front"/> may only occur in frontmatter and cover.
9 Disallow empty elements (with a few exceptions) [nordic09] Only the following elements can be empty: img, br, meta, link, col, th, td, dd, hr, script, and pagebreaks (span/div).
11 Root element must have @xml:lang and @lang [nordic11] The <html> element must have an xml:lang attribute.
[nordic11] The <html> element must have a lang attribute.
12 Frontmatter starts with doctitle and docauthor [nordic12] Single-HTML document must begin with a fulltitle heading in its header element (xpath: /html/body/header/h1).
13 All books must have frontmatter and bodymatter [nordic13a] A single-HTML document must have at least one frontmatter or cover section.
[nordic13a] A single-HTML document must have at least one bodymatter section.
[nordic13a] The single-HTML document must not have cover, frontmatter, bodymatter or backmatter as epub:type on its body element.
13b [nordic13b] The single-HTML document must not have cover, frontmatter, bodymatter or backmatter on any of its sectioning elements other than the top-level elements that has body as its parent.
13c [nordic13c] The top-level section element must have either cover, frontmatter, bodymatter or backmatter as one of the values on its epub:type.
13d [nordic13d] Section elements that are not top-level sections must not have cover, frontmatter, bodymatter or backmatter as one of the values on its epub:type attribute. It is allowed (but optional) to use the bodymatter type on section elements that are direct children of sections with epub:type="part").
[nordic13d] Section elements in parts must not have cover, frontmatter or backmatter as one of the values on its epub:type attribute.
13e The body element must not have a epub:type attribute. [nordic13e] The body element must not have a epub:type attribute.
15 [nordic15] Cover must not be preceded by any other top-level sections.
[nordic15] Frontmatter must not be preceded by bodymatter or rearmatter.
[nordic15] Bodymatter must not be preceded by backmatter.
21 No nested tables [nordic21] Nested tables are not allowed.
23 Increasing pagebreak values for page-normal [nordic23] pagebreak values must increase for pagebreaks with class="page-normal".
24 Values of pagebreak must be unique for page-front [nordic24] pagebreak values must be unique for pagebreaks with class="page-front".
26a Each note must have a noteref [nordic26a] Each note must have at least one <a epub:type="noteref" ...> referencing it.
26b Each noteref must reference a note [nordic26b] The note reference must point to a note, endnote or footnote in the publication using its href attribute.
27a Each annotation must have an annoref [nordic27a] Each annotation must have at least one <a epub:type="annoref" ...> referencing it.
27b Each annoref must reference a annotation [nordic27b] The annotation must point to a annotation in the publication using its href attribute.
29a No block elements in inline context (as child). Inline elements: a, abbr, bdo, code, dfn, em, kbd, q, samp, span, strong, sub, sup. Block elements: address, aside, blockquote, p, caption, div, dl, ul, ol, figure, table, h1, h2, h3, h4, h5, h6, details, summary. [nordic29] Block element used in inline context.
29b No block elements in inline context (as sibling). Inline elements: a, abbr, bdo, code, dfn, em, kbd, q, samp, span, strong, sub, sup. Block elements: address, aside, blockquote, p, caption, div, dl, ul, ol, figure, table, h1, h2, h3, h4, h5, h6, details, summary, section, article. [nordic29] Block elements are not allowed as siblings to inline elements.
[nordic29] Block elements are not allowed as siblings to text content.
50a image alt attribute [nordic50a] an image inside a figure with class='image' must have a non-empty alt attribute.
51 & 52 [nordic52] Images must have either the .jpg file extension or the .png file extension.
[nordic52] Images must have a base name, not just an extension.
[nordic51] Images must be in the "images" folder (relative to the HTML file).
[nordic52] Image file names can only contain the characters a-z, A-Z, 0-9, underscore (_) or hyphen (-).
59 No pagegnum between a term and a definition in definition lists [nordic59] pagebreak in definition list must not occur as siblings to dd or dt.
63 Only note references within the same document [nordic63] Only note references within the same publication are allowed.
64 Only annotation references within the same document [nordic64] Only annotation references within the same publication are allowed.
93 Some elements may not start of end with whitespace [nordic93] Headings (h1-h6) may not have leading whitespace.
[nordic93] Headings (h1-h6) may not have trailing whitespace.
96b [nordic96b] Nested image series figures are not allowed. Image figures must use the class "image", while image series figures must use the class "image-series".
96a No fig-desc allowed for doc-cover [nordic96c] Aside elements with class="fig-desc" are not allowed in figure elements containing an img with role="doc-cover".
101 All image series must have at least one image figure [nordic101] There must be at least one figure with class="image" in a image series figure.
102 All image figures must have a image [nordic102] There must be an img element in every figure with class="image".
[nordic102] Nested images figures are not allowed. Image figures must use the class "image", while image series figures must use the class "image-series".
104 Headings may not be empty elements [nordic104] Headings may not be empty.
105 Pagebreaks must have a page-* class and must not contain anything [nordic105] Page breaks must have either a 'page-front', a 'page-normal' or a 'page-special' class.
[nordic105] Pagebreaks must not contain elements or comments. Text content, if present, must not contain extra whitespace.
110 pagebreak in headings [nordic110] Pagebreak elements are not allowed in headings.
116 Don't allow arabic numbers in pagebreak w/page-front [nordic116] Hindu-Arabic numbers (0-9) when @class="page-front" are not allowed.
121 pagebreaks in tables must not occur between table rows [nordic121] Page numbers in tables must not be placed between table rows.
123 (39) Cover is not part of frontmatter, bodymatter or backmatter [nordic123] Cover (Jacket copy) is a document partition and can not be part the other document partitions frontmatter, bodymatter and rearmatter.
131a [nordic131a] xml:lang must must be either a "two- or three-letter lower case" code or a "two- or three-letter lower case and groups of hyphen followed by numbers or letters" (i.e. zh-Hanz-UTF8) code.
131b [nordic131b] lang must must be either a "two- or three-letter lower case" code or a "two- or three-letter lower case and groups of hyphen followed by numbers or letters" (i.e. zh-Hanz-UTF8) code.
135a Poem contents [nordic135] Every poem must contain a linegroup.
[nordic135] Poem lines must be wrapped in a linegroup. contains; .
[nordic135] Poem lines must be wrapped in a linegroup. contains; .
[nordic135] Poem lines must be wrapped in a linegroup. contains; .
140 Jacket copy must contain at least one part of the cover, at most one of each @class value and no other elements [nordic140] Only sections with one of the classes 'frontcover', 'rearcover', 'leftflap' or 'rightflap' is allowed in cover.
[nordic140] There must be at least one section with one of the classes 'frontcover', 'rearcover', 'leftflap' or 'rightflap' in cover.
[nordic140] There can not be more than one section with class="frontcover" in cover.
[nordic140] There can not be more than one section with class="rearcover" in cover.
[nordic140] There can not be more than one section with class="leftflap" in cover.
[nordic140] There can not be more than one section with class="rightflap" in cover.
143a Don't allow pagebreak as siblings to list items or inside the first list item [nordic143a] Pagebreaks are not allowed as siblings to list items.
143b [nordic143b] It is not allowed to have a pagebreak at the beginning of the first list item; it should be placed before the list.
200 The title element must not be empty [nordic200] The title element must not be empty.
202 frontmatter [nordic202] '' is not an allowed type in frontmatter. On elements with the epub:type "frontmatter", you can either leave the type blank (and just use 'frontmatter' as the type in the filename), or you can use one of the allowed types.
203a Check that both the epub:types "endnote" and "endnotes" are used in endnotes [nordic203a] 'endnote' must have a section ancestor with 'endnotes'.
203c [nordic203c] Sections with the epub:type 'endnotes' must have descendants with 'endnote'.
[nordic203c] Sections with the epub:type 'endnotes' must have <ol> descendant elements.
203d [nordic203d] 'endnote' can only be applied to <li> elements.
204a Check that footnotes are placed correctly in a section. [nordic204a] 'footnote' must have a parent section.
[nordic204a] 'footnote' must be placed at the end of a section.
204d [nordic204d] 'footnote' can only be applied to <aside> elements.
[nordic204d] The 'doc-footnote' role must be applied to all footnotes.
208 bodymatter [nordic208] Elements with the type "bodymatter" must also have one of the allowed epub:type values allowed for such sections.
211 bodymatter.part [nordic211] Sections inside a part must also have one of the allowed epub:type values allowed for such sections.
215 backmatter [nordic215] If elements with the type "backmatter" has additional types, they must be one of the allowed epub:type values allowed for such sections.
225 pagebreak [nordic225] The aria-label attribute must be used to describe the page number.
247 doctitle.heading - h1 [nordic247] The first (h1) heading on the titlepage must have the 'fulltitle' epub:type.
251 lic - span [nordic251] The parent of a list item component (span class="lic") must be either a "li" or a "a" (where the "a" has "li" as parent).
253a figures and captions [nordic253a] <figure> elements must either have a class of "image", "image-series" or "table".
[nordic253a] <figure> elements must either have a class of "image", "image-series" or "table".
[nordic253a] There cannot be more than one <figcaption> in a single figure element.
253b [nordic253b] Image figures must contain exactly one img.
[nordic253b] The img in image figures must be a direct child of the figure.
253c [nordic253c] Image series figures cannot contain img childen (the img elements must be contained in children figure elements).
[nordic253c] Image series must contain at least 2 image figures ("figure" elements with class "image").
256 HTML documents with only a heading [nordic256] Sections in bodymatter must contain more than just headings and pagebreaks, except for when epub:type="part".
257 always require both xml:lang and lang [nordic257] The `xml:lang` and the `lang` attributes must have the same value.
258 allow at most one pagebreak before any content in each content file [nordic258] Only one pagebreak is allowed before any content in each content file.
259 don't allow pagebreak in thead [nordic259] Pagebreaks can not occur within table headers (thead).
[nordic259] Pagebreaks can not occur within table footers (tfoot).
260b [nordic260b] Content is not allowed between or after image figure elements.
261 Text can't be direct child of div [nordic261] Text can't be placed directly inside div elements. Try wrapping it in a p element.
263 there must be a heading on the titlepage [nordic263] the titlepage must have a heading (and the heading must have epub:type="fulltitle" and class="title").
264 h1 on titlepage must be epub:type=fulltitle with class=title [nordic264] the heading on the titlepage must have a epub:type with the value "fulltitle".
[nordic264] the heading on the titlepage must have a class with the value "title".
267a [nordic267a] Endnotes must be wrapped in a "ol" element, but is currently wrapped in a .
267b [nordic267b] List items inside a endnotes list must use epub:type="endnote".
268 Check that the heading levels are nested correctly (necessary for sidebars and poems, and maybe other structures as well where the RelaxNG is unable to enforce the level) [nordic268] The subsections of (which contains the heading </>) must only use <h> for headings. It contains the element which contains the heading .
269 [nordic269] The type used in the filename () must be present on the section element, and be the most specific ().
270 [nordic270] Bridgehead is only allowed as a child of section, article, div and aside.
273 [nordic273] Internal link does not resolve.
273b Disallow internal links without fragment identifiers (see https://github.com/nlbdev/nordic-epub3-dtbook-migrator/issues/372) [nordic273b] Internal links must contain a non-empty fragment identifier.
279a [nordic279a] The start attribute must not be used in lists without markers (numbers/letters).
279b [nordic279b] The start attribute must be a positive integer.
280 [nordic280] Metadata with the dc prefix are only allowed for the 15 official Dublin Core metadata elements: dc:title, dc:subject, dc:description, dc:type, dc:source, dc:relation, dc:coverage, dc:creator, dc:publisher, dc:publisher.original, dc:contributor, dc:rights, dc:date, dc:format, dc:identifier and dc:language.
[nordic280] The dc metadata prefix must be in lower case.
281 [nordic281] The span attribute on col and colgroup elements must be a positive integer.
282 [nordic282] The rowspan attribute value on td and th elements must be a positive integer.
[nordic282] The colspan attribute value on td and th elements must be a positive integer.
[nordic282] The rowspan attribute value on td and th elements must not be larger than the number of rows left in the table.
283 [nordic283] When using MathML with a namespace prefix, that prefix must be 'm'.
290 Rearnotes should not be used. Use endnotes instead. [nordic290] Rearnotes are deprecated. Endnotes are required to be used instead.
291 Backmatter sections require specific roles [nordic291] Backmatter can only use roles (doc-acknowledgments, doc-afterword, doc-appendix, doc-bibliography, doc-colophon, doc-conclusion, doc-dedication, doc-epigraph, doc-epilogue, doc-glossary, doc-index, doc-toc)
292 Class sidebar is deprecated for asides [nordic292] The aside attribute class is set to sidebar which is deprecated.
293 details element with extended description must be correctly referenced from img element The img element must correctly reference the details element with the aria-details attribute.