GeezerVison is showing github.com — feat: allow NCX documents to declare a doctype · w3c/epubcheck@f3e5f67
File tree
Expand file treeCollapse file tree
Open diff view settings
main/java/com/adobe/epubcheck/xml/handlers test/resources/epub3/B-external-identifiers xml-external-identifier-allowed-valid/EPUB xml-external-identifier-disallowed-error/EPUB
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: src/main/java/com/adobe/epubcheck/xml/handlers/DeclarationHandler.java +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -134,6 +134,10 @@ else if (publicId != null || systemId != null) |
134 | 134 | isAllowed = "-//W3C//DTD MathML 3.0//EN".equals(publicId) |
135 | 135 | && "http://www.w3.org/Math/DTD/mathml3/mathml3.dtd".equals(systemId); |
136 | 136 | break; |
| 137 | + case "application/x-dtbncx+xml": |
| 138 | + isAllowed = "-//NISO//DTD ncx 2005-1//EN".equals(publicId) |
| 139 | + && "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd".equals(systemId); |
| 140 | + break; |
137 | 141 | default: |
138 | 142 | isAllowed = false; |
139 | 143 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: src/test/resources/epub3/B-external-identifiers/external-identifiers.feature +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
10 | 10 | Given EPUB test files located at '/epub3/B-external-identifiers/files/' |
11 | 11 | And EPUBCheck with default settings |
12 | 12 |
|
13 | | - |
| 13 | + @spec @xref:app-identifiers-allowed |
14 | 14 | Scenario: Verify DOCTYPE declarations with allowed external identifiers |
15 | 15 | When checking EPUB 'xml-external-identifier-allowed-valid' |
16 | 16 | Then no errors or warnings are reported |
|
Collapse file
Copy file name to clipboard +24Lines changed: 24 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!DOCTYPE math PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"> |
| 3 | +<ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" |
| 4 | + xmlns="http://www.daisy.org/z3986/2005/ncx/" |
| 5 | + version="2005-1" |
| 6 | + xml:lang="en"> |
| 7 | + <head> |
| 8 | + <meta name="dtb:uid" content="NOID"/> |
| 9 | + <meta name="dtb:depth" content="1"/> |
| 10 | + <meta name="dtb:totalPageCount" content="0"/> |
| 11 | + <meta name="dtb:maxPageNumber" content="0"/> |
| 12 | + </head> |
| 13 | + <docTitle> |
| 14 | + <text>NCX</text> |
| 15 | + </docTitle> |
| 16 | + <navMap> |
| 17 | + <navPoint id="ch1" playOrder="1"> |
| 18 | + <navLabel> |
| 19 | + <text>Chapter 1</text> |
| 20 | + </navLabel> |
| 21 | + <content src="content_001.xhtml"/> |
| 22 | + </navPoint> |
| 23 | + </navMap> |
| 24 | +</ncx> |
Collapse file
Copy file name to clipboardExpand all lines: src/test/resources/epub3/B-external-identifiers/files/xml-external-identifier-allowed-valid/EPUB/package.opf +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
13 | 13 | <item id="mathml-2" href="mathml-mediatype-2.xml" media-type="application/mathml-presentation+xml" fallback="content_001"/> |
14 | 14 | <item id="mathml-3" href="mathml-mediatype-3.xml" media-type="application/mathml-content+xml" fallback="content_001"/> |
15 | 15 | <item id="svg" href="svg.svg" media-type="image/svg+xml"/> |
| 16 | + <item id="ncx" href="nav.ncx" media-type="application/x-dtbncx+xml" /> |
16 | 17 | </manifest> |
17 | | -<spine> |
| 18 | +<spine toc="ncx"> |
18 | 19 | <itemref idref="content_001" /> |
19 | 20 | <itemref idref="svg"/> |
20 | 21 | <itemref idref="mathml-1"/> |
|
Collapse file
Copy file name to clipboardExpand all lines: src/test/resources/epub3/B-external-identifiers/files/xml-external-identifier-disallowed-error/EPUB/toc.ncx +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | | -<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd"> |
| 2 | +<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://example.org/dtd"> |
3 | 3 | <ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" |
4 | 4 | xmlns="http://www.daisy.org/z3986/2005/ncx/" |
5 | 5 | version="2005-1" |
|