Skip to content

Commit

Permalink
Update ncx.rng schema to add fixed list of pageTarget type values // f…
Browse files Browse the repository at this point in the history
…ixes #761
  • Loading branch information
tofi86 committed Jun 5, 2017
1 parent 6e3a8b4 commit b2c9e93
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@
</attribute>
</optional>
<attribute name="type">
<text/>
<choice>
<value>front</value>
<value>normal</value>
<value>special</value>
</choice>
</attribute>
<optional>
<attribute name="class">
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,11 @@
</attribute>
</optional>
<attribute name="type">
<text/>
<choice>
<value>front</value>
<value>normal</value>
<value>special</value>
</choice>
</attribute>
<optional>
<attribute name="class">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ public void testValidateEPUBBadPathInNCX()
testValidateDocument("invalid/lorem-ncx-badpath");
}

@Test
public void testValidateEPUBBadNcxPageTargetType()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
testValidateDocument("invalid/ncx-pagetarget-type");
}

@Test
public void testValidateEPUBUidSpaces()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/"
xmlns="http://www.daisy.org/z3986/2005/ncx/"
version="2005-1"
xml:lang="la">
<head>
<meta name="dtb:uid" content="urn:uuid:9b30f91c-ab6c-4112-a30d-390957259458"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
</head>
<docTitle>
<text>Lorem Ipsum</text>
</docTitle>
<navMap>
<navPoint id="ch1" playOrder="1">
<navLabel>
<text>I.</text>
</navLabel>
<content src="lorem.xhtml"/>
</navPoint>
</navMap>
<pageList>
<pageTarget type="body" playOrder="1">
<navLabel>
<text>1</text>
</navLabel>
<content src="lorem.xhtml"/>
</pageTarget>
</pageList>
</ncx>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="uid">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:identifier id="uid">urn:uuid:9b30f91c-ab6c-4112-a30d-390957259458</dc:identifier>
<dc:title>Lorem Ipsum</dc:title>
<dc:language>la</dc:language>
<dc:date>2017-06-05</dc:date>
</metadata>
<manifest>
<item id="t1" href="lorem.xhtml" media-type="application/xhtml+xml"/>
<item id="ncx" href="lorem.ncx" media-type="application/x-dtbncx+xml"/>
</manifest>
<spine toc="ncx">
<itemref idref="t1"/>
</spine>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la">
<head>
<title>Lorem Ipsum</title>
</head>
<body>
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum dolor sit amet</p>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
<rootfiles>
<rootfile full-path="EPUB/lorem.opf"
media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application/epub+zip

0 comments on commit b2c9e93

Please sign in to comment.