Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow NCX documents to declare a doctype #1430

Merged
merged 1 commit into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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