Skip to content

Commit

Permalink
feat: allow NCX documents to declare a doctype
Browse files Browse the repository at this point in the history
Fix #1329
  • Loading branch information
rdeltour committed Nov 27, 2022
1 parent e64c7c5 commit f3e5f67
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ else if (publicId != null || systemId != null)
isAllowed = "-//W3C//DTD MathML 3.0//EN".equals(publicId)
&& "http://www.w3.org/Math/DTD/mathml3/mathml3.dtd".equals(systemId);
break;
case "application/x-dtbncx+xml":
isAllowed = "-//NISO//DTD ncx 2005-1//EN".equals(publicId)
&& "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd".equals(systemId);
break;
default:
isAllowed = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Given EPUB test files located at '/epub3/B-external-identifiers/files/'
And EPUBCheck with default settings


@spec @xref:app-identifiers-allowed
Scenario: Verify DOCTYPE declarations with allowed external identifiers
When checking EPUB 'xml-external-identifier-allowed-valid'
Then no errors or warnings are reported
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE math PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/"
xmlns="http://www.daisy.org/z3986/2005/ncx/"
version="2005-1"
xml:lang="en">
<head>
<meta name="dtb:uid" content="NOID"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head>
<docTitle>
<text>NCX</text>
</docTitle>
<navMap>
<navPoint id="ch1" playOrder="1">
<navLabel>
<text>Chapter 1</text>
</navLabel>
<content src="content_001.xhtml"/>
</navPoint>
</navMap>
</ncx>
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
<item id="mathml-2" href="mathml-mediatype-2.xml" media-type="application/mathml-presentation+xml" fallback="content_001"/>
<item id="mathml-3" href="mathml-mediatype-3.xml" media-type="application/mathml-content+xml" fallback="content_001"/>
<item id="svg" href="svg.svg" media-type="image/svg+xml"/>
<item id="ncx" href="nav.ncx" media-type="application/x-dtbncx+xml" />
</manifest>
<spine>
<spine toc="ncx">
<itemref idref="content_001" />
<itemref idref="svg"/>
<itemref idref="mathml-1"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://example.org/dtd">
<ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/"
xmlns="http://www.daisy.org/z3986/2005/ncx/"
version="2005-1"
Expand Down

0 comments on commit f3e5f67

Please sign in to comment.