diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch b/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch index 73a2759a4..9b5043bbe 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch +++ b/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch @@ -1,14 +1,27 @@ - + - + The "id" attribute does not have a unique value + + + + + + + WARNING: Duplicate 'reference' elements with the same 'type' and 'href' attributes + + diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch index af3d66e98..664a78d10 100644 --- a/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch +++ b/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch @@ -281,6 +281,19 @@ + + + + + + WARNING: Duplicate 'reference' elements with the same 'type' and 'href' attributes + + + diff --git a/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java b/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java index b22d0e905..95c1c8c1d 100644 --- a/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java +++ b/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java @@ -845,6 +845,20 @@ public void testIDX_CollectionInvalid_ResourceNotContentDoc() testValidateDocument("invalid/idx-collection-resource-noxhtml.opf", EPUBVersion.VERSION_3); } + @Test + public void testGuideReferenceUnique_EPUB2() + { + Collections.addAll(expectedWarnings, MessageId.RSC_017, MessageId.RSC_017); + testValidateDocument("invalid/guide-duplicates.opf", EPUBVersion.VERSION_2); + } + + @Test + public void testGuideReferenceUnique_EPUB3() + { + Collections.addAll(expectedWarnings, MessageId.RSC_017, MessageId.RSC_017); + testValidateDocument("invalid/guide-duplicates.opf", EPUBVersion.VERSION_3); + } + @Test public void testDict_Single() { diff --git a/src/test/resources/20/single/opf/invalid/guide-duplicates.opf b/src/test/resources/20/single/opf/invalid/guide-duplicates.opf new file mode 100644 index 000000000..6366ec19b --- /dev/null +++ b/src/test/resources/20/single/opf/invalid/guide-duplicates.opf @@ -0,0 +1,25 @@ + + + + Public domain in the USA. + http://www.gutenberg.org/ebooks/36582 + Anonymous + Advice to Sunday School Children + en + 2011-07-02 + 2011-07-03T19:26:31.417584+00:00 + http://www.gutenberg.org/files/36582/36582-h/36582-h.htm + + + + + + + + + + + + + + diff --git a/src/test/resources/30/single/opf/invalid/guide-duplicates.opf b/src/test/resources/30/single/opf/invalid/guide-duplicates.opf new file mode 100644 index 000000000..7b521d095 --- /dev/null +++ b/src/test/resources/30/single/opf/invalid/guide-duplicates.opf @@ -0,0 +1,22 @@ + + + + + + urn:uuid:550e8412-e29b-41d4-a716-446655441234 + Norwegian Wood + en + 2011-08-19T12:00:00Z + + + + + + + + + + + + +