nlbdev / nordic-epub3-dtbook-migrator

Tools for converting between a strict subset of DTBook and EPUB3.
http://nlbdev.github.io/nordic-epub3-dtbook-migrator/
GNU Lesser General Public License v2.1
8 stars 7 forks source link

When parts are used, h3 is not allowed for chapter subheadings #494

Closed martinpub closed 2 years ago

martinpub commented 3 years ago

When parts are used, they will be h1 in separate content documents, with the chapters starting at h2 in the chapter content document. The cross-reference check was fixed by @kalaspuffar to properly accomodate this in #486.

However, it seems the RelaxNG rules are still not correct, so we have for instance the issue with subsections in a content doc starting with h2, where the subsection should have h3, but it is not allowed.

<body>
<section aria-labelledby="h2_15" epub:type="bodymatter chapter" id="level2_15" role="doc-chapter">
<h2 id="h2_15">IX. RIKSVÄG 95</h2>
<figure class="image"><img alt="Foto" src="images/V000101-017.jpg"/>
</figure>
<section id="level3_15">
<h3 id="h3_15">Det nya Klondyke</h3>

gives V000101-023-chapter.xhtml (line: 15, column: 16) element "h3" not allowed here; expected element "address", "article", "aside", "blockquote", "div", "dl", "figure", "h2", "hr", "img", "ns:math", "ol", "p", "pre", "section", "span", "table" or "ul" (with xmlns:ns="http://www.w3.org/1998/Math/MathML"), i.e. it expects h2.

Ping @kalaspuffar when back from vacation :-)

martinpub commented 2 years ago

This seems to be a problem for h3 and below, just wanted to clarify that.