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

Pagebreak validation in nav document fails to discover missing pagebreak link #510

Closed martinpub closed 1 year ago

martinpub commented 2 years ago

In a book, we have the following in the content document V000473-005-toc.xhtml:

<div epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page-vii" aria-label="vii"></div>
[...]
<span epub:type="pagebreak" role="doc-pagebreak" class="page-front" id="page-viii" aria-label="viii"></span>

In the page list of the navigation document, a mistake made the same link appear twice, so that V000473-005-toc.xhtml#page-viii was never referenced, and V000473-005-toc.xhtml#page-vii was referenced twice:

<li><a href="V000473-005-toc.xhtml#page-vii">vii</a></li>
<li><a href="V000473-005-toc.xhtml#page-vii">viii</a></li>

As I understand it, the rule "All pagebreaks in the book must be referenced from the navigation document" should prohibit this, but the book passed validation.

There is no reference to V000473-005-toc.xhtml#page-viii in nav.xhtml. The rule seems to be based on the ID, which is correct. I think this is a bug. Any ideas?

Ping @kalaspuffar, is this something you could have a look at?

josteinaj commented 2 years ago

Yes, that rule should prohibit this. I don't see any obvious problem with the schematron, or the preprocessing XSLT, but this seems like a bug, yes.

josteinaj commented 2 years ago

As a first step, it might be a good idea to reproduce the bug by adding a test here: https://github.com/nlbdev/nordic-epub3-dtbook-migrator/blob/0207bb756f7a3870645e35dd2e98abf838b1ff45/src/test/xprocspec/2020-1/epub3-validate.step.xprocspec

martinpub commented 2 years ago

Thank you very much for confirming and for the hints @josteinaj!

josteinaj commented 1 year ago

This was fixed in #516