-
Notifications
You must be signed in to change notification settings - Fork 402
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes nav doc validation to be more faithful to the spec:
- only restrict a nav element's content model when it carries an epub:type attribute - require a first-child heading for all nav elements not defined in the spec (including without an epub:type) - require at least one li child for ol (also fixes existing errors in test docs) - add warning that nav elements should have an epub:type attribute
- Loading branch information
1 parent
275f6b6
commit d32de85
Showing
7 changed files
with
44 additions
and
15 deletions.
There are no files selected for viewing
23 changes: 17 additions & 6 deletions
23
src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
|
||
|
||
|
||
default namespace = "http://www.w3.org/1999/xhtml" | ||
namespace epub = "http://www.idpf.org/2007/ops" | ||
|
||
include "epub-xhtml-30.rnc" { | ||
html5.nav.content = html5.headings.class?, html5.ol | ||
html5.oli.content = html5.a.phrasing | ((html5.a.phrasing | html5.span), html5.ol) | ||
html5.nav.attlist &= epub.nav.attrs | ||
} | ||
|
||
|
||
epub.nav.attrs &= html5.global.common.attrs & epub.nav.xml.attrs | ||
epub.nav.xml.attrs &= html5.xml.lang.attr? & html5.xml.base.attr? & html5.xml.space.attr? | ||
|
||
html5.sections.class |= epub.nav | ||
|
||
epub.nav = element nav { epub.type.attr & epub.nav.attrs & epub.nav.content } | ||
epub.nav.content = html5.headings.class?, epub.nav.ol | ||
|
||
epub.nav.ol = element ol { html5.ol.attlist & epub.nav.ol.content } | ||
epub.nav.ol.content = epub.nav.oli+ | ||
|
||
epub.nav.oli = element li { html5.oli.attlist & epub.nav.oli.content } | ||
epub.nav.oli.content = html5.a.phrasing | ((html5.a.phrasing | html5.span), epub.nav.ol) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters