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

Validator issue: [nordic_nav_ncx_5] Landmarks will result in duplicate references, so the rule should be loosened up #441

Closed martinpub closed 3 years ago

martinpub commented 3 years ago

Example:

[nordic_nav_ncx_5] Two references in the navigation document can not point to the same location in the content. (<a epub:type="colophon" href="X60352A-03-colophon.xhtml#f2">)

Landmarks addition to guidelines will trigger duplicate references in the nav doc. restrict rule to require unique references only within each <nav> block?

@class="success" seems like a bug?

Ping @kalaspuffar @AndersEkl

kalaspuffar commented 3 years ago

Hi @martinpub

All the report rules are marked green and are information to the operator but not a direct violation of the specification.

<report test="@href = preceding::html:a/@href">[nordic_nav_ncx_5] Two references in the navigation document can not point to the same location in the content. <value-of select="$context"/></report>

Assertions, on the other hand, are incorrect behavior that is not allowed by the specification e.g.

<assert test="self::html:li">[nordic203d] 'endnote' can only be applied to &lt;li&gt; elements. <value-of select="$context"/></assert>

If you don't want this distinction, we can handle all information as erroneous.

Best regards Daniel

martinpub commented 3 years ago

Thanks for the explanation.

I would say then that report rules should result in a "warning", perhaps warning is a more appropriate HTML class, and perhaps green is not the best color. However, then the report text documentation should also be phrased as such, i.e. something like "Two references in the navigation document currently point to the same location in the content."

This was a more general comment, I think in this particular case, we probably want to change the warning to be restricted as suggested above, otherwise we will have a lot of warnings ...

josteinaj commented 3 years ago

I may have used <report> the wrong way last time the schematrons were revised. I have been thinking of it as simply the inverse of <assert>, so that <report test="…"> would be the same as <assert test="not(…)">, but a quick search indicates that this is not quite the case.