GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • src
    • main/java/com/adobe/epubcheck/xml/handlers
      • DeclarationHandler.java
    • test/resources/epub3/B-external-identifiers
      • external-identifiers.feature
      • files
        • xml-external-identifier-allowed-valid/EPUB
          • nav.ncx
          • package.opf
        • xml-external-identifier-disallowed-error/EPUB
          • toc.ncx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/main/java/com/adobe/epubcheck/xml/handlers/DeclarationHandler.java‎

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 numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ else if (publicId != null || systemId != null)
134134
isAllowed = "-//W3C//DTD MathML 3.0//EN".equals(publicId)
135135
&& "http://www.w3.org/Math/DTD/mathml3/mathml3.dtd".equals(systemId);
136136
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;
137141
default:
138142
isAllowed = false;
139143
}
Collapse file

‎src/test/resources/epub3/B-external-identifiers/external-identifiers.feature‎

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 numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
Given EPUB test files located at '/epub3/B-external-identifiers/files/'
1111
And EPUBCheck with default settings
1212

13-
13+
@spec @xref:app-identifiers-allowed
1414
Scenario: Verify DOCTYPE declarations with allowed external identifiers
1515
When checking EPUB 'xml-external-identifier-allowed-valid'
1616
Then no errors or warnings are reported
Collapse file

‎src/test/resources/epub3/B-external-identifiers/files/xml-external-identifier-allowed-valid/EPUB/nav.ncx‎

Copy file name to clipboard
+24Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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

‎src/test/resources/epub3/B-external-identifiers/files/xml-external-identifier-allowed-valid/EPUB/package.opf‎

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 numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
<item id="mathml-2" href="mathml-mediatype-2.xml" media-type="application/mathml-presentation+xml" fallback="content_001"/>
1414
<item id="mathml-3" href="mathml-mediatype-3.xml" media-type="application/mathml-content+xml" fallback="content_001"/>
1515
<item id="svg" href="svg.svg" media-type="image/svg+xml"/>
16+
<item id="ncx" href="nav.ncx" media-type="application/x-dtbncx+xml" />
1617
</manifest>
17-
<spine>
18+
<spine toc="ncx">
1819
<itemref idref="content_001" />
1920
<itemref idref="svg"/>
2021
<itemref idref="mathml-1"/>
Collapse file

‎src/test/resources/epub3/B-external-identifiers/files/xml-external-identifier-disallowed-error/EPUB/toc.ncx‎

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 numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?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">
33
<ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/"
44
xmlns="http://www.daisy.org/z3986/2005/ncx/"
55
version="2005-1"

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.