[epubcheck] 01/03: Import v4.0.0
Eugene Zhukov
eugene-guest at moszumanska.debian.org
Wed Sep 2 18:36:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
eugene-guest pushed a commit to branch master
in repository epubcheck.
commit 273fd298a5c41a4fffd4db12c50cf08b49a4e737
Author: Eugene Zhukov <jevgeni.zh at gmail.com>
Date: Wed Sep 2 06:45:29 2015 +0000
Import v4.0.0
---
README.md | 39 +-
pom.xml | 28 +-
src/main/assembly/dist.xml | 8 +-
src/main/assembly/src.xml | 1 -
.../java/com/adobe/epubcheck/api/EPUBLocation.java | 135 ++++
.../java/com/adobe/epubcheck/api/EPUBProfile.java | 74 ++
.../java/com/adobe/epubcheck/api/EpubCheck.java | 179 ++--
.../com/adobe/epubcheck/api/EpubCheckFactory.java | 25 +-
.../com/adobe/epubcheck/api/FeatureReport.java | 134 +++
.../java/com/adobe/epubcheck/api/MasterReport.java | 23 +-
.../java/com/adobe/epubcheck/api/QuietReport.java | 3 +-
src/main/java/com/adobe/epubcheck/api/Report.java | 5 +-
.../com/adobe/epubcheck/bitmap/BitmapChecker.java | 31 +-
.../epubcheck/bitmap/BitmapCheckerFactory.java | 14 +-
.../java/com/adobe/epubcheck/css/CSSChecker.java | 102 ++-
.../com/adobe/epubcheck/css/CSSCheckerFactory.java | 20 +-
.../java/com/adobe/epubcheck/css/CSSHandler.java | 45 +-
.../java/com/adobe/epubcheck/ctc/CheckManager.java | 13 +-
.../java/com/adobe/epubcheck/ctc/EntitySearch.java | 30 +-
.../adobe/epubcheck/ctc/Epub3StructureCheck.java | 10 +-
.../java/com/adobe/epubcheck/ctc/EpubCSSCheck.java | 39 +-
.../java/com/adobe/epubcheck/ctc/EpubCfiCheck.java | 18 +-
.../com/adobe/epubcheck/ctc/EpubExtLinksCheck.java | 24 +-
.../epubcheck/ctc/EpubHTML5StructureCheck.java | 17 +-
.../com/adobe/epubcheck/ctc/EpubLangCheck.java | 22 +-
.../java/com/adobe/epubcheck/ctc/EpubNCXCheck.java | 29 +-
.../java/com/adobe/epubcheck/ctc/EpubNavCheck.java | 43 +-
.../java/com/adobe/epubcheck/ctc/EpubSVGCheck.java | 22 +-
.../com/adobe/epubcheck/ctc/EpubScriptCheck.java | 48 +-
.../com/adobe/epubcheck/ctc/EpubSpanCheck.java | 14 +-
.../com/adobe/epubcheck/ctc/EpubSpineCheck.java | 7 +-
.../adobe/epubcheck/ctc/EpubStyleSheetsCheck.java | 10 +-
.../adobe/epubcheck/ctc/EpubTextContentCheck.java | 9 +-
.../java/com/adobe/epubcheck/ctc/EpubTocCheck.java | 4 +-
.../com/adobe/epubcheck/ctc/PackageReader.java | 20 +-
.../java/com/adobe/epubcheck/ctc/XmlDocParser.java | 42 +-
.../epubcheck/ctc/css/EpubCSSCheckCSSHandler.java | 58 +-
.../epubcheck/ctc/epubpackage/PackageManifest.java | 4 +-
.../ctc/xml/CSSStyleAttributeHandler.java | 36 +-
.../epubcheck/ctc/xml/Epub3StructureHandler.java | 5 +-
.../epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java | 86 +-
.../adobe/epubcheck/ctc/xml/LinkTagHandler.java | 12 +-
.../adobe/epubcheck/ctc/xml/ScriptTagHandler.java | 26 +-
.../epubcheck/ctc/xml/XMLContentDocParser.java | 30 +-
.../com/adobe/epubcheck/dtbook/DTBookChecker.java | 70 +-
.../epubcheck/dtbook/DTBookCheckerFactory.java | 13 +-
.../com/adobe/epubcheck/dtbook/DTBookHandler.java | 75 +-
.../epubcheck/messages/MessageDictionary.java | 178 ++--
.../com/adobe/epubcheck/messages/MessageId.java | 40 +-
.../adobe/epubcheck/messages/MessageLocation.java | 107 ---
.../java/com/adobe/epubcheck/nav/NavChecker.java | 135 ++--
.../com/adobe/epubcheck/nav/NavCheckerFactory.java | 22 +-
.../java/com/adobe/epubcheck/nav/NavHandler.java | 75 ++
.../java/com/adobe/epubcheck/ncx/NCXChecker.java | 79 +-
.../com/adobe/epubcheck/ncx/NCXCheckerFactory.java | 13 +-
.../java/com/adobe/epubcheck/ncx/NCXHandler.java | 74 +-
.../java/com/adobe/epubcheck/ocf/OCFChecker.java | 414 +++++-----
src/main/java/com/adobe/epubcheck/ocf/OCFData.java | 9 +
.../adobe/epubcheck/ocf/OCFFilenameChecker.java | 12 +-
.../java/com/adobe/epubcheck/ocf/OCFHandler.java | 42 +-
.../java/com/adobe/epubcheck/ocf/OCFPackage.java | 165 ++--
.../com/adobe/epubcheck/ocf/OCFZipPackage.java | 26 +-
.../adobe/epubcheck/opf/ContentCheckerFactory.java | 9 +-
.../epubcheck/opf/DocumentValidatorFactory.java | 8 +-
.../adobe/epubcheck/opf/GenericContentChecker.java | 6 +-
.../opf/GenericContentCheckerFactory.java | 12 +-
.../com/adobe/epubcheck/opf/LinkedResource.java | 159 ++++
.../com/adobe/epubcheck/opf/LinkedResources.java | 134 +++
.../java/com/adobe/epubcheck/opf/MetadataSet.java | 560 +++++++++++++
.../java/com/adobe/epubcheck/opf/OPFChecker.java | 528 ++++++------
.../java/com/adobe/epubcheck/opf/OPFChecker30.java | 434 ++++++++--
.../com/adobe/epubcheck/opf/OPFCheckerFactory.java | 14 +-
src/main/java/com/adobe/epubcheck/opf/OPFData.java | 5 +-
.../java/com/adobe/epubcheck/opf/OPFHandler.java | 621 +++++++-------
.../java/com/adobe/epubcheck/opf/OPFHandler30.java | 457 ++++++++---
src/main/java/com/adobe/epubcheck/opf/OPFItem.java | 353 ++++++--
.../java/com/adobe/epubcheck/opf/OPFItems.java | 123 +++
.../java/com/adobe/epubcheck/opf/OPFPeeker.java | 8 +-
.../adobe/epubcheck/opf/ResourceCollection.java | 240 ++++++
.../adobe/epubcheck/opf/ResourceCollections.java | 125 +++
.../com/adobe/epubcheck/opf/ValidationContext.java | 341 ++++++++
.../com/adobe/epubcheck/opf/VersionRetriever.java | 10 +-
.../java/com/adobe/epubcheck/opf/XRefChecker.java | 444 +++++-----
.../java/com/adobe/epubcheck/ops/OPSChecker.java | 193 ++---
.../com/adobe/epubcheck/ops/OPSCheckerFactory.java | 28 +-
.../java/com/adobe/epubcheck/ops/OPSHandler.java | 400 ++++-----
.../java/com/adobe/epubcheck/ops/OPSHandler30.java | 409 ++++++----
.../adobe/epubcheck/overlay/OverlayChecker.java | 89 +-
.../epubcheck/overlay/OverlayCheckerFactory.java | 27 +-
.../adobe/epubcheck/overlay/OverlayHandler.java | 63 +-
.../adobe/epubcheck/reporting/CheckMessage.java | 36 +-
.../adobe/epubcheck/reporting/CheckingReport.java | 15 +-
.../adobe/epubcheck/reporting/ItemMetadata.java | 10 +-
.../java/com/adobe/epubcheck/tool/EpubChecker.java | 214 +++--
.../adobe/epubcheck/util/DefaultReportImpl.java | 8 +-
.../java/com/adobe/epubcheck/util/EPUBVersion.java | 8 +-
.../java/com/adobe/epubcheck/util/FeatureEnum.java | 86 +-
.../java/com/adobe/epubcheck/util/HandlerUtil.java | 8 +-
.../java/com/adobe/epubcheck/util/JsonWriter.java | 25 +-
.../java/com/adobe/epubcheck/util/KeyValue.java | 26 +
.../com/adobe/epubcheck/util/NamespaceHelper.java | 15 +-
.../java/com/adobe/epubcheck/util/URISchemes.java | 91 +++
.../com/adobe/epubcheck/util/ValidatorMap.java | 148 ++++
.../com/adobe/epubcheck/util/WriterReportImpl.java | 10 +-
.../adobe/epubcheck/util/XmlReportAbstract.java | 599 +++++++-------
.../com/adobe/epubcheck/util/XmlReportImpl.java | 49 +-
.../com/adobe/epubcheck/util/XmpReportImpl.java | 466 ++++++-----
.../adobe/epubcheck/vocab/AltStylesheetVocab.java | 8 +-
.../java/com/adobe/epubcheck/vocab/DCMESVocab.java | 27 +
.../com/adobe/epubcheck/vocab/DataNavVocab.java | 13 +
.../java/com/adobe/epubcheck/vocab/DictVocab.java | 32 +
.../java/com/adobe/epubcheck/vocab/EnumVocab.java | 29 +-
.../com/adobe/epubcheck/vocab/EpubCheckVocab.java | 51 ++
.../java/com/adobe/epubcheck/vocab/IndexVocab.java | 26 +
.../adobe/epubcheck/vocab/MediaOverlaysVocab.java | 3 +-
.../com/adobe/epubcheck/vocab/PackageVocabs.java | 27 +-
.../epubcheck/vocab/PrefixDeclarationParser.java | 4 +-
.../java/com/adobe/epubcheck/vocab/Property.java | 31 +
.../com/adobe/epubcheck/vocab/RenditionVocabs.java | 10 +-
.../adobe/epubcheck/vocab/ScriptedCompVocab.java | 22 +
.../adobe/epubcheck/vocab/StagingEdupubVocab.java | 18 +-
.../com/adobe/epubcheck/vocab/StructureVocab.java | 2 +-
.../java/com/adobe/epubcheck/vocab/VocabUtil.java | 39 +-
.../java/com/adobe/epubcheck/xml/XMLHandler.java | 1 +
.../java/com/adobe/epubcheck/xml/XMLParser.java | 608 +++++++-------
.../com/adobe/epubcheck/xml/XMLValidators.java | 24 +-
src/main/java/dict/SearchKeyMapChecker.java | 87 ++
src/main/java/dict/SearchKeyMapCheckerFactory.java | 43 +
src/main/java/dict/SearchKeyMapHandler.java | 70 ++
.../org/idpf/epubcheck/util/css/CssParser.java | 36 +-
src/main/licenses/third-party.properties | 18 +
.../epubcheck/messages/MessageBundle.properties | 142 ++--
.../epubcheck/messages/MessageBundle_de.properties | 278 +++++++
.../epubcheck/messages/MessageBundle_es.properties | 277 +++++++
.../epubcheck/messages/MessageBundle_fr.properties | 287 +++++++
.../epubcheck/messages/MessageBundle_it.properties | 300 +++++++
.../epubcheck/messages/MessageBundle_ja.properties | 6 -
.../com/adobe/epubcheck/ops/registeredSchemas.txt | 75 --
.../com/adobe/epubcheck/schema/20/dtd/oebdoc12.dtd | 555 +++++++++++++
.../adobe/epubcheck/schema/20/rng/xhtml/edit.rng | 2 +
.../adobe/epubcheck/schema/20/sch/id-unique.sch | 8 +-
.../com/adobe/epubcheck/schema/20/sch/ncx.sch | 2 +-
.../com/adobe/epubcheck/schema/20/sch/opf.sch | 20 +-
.../com/adobe/epubcheck/schema/20/sch/xhtml.sch | 12 +
.../epubcheck/schema/30/datanav/datanav-xhtml.sch | 40 +
.../epubcheck/schema/30/dict/dict-collection.sch | 33 +
.../adobe/epubcheck/schema/30/dict/dict-opf.sch | 85 ++
.../adobe/epubcheck/schema/30/dict/dict-xhtml.sch | 96 +++
.../epubcheck/schema/30/dict/search-key-map.rnc | 25 +
.../epubcheck/schema/30/edupub/edu-headings.sch | 68 --
.../schema/30/edupub/edu-ocf-metadata.sch | 13 +
.../adobe/epubcheck/schema/30/edupub/edu-opf.sch | 55 +-
.../epubcheck/schema/30/edupub/edu-semantics.sch | 92 +--
.../epubcheck/schema/30/edupub/edu-structure.sch | 93 +++
.../adobe/epubcheck/schema/30/epub-nav-30-PREP.sch | 70 --
.../com/adobe/epubcheck/schema/30/epub-nav-30.sch | 27 +-
.../adobe/epubcheck/schema/30/epub-svg-30-PREP.sch | 18 -
.../epubcheck/schema/30/epub-xhtml-30-PREP.sch | 354 --------
.../adobe/epubcheck/schema/30/epub-xhtml-30.sch | 357 ++++----
.../epubcheck/schema/30/idx/idx-collection.sch | 20 +
.../epubcheck/schema/30/idx/idx-xhtml-index.sch | 26 +
.../adobe/epubcheck/schema/30/idx/idx-xhtml.sch | 275 +++++++
.../epubcheck/schema/30/media-overlay-30-PREP.sch | 14 -
.../adobe/epubcheck/schema/30/mod/datatypes.rnc | 2 +-
.../schema/30/mod/html5/html5-attrib-30.rnc | 2 +-
.../schema/30/mod/html5/html5-document-30.rnc | 2 +-
.../schema/30/mod/html5/html5-embed-30.rnc | 3 +-
.../schema/30/mod/html5/html5-sections-30.rnc | 8 +-
.../adobe/epubcheck/schema/30/mod/id-unique.sch | 5 +-
.../schema/30/mod/mathml/mathml3-common.rnc | 4 +-
.../schema/30/mod/mathml/mathml3-content.rnc | 4 +-
.../schema/30/mod/mathml/mathml3-presentation.rnc | 19 +-
.../30/mod/mathml/mathml3-strict-content.rnc | 6 +-
.../schema/30/multiple-renditions/container.rnc | 14 +
.../schema/30/multiple-renditions/container.sch | 35 +
.../schema/30/multiple-renditions/mapping.rnc | 32 +
.../schema/30/multiple-renditions/mapping.sch | 23 +
.../epubcheck/schema/30/ocf-container-30.nvdl | 14 +
.../adobe/epubcheck/schema/30/ocf-container-30.rnc | 43 +-
.../adobe/epubcheck/schema/30/ocf-metadata-30.nvdl | 14 +
.../adobe/epubcheck/schema/30/ocf-metadata-30.rnc | 32 +
.../adobe/epubcheck/schema/30/ocf-metadata-30.sch | 95 +++
.../adobe/epubcheck/schema/30/package-30-PREP.sch | 127 ---
.../com/adobe/epubcheck/schema/30/package-30.sch | 39 +-
.../schema/30/previews/preview-collection.sch | 15 +
.../schema/30/previews/preview-pub-opf.sch | 20 +
.../com/adobe/epubcheck/util/messages.properties | 23 +-
.../adobe/epubcheck/util/messages_de.properties | 74 ++
.../adobe/epubcheck/util/messages_es.properties | 68 ++
.../adobe/epubcheck/util/messages_fr.properties | 71 ++
.../adobe/epubcheck/util/messages_it.properties | 79 ++
.../adobe/epubcheck/util/messages_ja.properties | 2 +-
.../datatype/xsd/resources/Messages_de.properties | 71 ++
.../datatype/xsd/resources/Messages_it.properties | 71 ++
.../datatype/xsd/resources/Messages_ja.properties | 2 +-
.../pattern/resources/Messages_de.properties | 148 ++++
.../pattern/resources/Messages_it.properties | 148 ++++
.../pattern/resources/Messages_ja.properties | 2 +-
.../schematron/resources/Messages.properties | 11 +
.../idpf/epubcheck/util/css/messages_de.properties | 20 +
.../idpf/epubcheck/util/css/messages_it.properties | 20 +
.../adobe/epubcheck/api/AbstractEpubCheckTest.java | 116 +--
.../epubcheck/api/Epub20CheckExpandedTest.java | 129 +--
.../com/adobe/epubcheck/api/Epub20CheckTest.java | 143 +---
.../epubcheck/api/Epub30CheckExpandedTest.java | 899 ++++++++++++++-------
.../com/adobe/epubcheck/api/Epub30CheckTest.java | 284 ++++---
src/test/java/com/adobe/epubcheck/cli/CLITest.java | 2 +-
.../com/adobe/epubcheck/nav/NavCheckerTest.java | 97 +--
.../com/adobe/epubcheck/ocf/OCFCheckerTest.java | 196 ++---
.../epubcheck/ocf/OCFFilenameCheckerTest.java | 10 +-
.../com/adobe/epubcheck/opf/MetadataSetTest.java | 179 ++++
.../com/adobe/epubcheck/opf/OPFCheckerTest.java | 680 +++++++++++-----
.../com/adobe/epubcheck/ops/OPSCheckerTest.java | 796 ++++++++++--------
.../epubcheck/overlay/OverlayCheckerTest.java | 102 +--
.../epubcheck/test/OutputDifferenceListener.java | 5 +-
.../com/adobe/epubcheck/test/TestRunListener.java | 15 +-
.../adobe/epubcheck/test/command_line_Test.java | 15 +-
src/test/java/com/adobe/epubcheck/test/common.java | 33 +-
.../java/com/adobe/epubcheck/test/css_Test.java | 23 +-
.../java/com/adobe/epubcheck/test/dtBook_Test.java | 6 +-
.../com/adobe/epubcheck/test/message_coverage.java | 22 +-
.../java/com/adobe/epubcheck/test/opf_Test.java | 6 +-
.../com/adobe/epubcheck/test/package_Test.java | 96 ++-
.../java/com/adobe/epubcheck/test/script_Test.java | 10 +-
.../java/com/adobe/epubcheck/test/toc_Test.java | 4 +-
.../java/com/adobe/epubcheck/test/xhtml_Test.java | 5 +-
.../com/adobe/epubcheck/util/OPFPeekerTest.java | 107 ++-
.../com/adobe/epubcheck/util/ValidationReport.java | 16 +-
.../adobe/epubcheck/vocab/PrefixParsingTest.java | 48 +-
.../java/com/adobe/epubcheck/vocab/VocabTest.java | 37 +-
.../org/idpf/epubcheck/util/css/CssParserTest.java | 13 +-
src/test/resources/20/epub/tests20.xml | 22 +-
src/test/resources/20/epub/valid/issue169.txt | 2 +-
.../20/epub/valid/issue301-ncx-empty-label.epub | Bin 0 -> 3363 bytes
src/test/resources/20/epub/valid/lorem.txt | 2 +-
.../20/expanded/invalid/fallbacks-circular.txt | 4 +-
.../invalid/fallbacks-nonresolving/EPUB/image.abc | 1 +
.../invalid/fallbacks-nonresolving/EPUB/image.jpeg | Bin 0 -> 1962 bytes
.../invalid/fallbacks-nonresolving/EPUB/image.xyz | 1 +
.../invalid/fallbacks-nonresolving}/EPUB/lorem.css | 0
.../invalid/fallbacks-nonresolving/EPUB/lorem.ncx | 29 +
.../invalid/fallbacks-nonresolving/EPUB/lorem.opf | 21 +
.../fallbacks-nonresolving/EPUB/lorem.xhtml | 109 +++
.../fallbacks-nonresolving/EPUB/page-template.xpgt | 44 +
.../fallbacks-nonresolving}/META-INF/container.xml | 0
.../invalid/fallbacks-nonresolving/mimetype | 1 +
.../20/expanded/invalid/lorem-dual-guide.txt | 2 +-
.../20/expanded/invalid/lorem-mimetype.txt | 2 +-
.../expanded/invalid/lorem-mimetype/EPUB/lorem.ncx | 6 -
.../invalid/lorem-ncx-badpath/EPUB}/lorem.css | 0
.../EPUB/lorem.ncx | 0
.../invalid/lorem-ncx-badpath/EPUB/lorem.opf | 17 +
.../invalid/lorem-ncx-badpath/EPUB/lorem.xhtml | 98 +++
.../lorem-ncx-badpath}/META-INF/container.xml | 0
.../20/expanded/invalid/lorem-ncx-badpath/mimetype | 1 +
.../invalid/ncx-uid-nomatch}/EPUB/lorem.css | 0
.../invalid/ncx-uid-nomatch/EPUB/lorem.ncx | 29 +
.../invalid/ncx-uid-nomatch/EPUB/lorem.opf | 17 +
.../invalid/ncx-uid-nomatch/EPUB/lorem.xhtml | 100 +++
.../ncx-uid-nomatch}/META-INF/container.xml | 0
.../20/expanded/invalid/ncx-uid-nomatch/mimetype | 1 +
.../invalid/ncx-uid-spaces}/EPUB/lorem.css | 0
.../expanded/invalid/ncx-uid-spaces/EPUB/lorem.ncx | 29 +
.../expanded/invalid/ncx-uid-spaces/EPUB/lorem.opf | 17 +
.../invalid/ncx-uid-spaces/EPUB/lorem.xhtml | 100 +++
.../invalid/ncx-uid-spaces}/META-INF/container.xml | 0
.../20/expanded/invalid/ncx-uid-spaces/mimetype | 1 +
src/test/resources/20/expanded/valid/fallbacks.txt | 4 +-
src/test/resources/20/expanded/valid/issue267.txt | 2 +-
.../issue332-idspaces/EPUB/Content/content1.xhtml | 42 +
.../issue332-idspaces/EPUB/Content/content2.xhtml | 42 +
.../valid/issue332-idspaces/EPUB/Image/cover.jpg | Bin 0 -> 455763 bytes
.../issue332-idspaces/EPUB/Navigation/toc.ncx | 27 +
.../valid/issue332-idspaces/EPUB/Style/style.css | 9 +
.../valid/issue332-idspaces/EPUB/package.opf | 28 +
.../valid/issue332-idspaces/META-INF/container.xml | 6 +
.../20/expanded/valid/issue332-idspaces/mimetype | 1 +
.../20/expanded/valid/lorem-basic-dual.txt | 2 +-
.../20/expanded/valid/lorem-dual-guide.txt | 4 +-
.../20/expanded/valid/lorem-uidspaces.txt | 2 +-
.../20/expanded/valid/lorem/lorem-basic.txt | 4 +-
.../ops/invalid/issue287-nested-hyperlink.xhtml | 12 +
.../20/single/ops/invalid/unresolved-entity.xhtml | 2 +-
.../ops/valid/issue293-edits-elem-attributes.xhtml | 9 +
.../edupub-multiple-renditions-nodctype-pub.epub | Bin 0 -> 248086 bytes
...pub-multiple-renditions-nodctype-rendition.epub | Bin 0 -> 248083 bytes
.../epub/invalid/edupub-pagination-nopagelist.epub | Bin 0 -> 546701 bytes
.../epub/invalid/edupub-pagination-nosource.epub | Bin 0 -> 546730 bytes
.../epub/invalid/edupub-toc-missing-branches.epub | Bin 0 -> 546775 bytes
.../invalid/multiple-renditions-badmediaquery.epub | Bin 0 -> 245029 bytes
.../multiple-renditions-nodctermsmodified.epub | Bin 0 -> 244968 bytes
.../invalid/multiple-renditions-nometadata.epub | Bin 0 -> 244654 bytes
.../invalid/multiple-renditions-noselection.epub | Bin 0 -> 244991 bytes
.../multiple-renditions-undefinedselection.epub | Bin 0 -> 245028 bytes
.../30/epub/valid/edupub-multiple-renditions.epub | Bin 0 -> 248114 bytes
.../resources/30/epub/valid/edupub-pagination.epub | Bin 0 -> 546759 bytes
src/test/resources/30/epub/valid/epub30-spec.txt | 2 +-
src/test/resources/30/epub/valid/extension-1.txt | 2 +-
.../30/epub/valid/font_fallback_chain.txt | 2 +-
src/test/resources/30/epub/valid/issue145.txt | 2 +-
src/test/resources/30/epub/valid/issue158.txt | 2 +-
src/test/resources/30/epub/valid/lorem.txt | 2 +-
.../resources/30/epub/valid/mp3-in-manifest.txt | 2 +-
.../resources/30/epub/valid/mp3-with-fallback.txt | 2 +-
.../30/epub/valid/multiple-renditions.epub | Bin 0 -> 245038 bytes
src/test/resources/30/epub/valid/test_svg.txt | 2 +-
src/test/resources/30/epub/valid/valid_ncx.txt | 2 +-
.../invalid/data-nav-inspine/EPUB/data-nav.xhtml | 12 +
.../data-nav-inspine}/EPUB/lorem.css | 0
.../invalid/data-nav-inspine/EPUB/lorem.opf | 19 +
.../data-nav-inspine}/EPUB/lorem.xhtml | 0
.../data-nav-inspine}/META-INF/container.xml | 0
.../data-nav-inspine}/mimetype | 0
.../data-nav-missing-type/EPUB/data-nav.xhtml | 12 +
.../data-nav-missing-type}/EPUB/lorem.css | 0
.../invalid/data-nav-missing-type/EPUB/lorem.opf | 18 +
.../data-nav-missing-type/EPUB}/lorem.xhtml | 0
.../data-nav-missing-type}/META-INF/container.xml | 0
.../data-nav-missing-type}/mimetype | 0
.../data-nav-multiple/EPUB/data-nav-2.xhtml | 12 +
.../invalid/data-nav-multiple/EPUB/data-nav.xhtml | 12 +
.../data-nav-multiple}/EPUB/lorem.css | 0
.../invalid/data-nav-multiple/EPUB/lorem.opf | 19 +
.../data-nav-multiple}/EPUB/lorem.xhtml | 0
.../data-nav-multiple}/META-INF/container.xml | 0
.../data-nav-multiple}/mimetype | 0
.../data-nav-notxhtml}/EPUB/lorem.css | 0
.../invalid/data-nav-notxhtml/EPUB/lorem.opf | 17 +
.../data-nav-notxhtml}/EPUB/lorem.xhtml | 0
.../data-nav-notxhtml}/META-INF/container.xml | 0
.../data-nav-notxhtml}/mimetype | 0
.../EPUB/data-nav.xhtml | 16 +
.../data-nav-regionbased-notfxl/EPUB/package.opf | 19 +
.../data-nav-regionbased-notfxl/EPUB/page1.xhtml | 46 ++
.../data-nav-regionbased-notfxl/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../data-nav-regionbased-notfxl}/mimetype | 0
.../EPUB/lorem.css | 0
.../EPUB/lorem.opf | 17 +
.../EPUB/lorem.xhtml | 108 +++
.../META-INF/container.xml | 0
.../data-nav-regionbased-notindatanav}/mimetype | 0
.../EPUB/data-nav.xhtml | 86 ++
.../data-nav-regionbased-struct/EPUB/package.opf | 21 +
.../data-nav-regionbased-struct/EPUB/page1.xhtml | 46 ++
.../data-nav-regionbased-struct/EPUB/page2.xhtml | 37 +
.../data-nav-regionbased-struct/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../data-nav-regionbased-struct}/mimetype | 0
.../invalid/dict-invalidcontent/EPUB/dict.xhtml | 20 +
.../invalid/dict-invalidcontent/EPUB/nav.xhtml | 28 +
.../invalid/dict-invalidcontent/EPUB/package.opf | 24 +
.../invalid/dict-invalidcontent/EPUB/search.xml | 8 +
.../dict-invalidcontent/EPUB/style.css} | 0
.../dict-invalidcontent/META-INF/container.xml | 7 +
.../dict-invalidcontent}/mimetype | 0
.../dict-multiple-nodictcontent/EPUB/dict1.xhtml | 20 +
.../dict-multiple-nodictcontent/EPUB/dict2.xhtml | 20 +
.../dict-multiple-nodictcontent/EPUB/nav.xhtml | 17 +
.../dict-multiple-nodictcontent/EPUB/package.opf | 35 +
.../dict-multiple-nodictcontent/EPUB/search1.xml | 8 +
.../dict-multiple-nodictcontent/EPUB/search2.xml | 8 +
.../dict-multiple-nodictcontent/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../dict-multiple-nodictcontent}/mimetype | 0
.../invalid/dict-nodctype-2/EPUB/dict.xhtml | 20 +
.../invalid/dict-nodctype-2/EPUB/nav.xhtml | 16 +
.../invalid/dict-nodctype-2/EPUB/package.opf | 23 +
.../invalid/dict-nodctype-2/EPUB/search.xml | 8 +
.../dict-nodctype-2/EPUB/style.css} | 0
.../invalid/dict-nodctype-2/META-INF/container.xml | 7 +
.../dict-nodctype-2}/mimetype | 0
.../expanded/invalid/dict-nodctype/EPUB/dict.xhtml | 20 +
.../expanded/invalid/dict-nodctype/EPUB/nav.xhtml | 16 +
.../invalid/dict-nodctype/EPUB/package.opf | 23 +
.../expanded/invalid/dict-nodctype/EPUB/search.xml | 8 +
.../dict-nodctype/EPUB/style.css} | 0
.../invalid/dict-nodctype/META-INF/container.xml | 7 +
.../dict-nodctype}/mimetype | 0
.../dict-single-nodictcontent/EPUB/dict.xhtml | 20 +
.../dict-single-nodictcontent/EPUB/nav.xhtml | 16 +
.../dict-single-nodictcontent/EPUB/package.opf | 23 +
.../dict-single-nodictcontent/EPUB/search.xml | 8 +
.../dict-single-nodictcontent/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../dict-single-nodictcontent}/mimetype | 0
.../invalid/dict-skm-badextension/EPUB/dict.xhtml | 20 +
.../invalid/dict-skm-badextension/EPUB/nav.xhtml | 16 +
.../invalid/dict-skm-badextension/EPUB/package.opf | 23 +
.../invalid/dict-skm-badextension/EPUB/search.txt | 8 +
.../dict-skm-badextension/EPUB/style.css} | 0
.../dict-skm-badextension/META-INF/container.xml | 7 +
.../dict-skm-badextension}/mimetype | 0
.../invalid/dict-skm-invalid/EPUB/dict.xhtml | 20 +
.../invalid/dict-skm-invalid/EPUB/nav.xhtml | 16 +
.../invalid/dict-skm-invalid/EPUB/package.opf | 23 +
.../invalid/dict-skm-invalid/EPUB/search.xml | 8 +
.../dict-skm-invalid/EPUB/style.css} | 0
.../dict-skm-invalid/META-INF/container.xml | 7 +
.../dict-skm-invalid}/mimetype | 0
.../invalid/dict-skm-linktocss/EPUB/dict.xhtml | 20 +
.../invalid/dict-skm-linktocss/EPUB/nav.xhtml | 16 +
.../invalid/dict-skm-linktocss/EPUB/package.opf | 23 +
.../invalid/dict-skm-linktocss/EPUB/search.xml | 8 +
.../dict-skm-linktocss/EPUB/style.css} | 0
.../dict-skm-linktocss/META-INF/container.xml | 7 +
.../dict-skm-linktocss}/mimetype | 0
.../invalid/dict-skm-linktonowhere/EPUB/dict.xhtml | 20 +
.../invalid/dict-skm-linktonowhere/EPUB/nav.xhtml | 16 +
.../dict-skm-linktonowhere/EPUB/package.opf | 23 +
.../invalid/dict-skm-linktonowhere/EPUB/search.xml | 8 +
.../dict-skm-linktonowhere/EPUB/style.css} | 0
.../dict-skm-linktonowhere/META-INF/container.xml | 7 +
.../dict-skm-linktonowhere}/mimetype | 0
.../duplicate-id}/EPUB/lorem.css | 0
.../expanded/invalid/duplicate-id/EPUB/lorem.opf | 17 +
.../expanded/invalid/duplicate-id/EPUB/lorem.xhtml | 108 +++
.../duplicate-id}/META-INF/container.xml | 0
.../duplicate-id}/mimetype | 0
.../duplicate-resource}/EPUB/lorem.css | 0
.../invalid/duplicate-resource/EPUB/lorem.opf | 18 +
.../duplicate-resource}/EPUB/lorem.xhtml | 0
.../duplicate-resource}/META-INF/container.xml | 0
.../duplicate-resource}/mimetype | 0
.../invalid/edu-microdata/EPUB/contents.xhtml | 116 +++
.../invalid/edu-microdata/EPUB/package.opf | 17 +
.../invalid/edu-microdata/META-INF/container.xml | 7 +
.../edu-microdata}/mimetype | 0
.../invalid/edu-missing-lox/EPUB/contents.xhtml | 122 +++
.../invalid/edu-missing-lox/EPUB/package.opf | 19 +
.../invalid/edu-missing-lox/META-INF/container.xml | 7 +
.../edu-missing-lox}/mimetype | 0
.../edu-pagination-nopagelist/EPUB/contents.xhtml | 98 +++
.../edu-pagination-nopagelist/EPUB/nav.xhtml | 23 +
.../edu-pagination-nopagelist/EPUB/package.opf | 21 +
.../META-INF/container.xml | 7 +
.../edu-pagination-nopagelist}/mimetype | 0
.../EPUB/contents.xhtml | 98 +++
.../edu-pagination-nopagesource/EPUB/nav.xhtml | 28 +
.../edu-pagination-nopagesource/EPUB/package.opf | 19 +
.../META-INF/container.xml | 7 +
.../edu-pagination-nopagesource}/mimetype | 0
.../invalid/href-outofspine/EPUB/1-lorem.xhtml | 36 +
.../invalid/href-outofspine/EPUB/2-lorem.xhtml | 99 +++
.../href-outofspine}/EPUB/lorem.css | 0
.../invalid/href-outofspine/EPUB/lorem.opf | 20 +
.../invalid/href-outofspine/EPUB/nav.xhtml | 20 +
.../href-outofspine}/META-INF/container.xml | 0
.../href-outofspine}/mimetype | 0
.../EPUB/content.xhtml | 28 +
.../idx-collection-badidxcontent/EPUB/index1.xhtml | 12 +
.../idx-collection-badidxcontent/EPUB/index2.xhtml | 18 +
.../idx-collection-badidxcontent/EPUB/package.opf | 25 +
.../idx-collection-badidxcontent/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../idx-collection-badidxcontent}/mimetype | 0
.../idx-collection-noindex/EPUB/content.xhtml | 28 +
.../idx-collection-noindex/EPUB/index1.xhtml | 18 +
.../idx-collection-noindex/EPUB/index2.xhtml | 18 +
.../idx-collection-noindex/EPUB/package.opf | 25 +
.../idx-collection-noindex/EPUB/style.css} | 0
.../idx-collection-noindex/META-INF/container.xml | 7 +
.../idx-collection-noindex}/mimetype | 0
.../EPUB/content.xhtml | 28 +
.../idx-single-file-badidxcontent/EPUB/index.xhtml | 12 +
.../idx-single-file-badidxcontent/EPUB/package.opf | 19 +
.../idx-single-file-badidxcontent/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../idx-single-file-badidxcontent}/mimetype | 0
.../idx-single-file-noindex/EPUB/content.xhtml | 28 +
.../idx-single-file-noindex/EPUB/index.xhtml | 18 +
.../idx-single-file-noindex/EPUB/package.opf | 19 +
.../idx-single-file-noindex/EPUB/style.css} | 0
.../idx-single-file-noindex/META-INF/container.xml | 7 +
.../idx-single-file-noindex}/mimetype | 0
.../idx-whole-pub-badidxcontent/EPUB/index.xhtml | 32 +
.../idx-whole-pub-badidxcontent/EPUB/package.opf | 18 +
.../idx-whole-pub-badidxcontent/EPUB/style.css} | 0
.../META-INF/container.xml | 7 +
.../idx-whole-pub-badidxcontent}/mimetype | 0
.../invalid/idx-whole-pub-noindex/EPUB/index.xhtml | 38 +
.../invalid/idx-whole-pub-noindex/EPUB/package.opf | 18 +
.../idx-whole-pub-noindex/EPUB/style.css} | 0
.../idx-whole-pub-noindex/META-INF/container.xml | 7 +
.../idx-whole-pub-noindex}/mimetype | 0
.../link-missing}/EPUB/lorem.css | 0
.../expanded/invalid/link-missing/EPUB/lorem.opf | 18 +
.../link-missing}/EPUB/lorem.xhtml | 0
.../link-missing}/META-INF/container.xml | 0
.../30/expanded/invalid/link-missing/mimetype | 1 +
.../invalid/lorem-encryption/dropped text.txt | 1 -
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 12 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 19 +
.../multiple-renditions-mapping-nonxhtml}/mimetype | 0
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 12 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 19 +
.../mimetype | 0
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 12 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 18 +
.../mimetype | 0
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 12 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 29 +
.../mimetype | 0
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 13 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 19 +
.../mapping2.xhtml | 19 +
.../mimetype | 0
.../ncx-external-identifier}/EPUB/lorem.css | 0
.../invalid/ncx-external-identifier/EPUB/lorem.ncx | 30 +
.../invalid/ncx-external-identifier/EPUB/lorem.opf | 18 +
.../ncx-external-identifier}/EPUB/lorem.xhtml | 0
.../META-INF/container.xml | 0
.../ncx-external-identifier}/mimetype | 0
.../preview-embedded-linkcfi}/EPUB/chapter1.xhtml | 0
.../preview-embedded-linkcfi}/EPUB/chapter2.xhtml | 0
.../preview-embedded-linkcfi}/EPUB/chapter3.xhtml | 0
.../preview-embedded-linkcfi}/EPUB/lorem.css | 0
.../preview-embedded-linkcfi/EPUB/lorem.opf | 30 +
.../preview-embedded-linkcfi}/EPUB/nav.xhtml | 0
.../META-INF/container.xml | 0
.../preview-embedded-linkcfi}/mimetype | 0
.../preview-embedded-linknoCD}/EPUB/chapter1.xhtml | 0
.../preview-embedded-linknoCD}/EPUB/chapter2.xhtml | 0
.../preview-embedded-linknoCD}/EPUB/chapter3.xhtml | 0
.../preview-embedded-linknoCD}/EPUB/lorem.css | 0
.../preview-embedded-linknoCD/EPUB/lorem.opf | 30 +
.../preview-embedded-linknoCD}/EPUB/nav.xhtml | 0
.../META-INF/container.xml | 0
.../preview-embedded-linknoCD}/mimetype | 0
.../preview-embedded-nolinks}/EPUB/chapter1.xhtml | 0
.../preview-embedded-nolinks}/EPUB/chapter2.xhtml | 0
.../preview-embedded-nolinks}/EPUB/chapter3.xhtml | 0
.../preview-embedded-nolinks}/EPUB/lorem.css | 0
.../preview-embedded-nolinks/EPUB/lorem.opf | 30 +
.../preview-embedded-nolinks}/EPUB/nav.xhtml | 0
.../META-INF/container.xml | 0
.../preview-embedded-nolinks}/mimetype | 0
.../EPUB/chapter1.xhtml | 0
.../EPUB/chapter2.xhtml | 0
.../EPUB/chapter3.xhtml | 0
.../preview-embedded-nomanifest}/EPUB/lorem.css | 0
.../preview-embedded-nomanifest/EPUB/lorem.opf | 25 +
.../preview-embedded-nomanifest}/EPUB/nav.xhtml | 0
.../META-INF/container.xml | 0
.../preview-embedded-nomanifest}/mimetype | 0
.../preview-pub-nosource}/EPUB/lorem.css | 0
.../invalid/preview-pub-nosource/EPUB/lorem.opf | 21 +
.../preview-pub-nosource}/EPUB/lorem.xhtml | 0
.../preview-pub-nosource}/META-INF/container.xml | 0
.../preview-pub-nosource}/mimetype | 0
.../preview-pub-notype}/EPUB/lorem.css | 0
.../invalid/preview-pub-notype/EPUB/lorem.opf | 21 +
.../preview-pub-notype}/EPUB/lorem.xhtml | 0
.../preview-pub-notype}/META-INF/container.xml | 0
.../preview-pub-notype}/mimetype | 0
.../preview-pub-samesourceid}/EPUB/lorem.css | 0
.../preview-pub-samesourceid/EPUB/lorem.opf | 21 +
.../preview-pub-samesourceid}/EPUB/lorem.xhtml | 0
.../META-INF/container.xml | 0
.../preview-pub-samesourceid}/mimetype | 0
.../resource-missing}/EPUB/lorem.css | 0
.../invalid/resource-missing/EPUB/lorem.opf | 18 +
.../resource-missing}/EPUB/lorem.xhtml | 0
.../resource-missing}/META-INF/container.xml | 0
.../resource-missing}/mimetype | 0
.../invalid/xpgt-no-fallback/EPUB/lorem.opf | 17 +
.../invalid/xpgt-no-fallback/EPUB/lorem.xhtml | 108 +++
.../xpgt-no-fallback/EPUB/page-template.xpgt | 44 +
.../xpgt-no-fallback}/META-INF/container.xml | 0
.../xpgt-no-fallback}/mimetype | 0
.../30/expanded/valid/cc-shared-culture.txt | 2 +-
.../valid/data-nav-basic/EPUB/data-nav.xhtml | 12 +
.../EPUB/lorem.css | 0
.../expanded/valid/data-nav-basic/EPUB/lorem.opf | 18 +
.../EPUB/lorem.xhtml | 0
.../META-INF/container.xml | 0
.../mimetype | 0
.../valid/data-nav-regionbased/EPUB/data-nav.xhtml | 16 +
.../valid/data-nav-regionbased/EPUB/package.opf | 19 +
.../valid/data-nav-regionbased/EPUB/page1.xhtml | 46 ++
.../EPUB/style.css} | 0
.../data-nav-regionbased/META-INF/container.xml | 7 +
.../mimetype | 0
.../expanded/valid/dict-multiple/EPUB/dict1.xhtml | 20 +
.../expanded/valid/dict-multiple/EPUB/dict2.xhtml | 20 +
.../30/expanded/valid/dict-multiple/EPUB/nav.xhtml | 17 +
.../expanded/valid/dict-multiple/EPUB/package.opf | 35 +
.../expanded/valid/dict-multiple/EPUB/search1.xml | 8 +
.../expanded/valid/dict-multiple/EPUB/search2.xml | 8 +
.../lorem.css => dict-multiple/EPUB/style.css} | 0
.../valid/dict-multiple/META-INF/container.xml | 7 +
.../mimetype | 0
.../30/expanded/valid/dict-single/EPUB/dict.xhtml | 20 +
.../30/expanded/valid/dict-single/EPUB/nav.xhtml | 16 +
.../30/expanded/valid/dict-single/EPUB/package.opf | 23 +
.../30/expanded/valid/dict-single/EPUB/search.xml | 9 +
.../EPUB/lorem.css => dict-single/EPUB/style.css} | 0
.../valid/dict-single/META-INF/container.xml | 7 +
.../{collections-preview => dict-single}/mimetype | 0
.../expanded/valid/edu-basic/EPUB/contents.xhtml | 112 +++
.../30/expanded/valid/edu-basic/EPUB/package.opf | 17 +
.../valid/edu-basic/META-INF/container.xml | 7 +
.../{collections-preview => edu-basic}/mimetype | 0
.../30/expanded/valid/edu-fxl/EPUB/contents.xhtml | 23 +
.../30/expanded/valid/edu-fxl/EPUB/package.opf | 18 +
.../expanded/valid/edu-fxl/META-INF/container.xml | 7 +
.../{collections-preview => edu-fxl}/mimetype | 0
.../valid/edu-non-linear/EPUB/contents.xhtml | 112 +++
.../valid/edu-non-linear/EPUB/nonlinear.xhtml | 22 +
.../expanded/valid/edu-non-linear/EPUB/package.opf | 19 +
.../valid/edu-non-linear/META-INF/container.xml | 7 +
.../mimetype | 0
src/test/resources/30/expanded/valid/fallbacks.txt | 2 +-
.../valid/idx-collection/EPUB/content.xhtml | 28 +
.../valid/idx-collection/EPUB/index1.xhtml | 19 +
.../valid/idx-collection/EPUB/index2.xhtml | 18 +
.../expanded/valid/idx-collection/EPUB/package.opf | 25 +
.../lorem.css => idx-collection/EPUB/style.css} | 0
.../valid/idx-collection/META-INF/container.xml | 7 +
.../mimetype | 0
.../valid/idx-single-file/EPUB/content.xhtml | 28 +
.../valid/idx-single-file/EPUB/index.xhtml | 18 +
.../valid/idx-single-file/EPUB/package.opf | 19 +
.../lorem.css => idx-single-file/EPUB/style.css} | 0
.../valid/idx-single-file/META-INF/container.xml | 7 +
.../mimetype | 0
.../expanded/valid/idx-whole-pub/EPUB/index.xhtml | 38 +
.../expanded/valid/idx-whole-pub/EPUB/package.opf | 18 +
.../lorem.css => idx-whole-pub/EPUB/style.css} | 0
.../valid/idx-whole-pub/META-INF/container.xml | 7 +
.../mimetype | 0
src/test/resources/30/expanded/valid/issue267.txt | 2 +-
.../issue332-idspaces/EPUB/Content/A_cover.xhtml | 11 +
.../EPUB/Content/B_pagetitre.xhtml | 12 +
.../EPUB/Content/C_bodymatter.xhtml | 14 +
.../valid/issue332-idspaces/EPUB/Image/cover.jpg | Bin 0 -> 56018 bytes
.../issue332-idspaces/EPUB/Image/pagetitre.jpg | Bin 0 -> 51214 bytes
.../issue332-idspaces/EPUB/Navigation/nav.xhtml | 21 +
.../valid/issue332-idspaces/EPUB/Style/style.css | 3 +
.../valid/issue332-idspaces/EPUB/package.opf | 28 +
.../valid/issue332-idspaces/META-INF/container.xml | 6 +
.../30/expanded/valid/issue332-idspaces/mimetype | 1 +
.../{lorem-xrenditions => issue419}/EPUB/lorem.css | 0
.../30/expanded/valid/issue419/EPUB/lorem.opf | 17 +
.../30/expanded/valid/issue419/EPUB/lorem.xhtml | 109 +++
.../META-INF/container.xml | 0
.../{collections-preview => issue419}/mimetype | 0
.../expanded/valid/issue567/META-INF/container.xml | 6 +
.../valid/issue567/OEBPS/html/Chapter.xhtml | 17 +
.../valid/issue567/OEBPS/images/image1.jpg | Bin 0 -> 1872367 bytes
.../expanded/valid/issue567/OEBPS/navigation.xhtml | 21 +
.../30/expanded/valid/issue567/OEBPS/package.opf | 28 +
.../30/expanded/valid/issue567/OEBPS/toc.ncx | 14 +
.../resources/30/expanded/valid/issue567/mimetype | 1 +
.../resources/30/expanded/valid/lorem-audio.txt | 2 +-
.../30/expanded/valid/lorem-basic-dual.txt | 2 +-
.../30/expanded/valid/lorem-basic-switch.txt | 2 +-
.../resources/30/expanded/valid/lorem-basic.txt | 2 +-
.../resources/30/expanded/valid/lorem-bindings.txt | 4 +-
.../30/expanded/valid/lorem-css-import.txt | 2 +-
.../resources/30/expanded/valid/lorem-foreign.txt | 2 +-
.../expanded/valid/lorem-iframe/EPUB/1-lorem.xhtml | 92 +++
.../expanded/valid/lorem-iframe/EPUB/2-lorem.xhtml | 99 +++
.../EPUB/lorem.css | 0
.../30/expanded/valid/lorem-iframe/EPUB/lorem.opf | 19 +
.../30/expanded/valid/lorem-iframe/EPUB/nav.xhtml | 20 +
.../META-INF/container.xml | 0
.../{collections-preview => lorem-iframe}/mimetype | 0
.../resources/30/expanded/valid/lorem-link.txt | 5 +-
.../30/expanded/valid/lorem-object-fallbacks.txt | 2 +-
.../resources/30/expanded/valid/lorem-poster.txt | 4 +-
.../resources/30/expanded/valid/lorem-remote.txt | 4 +-
.../resources/30/expanded/valid/lorem-svg-dual.txt | 2 +-
.../30/expanded/valid/lorem-svg-hyperlink.txt | 2 +-
src/test/resources/30/expanded/valid/lorem-svg.txt | 2 +-
.../valid/lorem-xrenditions/EPUB/lorem.opf | 17 -
.../valid/lorem-xrenditions/EPUB_2/lorem.opf | 17 -
.../valid/lorem-xrenditions/META-INF/container.xml | 7 -
.../EPUB/nav.xhtml | 108 +++
.../EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../META-INF/container.xml | 12 +
.../META-INF/metadata.xml | 6 +
.../OTHER/nav.xhtml | 109 +++
.../OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../mapping.xhtml | 30 +
.../mimetype | 0
.../valid/multiple-renditions/EPUB/nav.xhtml | 108 +++
.../valid/multiple-renditions/EPUB/package.opf | 17 +
.../EPUB/style.css} | 0
.../multiple-renditions/META-INF/container.xml | 12 +
.../multiple-renditions/META-INF/metadata.xml | 6 +
.../valid/multiple-renditions/OTHER/nav.xhtml | 109 +++
.../valid/multiple-renditions/OTHER/package.opf | 18 +
.../OTHER/style.css} | 0
.../valid/multiple-renditions/mapping.xhtml | 19 +
.../mimetype | 0
.../valid/non-edu-missing-lox/EPUB/contents.xhtml | 122 +++
.../valid/non-edu-missing-lox/EPUB/package.opf | 18 +
.../non-edu-missing-lox/META-INF/container.xml | 7 +
.../mimetype | 0
.../EPUB/chapter1.xhtml | 0
.../EPUB/chapter2.xhtml | 0
.../EPUB/chapter3.xhtml | 0
.../EPUB/lorem.css | 0
.../EPUB/lorem.opf | 0
.../EPUB/nav.xhtml | 0
.../META-INF/container.xml | 0
.../mimetype | 0
.../EPUB/lorem.css | 0
.../30/expanded/valid/preview-pub/EPUB/lorem.opf | 21 +
.../EPUB/lorem.xhtml | 0
.../META-INF/container.xml | 0
.../{collections-preview => preview-pub}/mimetype | 0
src/test/resources/30/expanded/valid/svg-cover.txt | 2 +-
.../resources/30/expanded/valid/svg-in-spine.txt | 6 +-
.../30/expanded/valid/svg-in-spine/OPS/content.opf | 4 +-
.../expanded/valid/svg-referenced/EPUB/image.svg | 262 ++++++
.../expanded/valid/svg-referenced/EPUB/lorem.css | 7 +
.../expanded/valid/svg-referenced/EPUB/lorem.opf | 38 +
.../expanded/valid/svg-referenced/EPUB/lorem.xhtml | 30 +
.../svg-referenced/EPUB/svg-embed-declared.xhtml | 12 +
.../EPUB/svg-embed-not-declared.xhtml | 12 +
.../svg-referenced/EPUB/svg-iframe-declared.xhtml | 12 +
.../EPUB/svg-iframe-not-declared.xhtml | 12 +
.../svg-referenced/EPUB/svg-img-declared.xhtml | 12 +
.../svg-referenced/EPUB/svg-img-not-declared.xhtml | 12 +
.../svg-referenced/EPUB/svg-imgdata-declared.xhtml | 14 +
.../EPUB/svg-imgdata-not-declared.xhtml | 14 +
.../svg-referenced/EPUB/svg-object-declared.xhtml | 12 +
.../EPUB/svg-object-not-declared.xhtml | 12 +
.../META-INF/container.xml | 0
.../mimetype | 0
.../30/expanded/valid/wasteland-basic.txt | 2 +-
.../resources/30/expanded/valid/wasteland-otf.txt | 2 +-
.../EPUB/lorem.css | 0
.../valid/xpgt-explicit-fallback/EPUB/lorem.opf | 18 +
.../valid/xpgt-explicit-fallback/EPUB/lorem.xhtml | 108 +++
.../xpgt-explicit-fallback/EPUB/page-template.xpgt | 44 +
.../META-INF/container.xml | 0
.../mimetype | 0
.../EPUB/lorem.css | 0
.../valid/xpgt-implicit-fallback/EPUB/lorem.opf | 18 +
.../valid/xpgt-implicit-fallback/EPUB/lorem.xhtml | 109 +++
.../xpgt-implicit-fallback/EPUB/page-template.xpgt | 44 +
.../META-INF/container.xml | 0
.../mimetype | 0
.../resources/30/single/nav/valid/issue538.xhtml | 21 +
.../opf/invalid/collection-foreign-idpf.org.opf | 23 +
.../opf/invalid/collection-foreign-invalid-uri.opf | 23 +
...st-001.opf => collection-manifest-toplevel.opf} | 0
.../single/opf/invalid/collection-unknown-role.opf | 23 +
.../opf/invalid/dict-lang-invalidcollection.opf | 43 +
.../opf/invalid/dict-lang-invalidtoplevel.opf | 24 +
.../opf/invalid/dict-lang-missingcollection.opf | 41 +
.../opf/invalid/dict-lang-missingtoplevel.opf | 23 +
.../opf/invalid/dict-lang-undeclaredcollection.opf | 41 +
.../opf/invalid/dict-lang-undeclaredtoplevel.opf | 23 +
.../opf/invalid/dict-multiple-missingresource.opf | 37 +
.../opf/invalid/dict-multiple-morethanoneskm.opf | 38 +
.../single/opf/invalid/dict-multiple-nonxhtml.opf | 37 +
.../30/single/opf/invalid/dict-multiple-noskm.opf | 34 +
.../single/opf/invalid/dict-multiple-sharedskm.opf | 35 +
.../opf/invalid/dict-multiple-subcollection.opf | 40 +
.../30/single/opf/invalid/dict-nodctype.opf | 23 +
.../30/single/opf/invalid/dict-single-noskm-2.opf | 23 +
.../30/single/opf/invalid/dict-single-noskm.opf | 23 +
.../single/opf/invalid/dict-skm-badmediatype.opf | 25 +
.../30/single/opf/invalid/dict-type-unknown.opf | 24 +
.../opf/invalid/dict-undeclaredcollection.opf | 23 +
.../opf/invalid/edupub-accessFeature-none.opf | 20 +
.../single/opf/invalid/edupub-missing-dc-type.opf | 19 +
.../single/opf/invalid/edupub-no-accessFeature.opf | 19 +
.../invalid/edupub-teacher-edition-no-dc-type.opf | 21 +
.../invalid/edupub-teacher-edition-nosource.opf | 21 +
.../30/single/opf/invalid/id-unique-spaces.opf | 30 +
.../idx-collection-indexgroup-withchild.opf | 29 +
.../opf/invalid/idx-collection-invalidchild.opf | 27 +
.../invalid/idx-collection-resource-noxhtml.opf | 24 +
.../invalid/idx-collection-toplevel-indexgroup.opf | 32 +
.../30/single/opf/invalid/item-nomediatype.opf | 29 +
.../30/single/opf/invalid/item-properties.opf | 1 +
.../30/single/opf/invalid/link-in-manifest.opf | 17 +
.../opf/invalid/manifest-duplicate-resource.opf | 18 +
.../30/single/opf/invalid/meta-refines-cycle.opf | 20 +
.../30/single/opf/invalid/prefix-declaration.opf | 4 +-
.../30/single/opf/invalid/prefixes-001.opf | 2 +-
.../30/single/opf/invalid/prefixes-002.opf | 4 +-
.../30/single/opf/invalid/prefixes-003.opf | 4 +-
.../30/single/opf/invalid/prefixes-004.opf | 4 +-
.../30/single/opf/invalid/prefixes-redeclare.opf | 4 +-
.../resources/30/single/opf/invalid/scheme-001.opf | 4 +-
.../resources/30/single/opf/invalid/scheme-002.opf | 4 +-
...llection-valid-do-001.opf => collection-do.opf} | 0
.../30/single/opf/valid/collection-foreign.opf | 23 +
.../30/single/opf/valid/collection-preview.opf | 34 +
.../30/single/opf/valid/collection-valid-001.opf | 36 -
.../30/single/opf/valid/collection-valid-002.opf | 30 -
.../opf/valid/dict-multiple-dedicatedlang.opf | 42 +
.../30/single/opf/valid/dict-multiple.opf | 35 +
.../30/single/opf/valid/dict-single-typed.opf | 24 +
.../resources/30/single/opf/valid/dict-single.opf | 23 +
.../30/single/opf/valid/edupub-minimal.opf | 20 +
.../30/single/opf/valid/edupub-teacher-edition.opf | 22 +
.../resources/30/single/opf/valid/id-spaces.opf | 29 +
.../single/opf/valid/idx-collection-indexgroup.opf | 52 ++
.../30/single/opf/valid/idx-collection.opf | 24 +
.../resources/30/single/opf/valid/prefixes.opf | 4 +-
.../resources/30/single/opf/valid/sc-embedded.opf | 54 ++
.../resources/30/single/opf/valid/scheme-001.opf | 4 +-
.../30/single/xhtml/invalid/duplicate-id.xhtml | 10 +
.../xhtml/invalid/edupub-heading-imgnoalt.xhtml | 15 +
.../edupub-sectioning-arialabel-heading.xhtml | 21 +
.../invalid/edupub-sectioning-explicit-body.xhtml | 31 +
...pub-sectioning-implicit-body-aria-heading.xhtml | 15 +
.../invalid/edupub-sectioning-implicit-body.xhtml | 15 +
.../xhtml/invalid/edupub-sectioning-subtitle.xhtml | 15 +
.../single/xhtml/invalid/edupub-sectioning.xhtml | 31 +
.../30/single/xhtml/invalid/http-equiv-1.xhtml | 2 +-
.../30/single/xhtml/invalid/http-equiv-2.xhtml | 17 +
.../30/single/xhtml/invalid/index-noindex.xhtml | 13 +
.../30/single/xhtml/invalid/index-notonbody.xhtml | 26 +
.../xhtml/invalid/issue288-invalid-uri.xhtml | 14 +
.../30/single/xhtml/valid/edupub-heading-img.xhtml | 18 +
.../valid/edupub-sectioning-explicit-body.xhtml | 48 ++
.../edupub-sectioning-explicit-sections.xhtml | 21 +
.../valid/edupub-sectioning-implicit-body.xhtml | 47 ++
.../xhtml/valid/edupub-sectioning-subtitle.xhtml | 25 +
.../30/single/xhtml/valid/http-equiv-1.xhtml | 1 +
.../resources/30/single/xhtml/valid/index.xhtml | 18 +
.../valid/issue282-object-typemustmatch.xhtml | 8 +
.../30/single/xhtml/valid/issue296-irc-uri.xhtml | 13 +
.../resources/30/single/xhtml/valid/issue340.xhtml | 8 +
.../resources/30/single/xhtml/valid/issue341.xhtml | 8 +
.../resources/30/single/xhtml/valid/issue355.xhtml | 8 +
.../resources/30/single/xhtml/valid/mathml.xhtml | 29 +
.../test/DTBook/Basic/OPS/AreYouReadyV3.xml | 2 +-
.../adobe/epubcheck/test/DTBook/Basic/OPS/toc.ncx | 2 +-
.../test/DTBook/Basic_expected_results.json | 26 +-
.../test/DTBook/Basic_expected_results.xml | 2 +-
.../failonwarnings_expected_results.json | 50 +-
.../command_line/jsonfile_expected_results.json | 48 +-
.../listSeverities_expected_results.txt | 91 ++-
.../passonwarnings_expected_results.json | 48 +-
.../severity_error_expected_results.txt | 11 +-
.../severity_fatal_expected_results.txt | 1 -
.../severity_overrideBadId_expected_results.txt | 95 ++-
...everity_overrideBadMessage_expected_results.txt | 89 +-
...verity_overrideBadSeverity_expected_results.txt | 95 ++-
...verity_overrideMissingFile_expected_results.txt | 95 ++-
.../severity_overrideOk_expected_results.txt | 93 ++-
.../severity_usage_expected_results.txt | 95 ++-
.../severity_warning_expected_results.txt | 17 +-
.../test/command_line/xmlfile_expected_results.xml | 6 +-
.../test/command_line/xmlfile_expected_results.xmp | 93 +++
.../test/css/alternate_expected_results.json | 46 +-
.../test/css/columns_expected_results.json | 56 +-
.../test/css/discouraged_expected_results.json | 184 ++---
.../test/css/discouraged_expected_results.xml | 82 +-
.../test/css/excessive_epub3_expected_results.json | 8 +-
.../test/css/font-face_expected_results.json | 132 +--
.../test/css/font-face_expected_results.xmp | 236 ++++++
.../css/font_encryption_adobe/OEBPS/content.opf | 7 -
.../font_encryption_adobe_expected_results.json | 48 +-
.../css/font_encryption_idpf_expected_results.json | 112 +--
.../css/font_encryption_idpf_expected_results.xml | 2 +-
.../css/font_encryption_idpf_expected_results.xmp | 139 ++++
.../css/font_encryption_unknown/OEBPS/content.opf | 7 -
.../font_encryption_unknown_expected_results.json | 54 +-
.../test/css/keyframe_expected_results.json | 54 +-
.../test/css/multiple_epub2_expected_results.json | 6 +-
.../test/css/multiple_epub3_expected_results.json | 42 +-
.../test/css/transform_expected_results.json | 48 +-
.../test/css/transition_expected_results.json | 52 +-
.../test/opf/Epub2_marked_v3_expected_results.json | 26 +-
.../test/opf/Epub2_marked_v3_expected_results.xml | 10 +-
.../epubcheck/test/opf/Epub3_marked_v2/OPS/toc.ncx | 2 +-
.../test/opf/Epub3_marked_v2_expected_results.json | 63 +-
.../test/opf/Epub3_marked_v2_expected_results.xml | 10 +-
.../opf/Excessive_Spine_Items_epub2/OPS/toc.ncx | 2 +-
...cessive_Spine_Items_epub2_expected_results.json | 66 +-
...cessive_Spine_Items_epub3_expected_results.json | 166 ++--
..._Items_epub3_fixed_format_expected_results.json | 222 ++---
...3_fixed_format_properties_expected_results.json | 218 ++---
.../epubcheck/test/opf/Fallbacks_epub2/OPS/toc.ncx | 2 +-
.../test/opf/Fallbacks_epub2_expected_results.json | 18 +-
.../test/opf/Fallbacks_epub3_expected_results.json | 20 +-
.../opf/Media-type_handler_expected_results.json | 46 +-
.../opf/Mismatched_mimetypes_epub2/OPS/toc.ncx | 2 +-
...ismatched_mimetypes_epub2_expected_results.json | 42 +-
...ismatched_mimetypes_epub3_expected_results.json | 46 +-
.../test/opf/Missing_NAV_epub2/OPS/toc.ncx | 2 +-
.../opf/Missing_NAV_epub2_expected_results.json | 10 +-
.../opf/Missing_NAV_epub3_expected_results.json | 12 +-
.../opf/Missing_NCX_epub2_expected_results.json | 6 +-
.../opf/Missing_NCX_epub3_expected_results.json | 10 +-
.../opf/Missing_Spine_epub2_expected_results.json | 8 +-
.../opf/Missing_Spine_epub3_expected_results.json | 22 +-
.../opf/Missing_Spine_epub3_expected_results.xml | 4 +-
.../Missing_metadata_epub2_expected_results.json | 10 +-
.../Missing_metadata_epub3_expected_results.json | 32 +-
.../opf/Missing_unique_id_expected_results.json | 14 +-
.../test/opf/Properties_expected_results.json | 58 +-
...ublication_Metadata_epub3_expected_results.json | 10 +-
...Publication_Metadata_epub3_expected_results.xml | 2 +-
.../test/opf/oebps12_expected_results.json | 36 +-
.../test/opf/rendition_valid_expected_results.json | 32 +-
.../test/opf/viewport2_expected_results.json | 30 +-
.../test/opf/viewport_expected_results.json | 68 +-
.../package/corrupt_file_expected_results.json | 6 +-
.../package/empty_archive_expected_results.json | 16 +-
.../test/package/empty_dir_expected_results.json | 18 +-
.../package/empty_mimetype_expected_results.json | 18 +-
.../test/package/image_types_expected_results.json | 22 +-
.../interesting_paths_epub2/OPS Content/toc.ncx | 2 +-
.../interesting_paths_epub2_expected_results.json | 34 +-
.../interesting_paths_epub2_expected_results.xml | 2 +-
.../interesting_paths_epub3_expected_results.json | 90 +--
.../interesting_paths_epub3_expected_results.xml | 14 +-
...sing_container_file_epub2_expected_results.json | 12 +-
...sing_container_file_epub3_expected_results.json | 12 +-
.../package/missing_file_expected_results.json | 4 +-
.../missing_mimetype_file_epub2/OPS/toc.ncx | 2 +-
...ssing_mimetype_file_epub2_expected_results.json | 16 +-
...ssing_mimetype_file_epub3_expected_results.json | 14 +-
.../package/missing_ncx_file_expected_results.json | 6 +-
.../missing_opf_epub_file_expected_results.json | 8 +-
.../package/missing_opf_file_expected_results.json | 12 +-
.../package/missing_toc_file_expected_results.json | 12 +-
.../test/package/path_resolution/OPS/toc.ncx | 3 +-
.../package/path_resolution_expected_results.json | 48 +-
.../package/wrong_extension_expected_results.json | 26 +-
.../test/package/wrong_type_expected_results.json | 14 +-
.../scripts/XMLHttpRequest_expected_results.json | 50 +-
.../adobe/epubcheck/test/scripts/epub2/OPS/toc.ncx | 2 +-
.../test/scripts/epub2_expected_results.json | 34 +-
.../test/scripts/epub2_expected_results.xmp | 87 ++
.../test/scripts/eval_expected_results.json | 60 +-
.../test/scripts/properties_expected_results.json | 106 +--
.../test/scripts/storage_expected_results.json | 68 +-
.../test/scripts/unused_expected_results.json | 54 +-
.../test/toc/fragments_expected_results.json | 26 +-
.../test/toc/invalid_ncx_expected_results.json | 58 +-
.../toc/missing_epub_type_expected_results.json | 16 +-
.../xhtml/External_media_expected_results.json | 26 +-
.../test/xhtml/accessibility_expected_results.json | 48 +-
.../com/adobe/epubcheck/test/xhtml/dtd/OPS/toc.ncx | 1 -
.../epubcheck/test/xhtml/dtd_expected_results.json | 102 +--
.../test/xhtml/epubcfi_expected_results.json | 28 +-
.../html5_deprecated_epub3_expected_results.json | 24 +-
.../epubcheck/test/xhtml/html5_epub2/OPS/toc.ncx | 2 +-
.../test/xhtml/html5_epub2_expected_results.json | 24 +-
.../test/xhtml/html5_epub3_expected_results.json | 29 +-
.../test/xhtml/hyperlinks_expected_results.json | 137 ++--
.../test/xhtml/lang_expected_results.json | 38 +-
.../test/xhtml/lorem_noxmlns_expected_results.json | 18 +-
.../xhtml/lorem_pagemaps1_expected_results.json | 40 +-
.../xhtml/lorem_pagemaps2_expected_results.json | 22 +-
.../xhtml/lorem_pagemaps3_expected_results.json | 46 +-
.../xhtml/media_overlays_expected_results.json | 168 ++--
.../test/xhtml/namespaces_expected_results.json | 22 +-
.../test/xhtml/nesting_expected_results.json | 32 +-
.../epubcheck/test/xhtml/singleline/OEBPS/moby.ncx | 2 +-
.../test/xhtml/singleline_expected_results.json | 30 +-
1000 files changed, 27433 insertions(+), 9502 deletions(-)
diff --git a/README.md b/README.md
index df11007..93d026a 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,6 @@
EpubCheck
=========
-*epubcheck 4.0 repository Pre-Release (`master` branch contains current 4.0 development in alpha stage)*
-
EpubCheck is a tool to validate EPUB files. It can detect many
types of errors in EPUB. OCF container structure, OPF and OPS mark-up,
and internal reference consistency are checked. EpubCheck can be run
@@ -13,7 +11,7 @@ as a standalone command-line tool or used as a Java library.
Check the [release page](https://github.com/IDPF/epubcheck/releases) to get the latest distribution.
-[EpubCheck 3.0.1](https://github.com/IDPF/epubcheck/releases/tag/v3.0.1) is the latest recommended version to validate both EPUB 2 and 3 files.
+[EpubCheck 4.0](https://github.com/IDPF/epubcheck/releases/tag/v4.0) is the latest recommended version to validate both EPUB 2 and 3 files.
## Documentation
@@ -49,11 +47,13 @@ Authors and contributors to EpubCheck include:
## License
EpubCheck is made available under the terms of the [New BSD License](http://opensource.org/licenses/BSD-3-Clause)
-
-## Building the 4.0 pre-release
-To build epubcheck from the sources you need Java Development Kit (JDK) 1.6 or above and [Apache Maven](http://maven.apache.org/) 2.3 or above installed.
-On Windows, you should build in a git bash shell (see http://github.com)
+----
+
+## Building EpubCheck
+
+To build epubcheck from the sources you need Java Development Kit (JDK) 1.7 or above and [Apache Maven](http://maven.apache.org/) 2.3 or above installed.
+On Windows, you should build in a git bash shell (see http://github.com help)
You will also need Python to be able to run the BookReporter and related tools.
@@ -63,3 +63,28 @@ Build and run tests:
```
$ mvn install
```
+Will copy `.*jar` files and packages to `target/` folder...
+
+
+## Translating EpubCjeck
+
+EpubCheck 4.0 now comes with *i18n* support. Feel free to translate the Java messsages file to your language and then open a Pull Request here.
+
+Translations so far:
+* `en` - English
+* `ja` - Japanese
+* `de` - German (Tobias Fischer, PR #462)
+* `es` - Spanish (Emiliano Molina, PR #470, #482)
+* `fr` - French (Vincent Gros, PR #472)
+* `it` - Italian (Alberto Pettarin, PR #496)
+
+To translate, simply copy the original (english) message file (`MessageBundle.properties` or `messages.properties`) located in
+* [src/main/resources/com/adobe/epubcheck/messages/](src/main/resources/com/adobe/epubcheck/messages/)
+* [src/main/resources/com/adobe/epubcheck/util](src/main/resources/com/adobe/epubcheck/util)
+* [src/main/resources/com/thaiopensource/datatype/xsd/resources](src/main/resources/com/thaiopensource/datatype/xsd/resources)
+* [src/main/resources/com/thaiopensource/relaxng/pattern/resources](src/main/resources/com/thaiopensource/relaxng/pattern/resources)
+* [src/main/resources/org/idpf/epubcheck/util/css](src/main/resources/org/idpf/epubcheck/util/css)
+
+to `MessageBundle_XX.properties` or `messages_XX.properties` in its respective folder and start translating.
+
+Send us a PullRequest when you finished translation and think it's ready to merge...
diff --git a/pom.xml b/pom.xml
index 2897e92..831fa34 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
<groupId>org.idpf</groupId>
<artifactId>epubcheck</artifactId>
- <version>4.0.0-alpha11</version>
+ <version>4.0.0</version>
<packaging>jar</packaging>
@@ -140,7 +140,7 @@
<connection>scm:git:ssh://git@github.com:IDPF/epubcheck.git</connection>
<developerConnection>scm:git:ssh://git@github.com:IDPF/epubcheckgit</developerConnection>
<url>https://github.com/IDPF/epubcheck</url>
- <tag>v4.0.0-alpha11</tag>
+ <tag>v4.0.0</tag>
</scm>
<issueManagement>
<system>Github</system>
@@ -200,6 +200,11 @@
<version>14.0.1</version>
</dependency>
<dependency>
+ <groupId>com.twelvemonkeys.imageio</groupId>
+ <artifactId>imageio-jpeg</artifactId>
+ <version>3.1.2</version>
+ </dependency>
+ <dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.12</version>
@@ -215,11 +220,6 @@
<version>1.3</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.javatuples</groupId>
- <artifactId>javatuples</artifactId>
- <version>1.2</version>
- </dependency>
</dependencies>
<build>
@@ -288,7 +288,7 @@
</executions>
<configuration>
<instructions>
- <_removeheaders>Include-Resource,Private-Package</_removeheaders>
+ <_removeheaders>Include-Resource,Private-Package, Bnd-LastModified, Build-Jdk, Built-By</_removeheaders>
</instructions>
</configuration>
</plugin>
@@ -387,6 +387,9 @@
<configuration>
<includedScopes>runtime,compile</includedScopes>
<fileTemplate>src/main/licenses/third-party.ftl</fileTemplate>
+ <useMissingFile>true</useMissingFile>
+ <missingFile>src/main/licenses/third-party.properties</missingFile>
+ <deployMissingFile>false</deployMissingFile>
</configuration>
</execution>
</executions>
@@ -411,12 +414,6 @@
<manifestEntries>
<project-url>${project.url}</project-url>
<scm-location>${project.scm.developerConnection}</scm-location>
- <build-user>${env.USER}</build-user>
- <build-user-name>${user.name}</build-user-name>
- <build-user-dir>${user.dir}</build-user-dir>
- <build-user-home>${user.home}</build-user-home>
- <build-os-name>${os.name}</build-os-name>
- <build-os-version>${os.version}</build-os-version>
</manifestEntries>
</archive>
</configuration>
@@ -450,6 +447,8 @@
<goal>single</goal>
</goals>
<configuration>
+ <attach>false</attach>
+ <appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/main/assembly/dist.xml</descriptor>
</descriptors>
@@ -462,6 +461,7 @@
<goal>single</goal>
</goals>
<configuration>
+ <attach>false</attach>
<descriptors>
<descriptor>src/main/assembly/src.xml</descriptor>
</descriptors>
diff --git a/src/main/assembly/dist.xml b/src/main/assembly/dist.xml
index a5f70db..86a3f8e 100644
--- a/src/main/assembly/dist.xml
+++ b/src/main/assembly/dist.xml
@@ -29,22 +29,22 @@
<include>*.txt</include>
</includes>
</fileSet>
- <fileSet>
+ <!--<fileSet>
<outputDirectory>docs</outputDirectory>
<directory>docs</directory>
<includes>
<include>*.docx</include>
<include>*.pdf</include>
</includes>
- </fileSet>
- <fileSet>
+ </fileSet>-->
+ <!--<fileSet>
<outputDirectory></outputDirectory>
<directory>target</directory>
<includes>
<include>*.py</include>
<include>*.pdf</include>
</includes>
- </fileSet>
+ </fileSet>-->
</fileSets>
<dependencySets>
<dependencySet>
diff --git a/src/main/assembly/src.xml b/src/main/assembly/src.xml
index 0314dfb..1771146 100644
--- a/src/main/assembly/src.xml
+++ b/src/main/assembly/src.xml
@@ -14,7 +14,6 @@
<include>pom.xml</include>
<include>src/**/*</include>
<include>docs/**/*</include>
- <include>node_server/**/*</include>
</includes>
</fileSet>
</fileSets>
diff --git a/src/main/java/com/adobe/epubcheck/api/EPUBLocation.java b/src/main/java/com/adobe/epubcheck/api/EPUBLocation.java
new file mode 100644
index 0000000..1d10133
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/api/EPUBLocation.java
@@ -0,0 +1,135 @@
+package com.adobe.epubcheck.api;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.map.annotate.JsonSerialize;
+
+import com.adobe.epubcheck.util.JsonWriter;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+
+public final class EPUBLocation implements Comparable<EPUBLocation>
+{
+
+ public static EPUBLocation create(String fileName)
+ {
+ return new EPUBLocation(fileName, -1, -1, null);
+ }
+
+ public static EPUBLocation create(String fileName, String context)
+ {
+ return new EPUBLocation(fileName, -1, -1, context);
+ }
+
+ public static EPUBLocation create(String fileName, int lineNumber, int column)
+ {
+ return new EPUBLocation(fileName, lineNumber, column, null);
+ }
+
+ public static EPUBLocation create(String fileName, int lineNumber, int column, String context)
+ {
+ return new EPUBLocation(fileName, lineNumber, column, context);
+ }
+
+ @JsonProperty
+ private final String path;
+ @JsonProperty
+ private final int line;
+ @JsonProperty
+ private final int column;
+ @JsonProperty
+ @JsonSerialize(using = JsonWriter.OptionalJsonSerializer.class)
+ private final Optional<String> context;
+
+ private EPUBLocation(String path, int lineNumber, int column, String context)
+ {
+ Preconditions.checkNotNull(path);
+ this.path = path;
+ this.line = lineNumber;
+ this.column = column;
+ this.context = Optional.fromNullable(context);
+ }
+
+ public String getPath()
+ {
+ return this.path;
+ }
+
+ public int getLine()
+ {
+ return this.line;
+ }
+
+ public int getColumn()
+ {
+ return this.column;
+ }
+
+ public Optional<String> getContext()
+ {
+ return this.context;
+ }
+
+
+
+ @Override
+ public String toString()
+ {
+ return path + "[" + line + "," + column + "]";
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj == null || obj.getClass() != this.getClass())
+ {
+ return false;
+ }
+
+ EPUBLocation other = (EPUBLocation) obj;
+ return !(this.getContext() == null && other.getContext() != null)
+ && this.getPath().equals(other.getPath()) && this.getLine() == other.getLine()
+ && this.getColumn() == other.getColumn()
+ && (this.getContext() == null || this.getContext().equals(other.getContext()));
+ }
+
+ int safeCompare(String a, String b)
+ {
+ if (a == null && b != null) return -1;
+ if (a != null && b == null) return 1;
+ if (a == null /* && b == null */) return 0;
+ return a.compareTo(b);
+ }
+
+ @Override
+ public int compareTo(EPUBLocation o)
+ {
+ int comp = safeCompare(this.path, o.path);
+ if (comp != 0)
+ {
+ return comp;
+ }
+
+ comp = line - o.line;
+ if (comp != 0)
+ {
+ return comp < 0 ? -1 : 1;
+ }
+
+ comp = column - o.column;
+ if (comp != 0)
+ {
+ return comp < 0 ? -1 : 1;
+ }
+ comp = safeCompare(context.orNull(), o.context.orNull());
+ if (comp != 0)
+ {
+ return comp;
+ }
+
+ return 0;
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/api/EPUBProfile.java b/src/main/java/com/adobe/epubcheck/api/EPUBProfile.java
new file mode 100644
index 0000000..6b82f9c
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/api/EPUBProfile.java
@@ -0,0 +1,74 @@
+package com.adobe.epubcheck.api;
+
+import java.util.Set;
+
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.OPFData;
+import com.google.common.collect.ImmutableSet;
+
+public enum EPUBProfile
+{
+ DEFAULT,
+ IDX,
+ DICT,
+ EDUPUB,
+ PREVIEW;
+
+ /**
+ * Checks a given validation profile against the dc:type(s) declared in an OPF
+ * and returns a possibly overriden profile.
+ * <p>
+ * For instance, if the publication has a 'edupub' dc:type and the DEFAULT
+ * validation profile is given, the EDUPUB profile will be returned instead.
+ * </p>
+ * <p>
+ * If the given validation profile is modified, report an INFO message
+ * OPF_064.
+ * </p>
+ *
+ * @param profile
+ * a validation profile.
+ * @param opfData
+ * the parsed OPF data (contains the publication's dc:type(s)).
+ * @param path
+ * the path to use for reporting messages.
+ * @param report
+ * the message report.
+ * @return The given profile if it's compatible with the OPF dc:type(s), or
+ * else a compatible non-null validation profile.
+ */
+ public static EPUBProfile makeOPFCompatible(EPUBProfile profile, OPFData opfData, String path,
+ Report report)
+ {
+
+ Set<String> pubTypes = opfData != null ? opfData.getTypes() : ImmutableSet.<String> of();
+ if (pubTypes.contains(OPFData.DC_TYPE_DICT) && profile != EPUBProfile.DICT)
+ {
+ report.message(MessageId.OPF_064, EPUBLocation.create(path), OPFData.DC_TYPE_DICT,
+ EPUBProfile.DICT);
+ return EPUBProfile.DICT;
+ }
+ else if (pubTypes.contains(OPFData.DC_TYPE_EDUPUB) && profile != EPUBProfile.EDUPUB)
+ {
+ report.message(MessageId.OPF_064, EPUBLocation.create(path), OPFData.DC_TYPE_EDUPUB,
+ EPUBProfile.EDUPUB);
+ return EPUBProfile.EDUPUB;
+ }
+ else if (pubTypes.contains(OPFData.DC_TYPE_INDEX) && profile != EPUBProfile.IDX)
+ {
+ report.message(MessageId.OPF_064, EPUBLocation.create(path), OPFData.DC_TYPE_INDEX,
+ EPUBProfile.IDX);
+ return EPUBProfile.IDX;
+ }
+ else if (pubTypes.contains(OPFData.DC_TYPE_PREVIEW) && profile != EPUBProfile.PREVIEW)
+ {
+ report.message(MessageId.OPF_064, EPUBLocation.create(path), OPFData.DC_TYPE_PREVIEW,
+ EPUBProfile.PREVIEW);
+ return EPUBProfile.PREVIEW;
+ }
+ else
+ {
+ return profile != null ? profile : EPUBProfile.DEFAULT;
+ }
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/api/EpubCheck.java b/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
index 8b1bfa9..398517b 100644
--- a/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
+++ b/src/main/java/com/adobe/epubcheck/api/EpubCheck.java
@@ -21,32 +21,38 @@
*/
package com.adobe.epubcheck.api;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.Properties;
+import java.util.zip.ZipFile;
+
import com.adobe.epubcheck.ctc.CheckManager;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFChecker;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.ocf.OCFZipPackage;
import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.CheckUtil;
import com.adobe.epubcheck.util.DefaultReportImpl;
import com.adobe.epubcheck.util.ResourceUtil;
import com.adobe.epubcheck.util.WriterReportImpl;
-import java.io.*;
-import java.util.Properties;
-import java.util.Set;
-import java.util.zip.ZipFile;
-
/**
* Public interface to epub validator.
*/
public class EpubCheck implements DocumentValidator
{
private static String VERSION = null;
- private static String BUILD_DATE = null;
- private File epubFile;
- private Report report;
+ private static String BUILD_DATE = null;
+ final private File epubFile;
+ final private EPUBProfile profile;
+ final private Report report;
public static String version()
{
@@ -57,69 +63,79 @@ public class EpubCheck implements DocumentValidator
try
{
prop.load(in);
- }
- catch (Exception e)
+ } catch (Exception e)
{
- System.err.println("Couldn't read project properties: " + e.getMessage());
- }
- finally
+ System.err.println("Couldn't read project properties: " + e.getMessage());
+ } finally
{
if (in != null)
{
try
{
in.close();
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
}
VERSION = prop.getProperty("version");
- BUILD_DATE = prop.getProperty("buildDate");
+ BUILD_DATE = prop.getProperty("buildDate");
}
return VERSION;
}
- public static String buildDate()
+
+ public static String buildDate()
{
- return BUILD_DATE;
- }
+ return BUILD_DATE;
+ }
- /*
- * Create an epub validator to validate the given file. Issues will be
- * reported to standard error.
- */
+ /**
+ * Create an epub validator to validate the given file. Issues will be
+ * reported to standard error.
+ */
public EpubCheck(File epubFile)
{
this(epubFile, new DefaultReportImpl(epubFile.getName()));
}
- /*
- * Create an epub validator to validate the given file. Issues will be
- * reported to the given PrintWriter.
- */
+ /**
+ * Create an epub validator to validate the given file. Issues will be
+ * reported to the given PrintWriter.
+ */
public EpubCheck(File epubFile, PrintWriter out)
{
this(epubFile, new WriterReportImpl(out));
}
- /*
- * Create an epub validator to validate the given file and report issues to
- * a given Report object.
- */
+ /**
+ * Create an epub validator to validate the given file and report issues to a
+ * given Report object.
+ */
public EpubCheck(File epubFile, Report report)
{
- this.epubFile = epubFile;
- setReport(report);
+ this(epubFile, report, null);
}
- private void setReport(Report report)
+ /**
+ * Create an epub validator to validate the given file and report issues to a
+ * given Report object. Can validate a specific EPUB profile (e.g. EDUPUB,
+ * DICT, IDX, etc).
+ *
+ */
+ public EpubCheck(File epubFile, Report report, EPUBProfile profile)
{
+ this.epubFile = epubFile;
this.report = report;
+ this.profile = profile == null ? EPUBProfile.DEFAULT : profile;
}
public EpubCheck(InputStream inputStream, Report report, String uri)
{
+ this(inputStream, report, uri, EPUBProfile.DEFAULT);
+ }
+
+ public EpubCheck(InputStream inputStream, Report report, String uri, EPUBProfile profile)
+ {
File epubFile;
OutputStream out = null;
try
@@ -136,21 +152,19 @@ public class EpubCheck implements DocumentValidator
}
this.epubFile = epubFile;
- setReport(report);
- }
- catch (IOException e)
+ this.profile = profile == null ? EPUBProfile.DEFAULT : profile;
+ this.report = report;
+ } catch (IOException e)
{
throw new RuntimeException(e);
- }
- finally
+ } finally
{
if (inputStream != null)
{
try
{
inputStream.close();
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
@@ -160,8 +174,7 @@ public class EpubCheck implements DocumentValidator
{
out.flush();
out.close();
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
@@ -169,12 +182,12 @@ public class EpubCheck implements DocumentValidator
}
/**
- * Validate the file. Return true if no errors or warnings found.
- */
+ * Validate the file. Return true if no errors or warnings found.
+ */
public boolean validate()
{
int validateResult = doValidate();
- return validateResult > 0;
+ return validateResult == 0;
}
public int doValidate()
@@ -183,14 +196,12 @@ public class EpubCheck implements DocumentValidator
FileInputStream epubIn = null;
try
{
- MasterReport.resetLocalMessageIds();
-
String extension = ResourceUtil.getExtension(epubFile.getName());
checkExtension(extension);
if (!epubFile.exists())
{
- report.message(MessageId.PKG_018, new MessageLocation(epubFile.getName(), -1, -1));
+ report.message(MessageId.PKG_018, EPUBLocation.create(epubFile.getName()));
return 2;
}
@@ -198,22 +209,19 @@ public class EpubCheck implements DocumentValidator
checkEpubHeader(epubIn);
zip = new ZipFile(epubFile);
- /***Here are called custom checks (CTC Package)**/
- CheckManager c = new CheckManager(zip, report);
- c.checkPackage();
-
OCFPackage ocf = new OCFZipPackage(zip);
- OCFChecker checker = new OCFChecker(ocf, report, null);
+ OCFChecker checker = new OCFChecker(new ValidationContextBuilder().ocf(ocf).report(report)
+ .profile(profile).build());
checker.runChecks();
- CheckMultiplePaginationSchemes();
-
- }
- catch (IOException e)
+ /*** Here are called custom checks (CTC Package) **/
+ CheckManager c = new CheckManager(zip, report);
+ c.checkPackage();
+ } catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(epubFile.getName(), 0, 0, ""), e.getMessage());
- }
- finally
+ report.message(MessageId.PKG_008, EPUBLocation.create(epubFile.getName(), ""),
+ e.getMessage());
+ } finally
{
try
{
@@ -225,35 +233,18 @@ public class EpubCheck implements DocumentValidator
{
zip.close();
}
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
int returnValue = 0;
- if (report.getFatalErrorCount() != 0)
- returnValue |= 4;
- if (report.getErrorCount() != 0)
- returnValue |= 2;
- if (report.getWarningCount() != 0)
- returnValue |= 1;
+ if (report.getFatalErrorCount() != 0) returnValue |= 4;
+ if (report.getErrorCount() != 0) returnValue |= 2;
+ if (report.getWarningCount() != 0) returnValue |= 1;
return returnValue;
}
- public void CheckMultiplePaginationSchemes()
- {
- Set<MessageId> reported = MasterReport.localReportedMessageIds;
- if (reported.contains(MessageId.NAV_002) && reported.contains(MessageId.HTM_050))
- {
- report.message(MessageId.NAV_003, new MessageLocation(epubFile.getName(), -1, -1));
- }
- if (reported.contains(MessageId.NCX_005) && reported.contains(MessageId.OPF_062))
- {
- report.message(MessageId.NCX_006, new MessageLocation(epubFile.getName(), -1, -1));
- }
- }
-
void checkExtension(String extension)
{
if (extension != null)
@@ -262,17 +253,18 @@ public class EpubCheck implements DocumentValidator
{
if (extension.matches("[Ee][Pp][Uu][Bb]"))
{
- report.message(MessageId.PKG_016, new MessageLocation(epubFile.getName(), -1, -1));
+ report.message(MessageId.PKG_016, EPUBLocation.create(epubFile.getName()));
}
else
{
- report.message(MessageId.PKG_017, new MessageLocation(epubFile.getName(), -1, -1, extension));
+ report.message(MessageId.PKG_017, EPUBLocation.create(epubFile.getName(), extension));
}
}
}
}
- void checkEpubHeader(FileInputStream epubIn) throws IOException
+ void checkEpubHeader(FileInputStream epubIn)
+ throws IOException
{
byte[] header = new byte[58];
@@ -293,7 +285,7 @@ public class EpubCheck implements DocumentValidator
if (readCount != header.length)
{
- report.message(MessageId.PKG_003, new MessageLocation(epubFile.getName(), 0, 0, ""));
+ report.message(MessageId.PKG_003, EPUBLocation.create(epubFile.getName(), ""));
}
else
{
@@ -302,24 +294,19 @@ public class EpubCheck implements DocumentValidator
if (header[0] != 'P' && header[1] != 'K')
{
- report.message(MessageId.PKG_004, new MessageLocation(epubFile.getName(), 0, 0));
+ report.message(MessageId.PKG_004, EPUBLocation.create(epubFile.getName()));
}
else if (fnsize != 8)
{
- report.message(MessageId.PKG_006, new MessageLocation(epubFile.getName(), 0, 0));
+ report.message(MessageId.PKG_006, EPUBLocation.create(epubFile.getName()));
}
else if (extsize != 0)
{
- report.message(MessageId.PKG_005, new MessageLocation(epubFile.getName(), 0, 0), extsize);
+ report.message(MessageId.PKG_005, EPUBLocation.create(epubFile.getName()), extsize);
}
else if (!CheckUtil.checkString(header, 30, "mimetype"))
{
- report.message(MessageId.PKG_006, new MessageLocation(epubFile.getName(), 0, 0));
- }
- else if (!CheckUtil.checkString(header, 38,
- "application/epub+zip"))
- {
- report.message(MessageId.PKG_007, new MessageLocation(epubFile.getName(), 0, 0));
+ report.message(MessageId.PKG_006, EPUBLocation.create(epubFile.getName()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java b/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
index ae21cc7..eea752b 100644
--- a/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
+++ b/src/main/java/com/adobe/epubcheck/api/EpubCheckFactory.java
@@ -22,14 +22,13 @@
package com.adobe.epubcheck.api;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
-
import java.io.File;
import java.io.IOException;
+import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.DocumentValidatorFactory;
+import com.adobe.epubcheck.opf.ValidationContext;
+
public class EpubCheckFactory implements DocumentValidatorFactory
{
static private final EpubCheckFactory instance = new EpubCheckFactory();
@@ -39,26 +38,22 @@ public class EpubCheckFactory implements DocumentValidatorFactory
return instance;
}
- public DocumentValidator newInstance(Report report,
- String path,
- GenericResourceProvider resourceProvider,
- String mimeType,
- EPUBVersion version)
+ public DocumentValidator newInstance(ValidationContext context)
{
- if (path.startsWith("http://") || path.startsWith("https://"))
+ if (context.path.startsWith("http://") || context.path.startsWith("https://"))
{
try
{
- return new EpubCheck(resourceProvider.getInputStream(path), report, path);
- }
- catch (IOException e)
+ return new EpubCheck(context.resourceProvider.getInputStream(context.path), context.report,
+ context.path, context.profile);
+ } catch (IOException e)
{
throw new RuntimeException(e);
}
}
else
{
- return new EpubCheck(new File(path), report);
+ return new EpubCheck(new File(context.path), context.report, context.profile);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/api/FeatureReport.java b/src/main/java/com/adobe/epubcheck/api/FeatureReport.java
new file mode 100644
index 0000000..52b99d8
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/api/FeatureReport.java
@@ -0,0 +1,134 @@
+package com.adobe.epubcheck.api;
+
+import java.util.Set;
+
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.LinkedHashMultimap;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+
+/**
+ * A feature report holds a list of noteworthy EPUB features. Features are
+ * typically reported by handlers at parsing time. The report can be looked-up
+ * after the parsing phase to enable checks that depend on conditions spanning
+ * over multiple documents.
+ *
+ */
+public final class FeatureReport
+{
+
+ private final SetMultimap<FeatureEnum, Feature> features = Multimaps
+ .synchronizedSetMultimap(LinkedHashMultimap.<FeatureEnum, Feature> create());
+
+ /**
+ * Add a new feature to this report.
+ *
+ * @param name
+ * The name of the feature (must not be null)
+ * @param path
+ * The location of the feature (can be null)
+ */
+ public void report(FeatureEnum name, EPUBLocation location)
+ {
+ features.put(name, new Feature(name, location, null));
+ }
+
+ /**
+ * Add a new feature to this report.
+ *
+ * @param name
+ * The name of the feature (must not be null)
+ * @param path
+ * The location of the feature (can be null)
+ * @param value
+ * The value of the feature (can be null)
+ */
+ public void report(FeatureEnum name, EPUBLocation location, String value)
+ {
+ features.put(name, new Feature(name, location, value));
+ }
+
+ /**
+ * Returns <code>true</code> iff this reports contains data for a feature
+ * name.
+ *
+ * @param feature
+ * the feature name to look-up
+ * @return <code>true</code> iff this reports contains data for a feature
+ * name.
+ */
+ public boolean hasFeature(FeatureEnum feature)
+ {
+ return features.containsKey(feature);
+ }
+
+ /**
+ * Returns the set of {@link Feature} stored in this report for the given
+ * feature name.
+ *
+ * @param feature
+ * the feature name to look-up
+ * @return the (possibly empty) set of {@link Feature} stored in this report
+ * for the given feature name.
+ */
+ public Set<Feature> getFeature(FeatureEnum feature)
+ {
+ return ImmutableSet.copyOf(features.get(feature));
+ }
+
+ /**
+ * A noteworthy feature in an EPUB Rendition (e.g. presence of page breaks,
+ * encryption, subject, etc.)
+ */
+ public static final class Feature
+ {
+ private FeatureEnum name;
+ private Optional<EPUBLocation> location;
+ private Optional<String> value;
+
+ private Feature(FeatureEnum name, EPUBLocation location, String value)
+ {
+ Preconditions.checkNotNull(name);
+ Preconditions.checkNotNull(location);
+ this.name = name;
+ this.location = Optional.fromNullable(location);
+ this.value = Optional.fromNullable(Strings.emptyToNull(value));
+ }
+
+ /**
+ * The name of the feature
+ *
+ * @return the name of the feature
+ */
+ public FeatureEnum getName()
+ {
+ return name;
+ }
+
+ /**
+ * The location of the feature.
+ *
+ * @return the path to the document containing the feature (can be absent).
+ */
+ public Optional<EPUBLocation> getLocation()
+ {
+ return location;
+ }
+
+ /**
+ * The value of the feature, when relevant (can be absent).
+ *
+ * @return the value of the feature if it has one, or
+ * {@link Optional#absent()}.
+ */
+ public Optional<String> getValue()
+ {
+ return value;
+ }
+
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/api/MasterReport.java b/src/main/java/com/adobe/epubcheck/api/MasterReport.java
index aaa01cc..cff58bb 100644
--- a/src/main/java/com/adobe/epubcheck/api/MasterReport.java
+++ b/src/main/java/com/adobe/epubcheck/api/MasterReport.java
@@ -1,20 +1,23 @@
package com.adobe.epubcheck.api;
-import com.adobe.epubcheck.messages.*;
-import com.adobe.epubcheck.util.ReportingLevel;
-import org.codehaus.jackson.annotate.JsonProperty;
-
import java.io.File;
import java.util.HashSet;
import java.util.Set;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import com.adobe.epubcheck.messages.Message;
+import com.adobe.epubcheck.messages.MessageDictionary;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.messages.Severity;
+import com.adobe.epubcheck.util.ReportingLevel;
+
/**
* Reports are derived from this so that we can test for message Id coverage as well as have a centralized location for
* severity reporting level testing.
*/
public abstract class MasterReport implements Report
{
- public static Set<MessageId> localReportedMessageIds = new HashSet<MessageId>();
public static Set<MessageId> allReportedMessageIds = new HashSet<MessageId>();
int errorCount, warningCount, fatalErrorCount, usageCount = 0;
int reportingLevel = ReportingLevel.Info;
@@ -40,19 +43,13 @@ public abstract class MasterReport implements Report
@JsonProperty
String customMessageFileName = null;
- public static void resetLocalMessageIds()
- {
- localReportedMessageIds.clear();
- }
-
private void reportMessageId(MessageId id)
{
allReportedMessageIds.add(id);
- localReportedMessageIds.add(id);
}
@Override
- public void message(MessageId id, MessageLocation location, Object... args)
+ public void message(MessageId id, EPUBLocation location, Object... args)
{
Message message = getDictionary().getMessage(id);
assert (message != null);
@@ -79,7 +76,7 @@ public abstract class MasterReport implements Report
}
reportMessageId(id);
}
-
+
@Override
public void setCustomMessageFile(String customMessageFileName)
{
diff --git a/src/main/java/com/adobe/epubcheck/api/QuietReport.java b/src/main/java/com/adobe/epubcheck/api/QuietReport.java
index ed20d99..1ba16c7 100644
--- a/src/main/java/com/adobe/epubcheck/api/QuietReport.java
+++ b/src/main/java/com/adobe/epubcheck/api/QuietReport.java
@@ -1,7 +1,6 @@
package com.adobe.epubcheck.api;
import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.FeatureEnum;
public final class QuietReport extends MasterReport
@@ -15,7 +14,7 @@ public final class QuietReport extends MasterReport
}
@Override
- public void message(Message message, MessageLocation location, Object... args)
+ public void message(Message message, EPUBLocation location, Object... args)
{
}
diff --git a/src/main/java/com/adobe/epubcheck/api/Report.java b/src/main/java/com/adobe/epubcheck/api/Report.java
index cbbe5c2..42e9e7c 100755
--- a/src/main/java/com/adobe/epubcheck/api/Report.java
+++ b/src/main/java/com/adobe/epubcheck/api/Report.java
@@ -25,7 +25,6 @@ package com.adobe.epubcheck.api;
import com.adobe.epubcheck.messages.Message;
import com.adobe.epubcheck.messages.MessageDictionary;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.FeatureEnum;
import java.io.File;
@@ -43,7 +42,7 @@ public interface Report
* @param args Arguments referenced by the format
* string for the message.
*/
- public void message(MessageId id, MessageLocation location, Object... args);
+ public void message(MessageId id, EPUBLocation location, Object... args);
/**
* Called when a violation of the standard is found in epub.
@@ -53,7 +52,7 @@ public interface Report
* @param args Arguments referenced by the format
* string for the message.
*/
- void message(Message message, MessageLocation location, Object... args);
+ void message(Message message, EPUBLocation location, Object... args);
/**
* Called when when a feature is found in epub.
diff --git a/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java b/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
index 1cda10a..56432a9 100755
--- a/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
+++ b/src/main/java/com/adobe/epubcheck/bitmap/BitmapChecker.java
@@ -33,9 +33,9 @@ import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.ocf.OCFZipPackage;
import com.adobe.epubcheck.opf.ContentChecker;
@@ -77,7 +77,7 @@ public class BitmapChecker implements ContentChecker
}
if (!passed)
{
- report.message(MessageId.OPF_029, new MessageLocation(this.ocf.getName(), 0, 0), path, mimeType);
+ report.message(MessageId.OPF_029, EPUBLocation.create(this.ocf.getName()), path, mimeType);
}
}
@@ -136,7 +136,7 @@ public class BitmapChecker implements ContentChecker
try {
BufferedImage image = ImageIO.read(tempFile);
if (image == null) {
- report.message(MessageId.PKG_021, new MessageLocation(imgFileName, -1, -1, imgFileName));
+ report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
return null;
} else {
@@ -147,19 +147,19 @@ public class BitmapChecker implements ContentChecker
}
catch (IOException e)
{
- report.message(MessageId.PKG_021, new MessageLocation(imgFileName, -1, -1, imgFileName));
+ report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
return null;
}
catch (IllegalArgumentException argex)
{
- report.message(MessageId.PKG_021, new MessageLocation(imgFileName, -1, -1, imgFileName));
+ report.message(MessageId.PKG_021, EPUBLocation.create(imgFileName));
return null;
}
} else if (formatFromSuffix != null) {
// file format and file extension differs
- report.message(MessageId.PKG_022, new MessageLocation(imgFileName, -1, -1, imgFileName), formatFromInputStream, suffix);
+ report.message(MessageId.PKG_022, EPUBLocation.create(imgFileName), formatFromInputStream, suffix);
return null;
} else {
@@ -250,17 +250,20 @@ public class BitmapChecker implements ContentChecker
{
if (h.height >= HEIGHT_MAX || h.width >= WIDTH_MAX)
{
- report.message(MessageId.OPF_051, new MessageLocation(imageFileName, -1, -1, imageFileName));
+ report.message(MessageId.OPF_051, EPUBLocation.create(imageFileName));
}
if (h.length >= IMAGESIZE_MAX)
{
- report.message(MessageId.OPF_057, new MessageLocation(imageFileName, -1, -1, imageFileName));
+ report.message(MessageId.OPF_057, EPUBLocation.create(imageFileName));
}
}
}
catch (IOException ex)
{
- report.message(MessageId.PKG_021, new MessageLocation(imageFileName, -1, -1, imageFileName) );
+ report.message(MessageId.PKG_021, EPUBLocation.create(imageFileName) );
+ } catch (LinkageError error)
+ {
+ report.message(MessageId.RSC_022, EPUBLocation.create(imageFileName));
}
}
@@ -268,11 +271,11 @@ public class BitmapChecker implements ContentChecker
{
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(this.ocf.getName()), path);
}
else
{
@@ -282,13 +285,13 @@ public class BitmapChecker implements ContentChecker
in = ocf.getInputStream(path);
if (in == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
}
byte[] header = new byte[4];
int rd = CheckUtil.readBytes(in, header, 0, 4);
if (rd < 4)
{
- report.message(MessageId.MED_004, new MessageLocation(path, 0, 0));
+ report.message(MessageId.MED_004, EPUBLocation.create(path));
}
else
{
@@ -298,7 +301,7 @@ public class BitmapChecker implements ContentChecker
}
catch (IOException e)
{
- report.message(MessageId.PKG_021, new MessageLocation(path, 0, 0, path));
+ report.message(MessageId.PKG_021, EPUBLocation.create(path, path));
}
finally
{
diff --git a/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java b/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java
index 207011b..8eb962e 100755
--- a/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/bitmap/BitmapCheckerFactory.java
@@ -22,24 +22,16 @@
package com.adobe.epubcheck.bitmap;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.opf.ValidationContext;
public class BitmapCheckerFactory implements ContentCheckerFactory
{
static private final BitmapCheckerFactory instance = new BitmapCheckerFactory();
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public BitmapChecker newInstance(ValidationContext context)
{
- return new BitmapChecker(ocf, report, path, mimeType);
+ return new BitmapChecker(context.ocf.get(), context.report, context.path, context.mimeType);
}
static public BitmapCheckerFactory getInstance()
diff --git a/src/main/java/com/adobe/epubcheck/css/CSSChecker.java b/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
index 2005072..5b5ab1c 100644
--- a/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
+++ b/src/main/java/com/adobe/epubcheck/css/CSSChecker.java
@@ -22,69 +22,65 @@
package com.adobe.epubcheck.css;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+
import org.idpf.epubcheck.util.css.CssExceptions;
import org.idpf.epubcheck.util.css.CssParser;
import org.idpf.epubcheck.util.css.CssSource;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
public class CSSChecker implements ContentChecker
{
- private final OCFPackage ocf;
+ private final ValidationContext context;
private final Report report;
- private final String path; //css file path when Mode.FILE, host path when Mode.STRING
- private final XRefChecker xrefChecker;
- private final EPUBVersion version;
+ private final String path; // css file path when Mode.FILE, host path when
+ // Mode.STRING
private final Mode mode;
- //Below only used when checking css strings
- private String value; //css string
- private int line; //where css string occurs in host
- private boolean isStyleAttribute;
+ // Below only used when checking css strings
+ private final String value; // css string
+ private int line; // where css string occurs in host
+ private final boolean isStyleAttribute;
private enum Mode
{
- FILE, STRING
+ FILE,
+ STRING
}
/**
* Constructor for CSS files.
*/
- public CSSChecker(OCFPackage ocf, Report report, String path,
- XRefChecker xrefChecker, EPUBVersion version)
+ public CSSChecker(ValidationContext context)
{
- this.ocf = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.version = version;
- this.mode = Mode.FILE;
+ this(context, Mode.FILE, null, -1, false);
+ }
+
+ public CSSChecker(ValidationContext context, String value, int line, boolean isStyleAttribute)
+ {
+ this(context, Mode.STRING, value, line, isStyleAttribute);
}
/**
* Constructor for CSS strings (html style attributes and elements) .
*/
- public CSSChecker(OCFPackage ocf, Report report, String value, boolean isStyleAttribute, String path, int line,
- XRefChecker xrefChecker, EPUBVersion version)
+ private CSSChecker(ValidationContext context, Mode mode, String value, int line,
+ boolean isStyleAttribute)
{
- this.ocf = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.version = version;
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
+ this.mode = mode;
this.value = value;
this.line = line;
this.isStyleAttribute = isStyleAttribute;
- this.mode = Mode.STRING;
}
public void runChecks()
@@ -93,13 +89,15 @@ public class CSSChecker implements ContentChecker
try
{
- if (this.mode == Mode.FILE && !ocf.hasEntry(path))
+ if (this.mode == Mode.FILE && !context.ocf.get().hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()),
+ path);
return;
}
- CSSHandler handler = new CSSHandler(path, xrefChecker, report, version);
+ CSSHandler handler = new CSSHandler(path, context.xrefChecker.orNull(), report,
+ context.version);
if (this.mode == Mode.STRING && this.line > -1)
{
handler.setStartingLineNumber(this.line);
@@ -109,12 +107,10 @@ public class CSSChecker implements ContentChecker
parseItem(source, handler);
handler.setStartingLineNumber(-1);
this.line = -1;
- }
- catch (Exception e)
+ } catch (Exception e)
{
- report.message(MessageId.PKG_008, new MessageLocation(path, -1, -1), e.getMessage());
- }
- finally
+ report.message(MessageId.PKG_008, EPUBLocation.create(path), e.getMessage());
+ } finally
{
if (source != null)
{
@@ -125,8 +121,7 @@ public class CSSChecker implements ContentChecker
{
iStream.close();
}
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
// eat it
}
@@ -134,20 +129,20 @@ public class CSSChecker implements ContentChecker
}
}
- CssSource getCssSource() throws
- IOException
+ CssSource getCssSource()
+ throws IOException
{
CssSource source = null;
if (this.mode == Mode.FILE)
{
- source = new CssSource(this.path, ocf.getInputStream(this.path));
+ source = new CssSource(this.path, context.resourceProvider.getInputStream(this.path));
String charset;
if (source.getInputStream().getBomCharset().isPresent())
{
charset = source.getInputStream().getBomCharset().get().toLowerCase();
if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
{
- report.message(MessageId.CSS_004, new MessageLocation(path, -1, -1, ""), charset);
+ report.message(MessageId.CSS_004, EPUBLocation.create(path), charset);
}
}
if (source.getInputStream().getCssCharset().isPresent())
@@ -155,14 +150,16 @@ public class CSSChecker implements ContentChecker
charset = source.getInputStream().getCssCharset().get().toLowerCase();
if (!charset.equals("utf-8") && !charset.startsWith("utf-16"))
{
- report.message(MessageId.CSS_003, new MessageLocation(path, 0, 0, ""), charset);
+ report.message(MessageId.CSS_003, EPUBLocation.create(path, ""), charset);
}
}
}
return source;
}
- void parseItem(CssSource source, CSSHandler handler) throws IOException, CssExceptions.CssException
+ void parseItem(CssSource source, CSSHandler handler)
+ throws IOException,
+ CssExceptions.CssException
{
if (!isStyleAttribute)
{
@@ -177,7 +174,8 @@ public class CSSChecker implements ContentChecker
}
else
{
- new CssParser().parseStyleAttribute(new StringReader(this.value), this.path, handler, handler);
+ new CssParser()
+ .parseStyleAttribute(new StringReader(this.value), this.path, handler, handler);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java b/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java
index 6395dba..0f34e51 100644
--- a/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/css/CSSCheckerFactory.java
@@ -21,14 +21,9 @@
*/
package com.adobe.epubcheck.css;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
public class CSSCheckerFactory implements ContentCheckerFactory
{
@@ -36,22 +31,19 @@ public class CSSCheckerFactory implements ContentCheckerFactory
* (non-Javadoc)
* @see com.adobe.epubcheck.opf.ContentCheckerFactory#newInstance(com.adobe.epubcheck.ocf.OCFPackage, com.adobe.epubcheck.api.Report, java.lang.String, java.lang.String, java.lang.String, com.adobe.epubcheck.opf.XRefChecker, com.adobe.epubcheck.util.EPUBVersion)
*/
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public ContentChecker newInstance(ValidationContext context)
{
- return new CSSChecker(ocf, report, path, xrefChecker, version);
+ return new CSSChecker(context);
}
/**
* Additional constructor for validating CSS strings (style attributes and elements)
*/
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String value, boolean isStyleAttribute, String path, int line, int col,
- XRefChecker xrefChecker, EPUBVersion version)
+ public ContentChecker newInstance(ValidationContext context, String value, int line,
+ boolean isStyleAttribute)
{
- return new CSSChecker(ocf, report, value, isStyleAttribute, path, line, xrefChecker, version);
+ return new CSSChecker(context, value, line, isStyleAttribute);
}
static private final CSSCheckerFactory instance = new CSSCheckerFactory();
diff --git a/src/main/java/com/adobe/epubcheck/css/CSSHandler.java b/src/main/java/com/adobe/epubcheck/css/CSSHandler.java
index 74cab6b..9dd9567 100644
--- a/src/main/java/com/adobe/epubcheck/css/CSSHandler.java
+++ b/src/main/java/com/adobe/epubcheck/css/CSSHandler.java
@@ -1,8 +1,22 @@
package com.adobe.epubcheck.css;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.idpf.epubcheck.util.css.CssContentHandler;
+import org.idpf.epubcheck.util.css.CssErrorHandler;
+import org.idpf.epubcheck.util.css.CssExceptions.CssException;
+import org.idpf.epubcheck.util.css.CssGrammar.CssAtRule;
+import org.idpf.epubcheck.util.css.CssGrammar.CssConstruct;
+import org.idpf.epubcheck.util.css.CssGrammar.CssDeclaration;
+import org.idpf.epubcheck.util.css.CssGrammar.CssSelector;
+import org.idpf.epubcheck.util.css.CssGrammar.CssURI;
+import org.idpf.epubcheck.util.css.CssLocation;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFChecker;
import com.adobe.epubcheck.opf.OPFChecker30;
import com.adobe.epubcheck.opf.XRefChecker;
@@ -10,15 +24,6 @@ import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.PathUtil;
import com.google.common.base.CharMatcher;
-import org.idpf.epubcheck.util.css.CssContentHandler;
-import org.idpf.epubcheck.util.css.CssErrorHandler;
-import org.idpf.epubcheck.util.css.CssExceptions.CssException;
-import org.idpf.epubcheck.util.css.CssGrammar.*;
-import org.idpf.epubcheck.util.css.CssLocation;
-
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
public class CSSHandler implements CssContentHandler, CssErrorHandler
{
@@ -49,11 +54,11 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
this.version = version;
}
- private MessageLocation getCorrectedMessageLocation(String fileName, int lineNumber, int columnNumber, String context)
+ private EPUBLocation getCorrectedEPUBLocation(String fileName, int lineNumber, int columnNumber, String context)
{
lineNumber = correctedLineNumber(lineNumber);
columnNumber = correctedColumnNumber(lineNumber, columnNumber);
- return new MessageLocation(fileName, lineNumber, columnNumber, context);
+ return EPUBLocation.create(fileName, lineNumber, columnNumber, context);
}
private int correctedLineNumber(int lineNumber)
@@ -88,7 +93,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
}
}
CssLocation location = e.getLocation();
- report.message(MessageId.CSS_008, getCorrectedMessageLocation(path, location.getLine(), location.getColumn(), null), e.getMessage());
+ report.message(MessageId.CSS_008, getCorrectedEPUBLocation(path, location.getLine(), location.getColumn(), null), e.getMessage());
}
@Override
@@ -165,7 +170,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
handleFontFaceInfo();
if (!hasFontFaceDeclarations)
{
- report.message(MessageId.CSS_019, new MessageLocation(path, atRule.getLocation().getLine(), atRule.getLocation().getColumn(), atRule.toCssString()));
+ report.message(MessageId.CSS_019, EPUBLocation.create(path, atRule.getLocation().getLine(), atRule.getLocation().getColumn(), atRule.toCssString()));
}
hasFontFaceDeclarations = false;
}
@@ -207,7 +212,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
String value = cns.toCssString();
if (value != null && value.equalsIgnoreCase("fixed"))
{
- report.message(MessageId.CSS_006, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ report.message(MessageId.CSS_006, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
}
}
}
@@ -215,7 +220,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
{
if (propertyName.equals("direction") || propertyName.equals("unicode-bidi"))
{
- report.message(MessageId.CSS_001, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), propertyName);
+ report.message(MessageId.CSS_001, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), propertyName);
}
}
@@ -266,7 +271,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
if (!blessed)
{
report.message(MessageId.CSS_007,
- getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()),
+ getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()),
fontUri,
fontMimeType);
}
@@ -279,7 +284,7 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
}
}
report.message(MessageId.CSS_028,
- getCorrectedMessageLocation(path,
+ getCorrectedEPUBLocation(path,
declaration.getLocation().getLine(),
declaration.getLocation().getColumn(),
fontUri != null ? fontUri : "null")
@@ -303,11 +308,11 @@ public class CSSHandler implements CssContentHandler, CssErrorHandler
if (relativeRef != null && relativeRef.trim().length() > 0)
{
String resolved = PathUtil.resolveRelativeReference(path, relativeRef, null);
- xrefChecker.registerReference(path, line + startingLineNumber, col, resolved, XRefChecker.RT_GENERIC);
+ xrefChecker.registerReference(path, line + startingLineNumber, col, resolved, XRefChecker.Type.GENERIC);
}
else
{
- report.message(MessageId.CSS_002,getCorrectedMessageLocation(path, line, col, context));
+ report.message(MessageId.CSS_002,getCorrectedEPUBLocation(path, line, col, context));
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java b/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
index 359ba3a..cfba951 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java
@@ -1,15 +1,11 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipFile;
+
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.ContentValidator.ValidationType;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.outWriter;
-import com.adobe.epubcheck.util.Messages;
-
-import java.util.zip.ZipFile;
public class CheckManager
{
@@ -38,7 +34,6 @@ public class CheckManager
}
EPUBVersion version = epack.getVersion();
- outWriter.println(String.format(Messages.get("validating_against_epub_version"), version));
if (version != null && version.equals(EPUBVersion.VERSION_3))
{
@@ -52,10 +47,6 @@ public class CheckManager
factory.newInstance(report, ValidationType.EPUB3_STRUCTURE, epack).validate();
factory.newInstance(report, ValidationType.METADATA_V2, epack).validate();
}
- else
- {
- report.message(MessageId.OPF_024, new MessageLocation(epack.getFileName(), -1, -1), version);
- }
factory.newInstance(report, ValidationType.NCX, epack).validate();
factory.newInstance(report, ValidationType.MULTIPLE_CSS, epack).validate();
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java b/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java
index 8f07134..51641a4 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java
@@ -1,21 +1,25 @@
package com.adobe.epubcheck.ctc;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.EncryptionFilter;
-import com.adobe.epubcheck.util.EPUBVersion;
-
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Scanner;
+import java.util.Vector;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.ocf.EncryptionFilter;
+import com.adobe.epubcheck.util.EPUBVersion;
+
class EntitySearch
{
private final ZipFile zip;
@@ -38,7 +42,7 @@ class EntitySearch
legalEntities2_0 = new HashSet<String>();
Collections.addAll(legalEntities2_0, " ", "¡", "¢", "£", "¤",
- "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "", "®",
+ "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "", "®",
"¯", "°", "±", "²", "³", "´", "µ", "¶", "·", "¸",
"¹", "º", "»", "¼", "½", "¾", "¿", "À", "Á",
"Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë",
@@ -144,11 +148,11 @@ class EntitySearch
if (messageCode == ENTITY_INVALID)
{
// emit the erroneous text along with the message
- report.message(messageCode, new MessageLocation(entry, lineCounter, matcher.start(), context.trim()), matchedText);
+ report.message(messageCode, EPUBLocation.create(entry, lineCounter, matcher.start(), context.trim()), matchedText);
}
else
{
- report.message(messageCode, new MessageLocation(entry, lineCounter, matcher.start(), context.trim()));
+ report.message(messageCode, EPUBLocation.create(entry, lineCounter, matcher.start(), context.trim()));
}
}
lineCounter++;
@@ -157,17 +161,17 @@ class EntitySearch
catch (FileNotFoundException e1)
{
String fileName = new File(zip.getName()).getName();
- report.message(MessageId.RSC_001, new MessageLocation(fileName, -1, -1), entry);
+ report.message(MessageId.RSC_001, EPUBLocation.create(fileName), entry);
}
catch (IOException e1)
{
String fileName = new File(zip.getName()).getName();
- report.message(MessageId.PKG_008, new MessageLocation(fileName, -1, -1), entry);
+ report.message(MessageId.PKG_008, EPUBLocation.create(fileName), entry);
}
catch (Exception e)
{
e.printStackTrace();
- report.message(MessageId.RSC_005, new MessageLocation(entry, -1, -1), e.getMessage());
+ report.message(MessageId.RSC_005, EPUBLocation.create(entry), e.getMessage());
}
finally
{
diff --git a/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java b/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
index 6506999..cd14670 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java
@@ -1,19 +1,16 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipEntry;
+
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.Epub3StructureHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.util.zip.ZipEntry;
-
public class Epub3StructureCheck implements DocumentValidator
{
private final Report report;
@@ -45,7 +42,8 @@ public class Epub3StructureCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
index 11edbaa..9ad283f 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java
@@ -1,5 +1,19 @@
package com.adobe.epubcheck.ctc;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.Hashtable;
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.idpf.epubcheck.util.css.CssParser;
+import org.idpf.epubcheck.util.css.CssSource;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.css.EpubCSSCheckCSSHandler;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
@@ -7,25 +21,12 @@ import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.CSSStyleAttributeHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.EncryptionFilter;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
import com.adobe.epubcheck.util.TextSearchDictionaryEntry;
-import org.idpf.epubcheck.util.css.CssParser;
-import org.idpf.epubcheck.util.css.CssSource;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.Hashtable;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
public class EpubCSSCheck implements DocumentValidator
{
@@ -66,7 +67,8 @@ public class EpubCSSCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -95,7 +97,8 @@ public class EpubCSSCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -121,7 +124,7 @@ public class EpubCSSCheck implements DocumentValidator
for (CSSStyleAttributeHandler.StyleAttribute value : styleAttributes)
{
searchInsideValue(value, tsd, fileToParse);
- report.message(MessageId.ACC_013, new MessageLocation(fileToParse, value.getLine(), value.getColumn(), value.getValue()));
+ report.message(MessageId.ACC_013, EPUBLocation.create(fileToParse, value.getLine(), value.getColumn(), value.getValue()));
}
}
}
@@ -130,7 +133,7 @@ public class EpubCSSCheck implements DocumentValidator
if (numCssFiles > EXCESSIVE_CSS_THRESHOLD)
{
- report.message(MessageId.CSS_011, new MessageLocation(epack.getFileName(), -1, -1));
+ report.message(MessageId.CSS_011, EPUBLocation.create(epack.getFileName()));
}
return true;
}
@@ -205,7 +208,7 @@ public class EpubCSSCheck implements DocumentValidator
while (matcher.find(position))
{
position = matcher.end();
- report.message(messageCode, new MessageLocation(file, entry.getLine(), entry.getColumn(), entry.getValue().trim()));
+ report.message(messageCode, EPUBLocation.create(file, entry.getLine(), entry.getColumn(), entry.getValue().trim()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
index 297df82..64d25c0 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java
@@ -1,21 +1,20 @@
package com.adobe.epubcheck.ctc;
+import java.io.File;
+import java.util.Vector;
+import java.util.zip.ZipEntry;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.AnchorTagHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.io.File;
-import java.util.Vector;
-import java.util.zip.ZipEntry;
-
public class EpubCfiCheck implements DocumentValidator
{
@@ -42,7 +41,8 @@ public class EpubCfiCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -72,11 +72,11 @@ public class EpubCfiCheck implements DocumentValidator
fileName = new File(fileName).getName();
if (entry.getValue().contains(".epub") && fileName.compareTo(file) != 0)
{
- report.message(MessageId.HTM_012, new MessageLocation(file, entry.getLine(), entry.getColumn(), entry.getValue()));
+ report.message(MessageId.HTM_012, EPUBLocation.create(file, entry.getLine(), entry.getColumn(), entry.getValue()));
}
else
{
- report.message(MessageId.HTM_013, new MessageLocation(file, entry.getLine(), entry.getColumn(), entry.getValue()));
+ report.message(MessageId.HTM_013, EPUBLocation.create(file, entry.getLine(), entry.getColumn(), entry.getValue()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
index 2bb14db..b10af87 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java
@@ -1,23 +1,23 @@
package com.adobe.epubcheck.ctc;
+import java.util.Vector;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.AnchorTagHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
import com.adobe.epubcheck.util.TextSearchDictionaryEntry;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-
public class EpubExtLinksCheck implements DocumentValidator
{
@@ -50,7 +50,8 @@ public class EpubExtLinksCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -66,9 +67,10 @@ public class EpubExtLinksCheck implements DocumentValidator
{
// ensure that this image is in the manifest
String imageFile = value.getValue();
- if (imageFile.matches("^[^:/?#]+://.*"))
+ if (imageFile.matches("^[^:/?#]+:.*"))
{
- report.message(MessageId.RSC_006, new MessageLocation(fileToParse, value.getLine(), value.getColumn(), value.getContext()), value.getValue());
+ // Already reported in OPFHandler
+// report.message(MessageId.RSC_006, new EPUBLocation(fileToParse, value.getLine(), value.getColumn(), value.getContext()), value.getValue());
continue;
}
@@ -83,7 +85,7 @@ public class EpubExtLinksCheck implements DocumentValidator
if (imgentry == null)
{
MessageId id = "img".compareToIgnoreCase(type) == 0 ? MessageId.RSC_001 : MessageId.RSC_018;
- report.message(id, new MessageLocation(fileToParse, value.getLine(), value.getColumn(), value.getContext()), value.getValue());
+ report.message(id, EPUBLocation.create(fileToParse, value.getLine(), value.getColumn(), value.getContext()), value.getValue());
}
}
}
@@ -105,7 +107,7 @@ public class EpubExtLinksCheck implements DocumentValidator
while (matcher.find(position))
{
position = matcher.end();
- report.message(messageCode, new MessageLocation(file, entry.getLine(), entry.getColumn(), entry.getValue()));
+ report.message(messageCode, EPUBLocation.create(file, entry.getLine(), entry.getColumn(), entry.getValue()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
index b04fa8d..1b9a836 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java
@@ -10,6 +10,7 @@ import java.util.regex.Pattern;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
@@ -17,7 +18,6 @@ import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
import com.adobe.epubcheck.ctc.xml.HTMLTagsAnalyseHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.EncryptionFilter;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.EPUBVersion;
@@ -103,8 +103,9 @@ public class EpubHTML5StructureCheck implements DocumentValidator
ZipEntry entry = zip.getEntry(fileToParse);
if (entry == null)
{
- String fileName = new File(zip.getName()).getName();
- report.message(MessageId.RSC_001, new MessageLocation(fileName, -1, -1), fileToParse);
+ // already reported in core checkers
+ // String fileName = new File(zip.getName()).getName();
+ // report.message(MessageId.RSC_001, EPUBLocation.create(fileName), fileToParse);
continue;
}
sh.setVersion(epubPackage.getVersion());
@@ -119,7 +120,7 @@ public class EpubHTML5StructureCheck implements DocumentValidator
|| fileExtension.compareToIgnoreCase("xhtml") == 0))
{
// Note: extension is already checked in OPFChecker30 for EPUB 3
- report.message(MessageId.HTM_014, new MessageLocation(mi.getHref(), -1, -1));
+ report.message(MessageId.HTM_014, EPUBLocation.create(mi.getHref()));
}
/***VALIDATE DOCTYPE***/
@@ -127,11 +128,11 @@ public class EpubHTML5StructureCheck implements DocumentValidator
if ((0 != (docTypeMatches & hasHTML4)) && (epubPackage.getVersion() == EPUBVersion.VERSION_3))
{
- report.message(MessageId.HTM_015, new MessageLocation(mi.getHref(), -1, -1));
+ report.message(MessageId.HTM_015, EPUBLocation.create(mi.getHref()));
}
else if ((0 != (docTypeMatches & hasHTML5)) && ((hasXhtml != (docTypeMatches & hasXhtml))) && (epubPackage.getVersion() == EPUBVersion.VERSION_2))
{
- report.message(MessageId.HTM_016, new MessageLocation(mi.getHref(), -1, -1));
+ report.message(MessageId.HTM_016, EPUBLocation.create(mi.getHref()));
}
parser.parseDoc(fileToParse, sh);
@@ -152,7 +153,7 @@ public class EpubHTML5StructureCheck implements DocumentValidator
if (landmarkNavCount != 1 && epubPackage.getVersion() == EPUBVersion.VERSION_3)
{
File zipFile = new File(zip.getName());
- report.message(MessageId.ACC_008, new MessageLocation(zipFile.getName(), -1, -1));
+ report.message(MessageId.ACC_008, EPUBLocation.create(zipFile.getName()));
}
return result;
@@ -266,7 +267,7 @@ public class EpubHTML5StructureCheck implements DocumentValidator
catch (Exception e)
{
e.printStackTrace();
- report.message(MessageId.PKG_008, new MessageLocation(entry, -1, -1), e.getMessage());
+ report.message(MessageId.PKG_008, EPUBLocation.create(entry), e.getMessage());
}
finally
{
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
index b898411..466f420 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java
@@ -1,20 +1,19 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.LangAttributeHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
public class EpubLangCheck implements DocumentValidator
{
private final ZipFile zip;
@@ -45,7 +44,8 @@ public class EpubLangCheck implements DocumentValidator
ZipEntry entry = this.zip.getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse);
continue;
}
@@ -56,27 +56,27 @@ public class EpubLangCheck implements DocumentValidator
{
if (xmlLangAttribute.compareToIgnoreCase(langAttribute) != 0)
{
- report.message(MessageId.HTM_017, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.HTM_017, EPUBLocation.create(fileToParse));
}
if (!isValidLanguageDefinition(xmlLangAttribute))
{
- report.message(MessageId.HTM_018, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.HTM_018, EPUBLocation.create(fileToParse));
}
if (!isValidLanguageDefinition(langAttribute))
{
- report.message(MessageId.HTM_019, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.HTM_019, EPUBLocation.create(fileToParse));
}
}
else
{
if (xmlLangAttribute == null)
{
- report.message(MessageId.HTM_020, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.HTM_020, EPUBLocation.create(fileToParse));
}
if (langAttribute == null)
{
- report.message(MessageId.HTM_021, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.HTM_021, EPUBLocation.create(fileToParse));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
index a08d58e..3ef7153 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java
@@ -1,18 +1,27 @@
package com.adobe.epubcheck.ctc;
+import java.util.HashSet;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ctc.epubpackage.*;
+import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
+import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
+import com.adobe.epubcheck.ctc.epubpackage.PackageManifest;
+import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
+import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.reporting.CheckingReport;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.EpubConstants;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.PathUtil;
-import org.w3c.dom.*;
-
-import java.util.HashSet;
public class EpubNCXCheck implements DocumentValidator
{
@@ -47,7 +56,7 @@ public class EpubNCXCheck implements DocumentValidator
{
if (report.getClass() == CheckingReport.class)
{
- report.message(MessageId.NCX_003, new MessageLocation(pathRootFile, -1, -1));
+ report.message(MessageId.NCX_003, EPUBLocation.create(pathRootFile));
}
else
{
@@ -127,7 +136,7 @@ public class EpubNCXCheck implements DocumentValidator
}
catch (IllegalArgumentException ex)
{
- report.message(MessageId.OPF_022, new MessageLocation(navDocEntry, getElementLineNumber(content), getElementColumnNumber(content)), path);
+ // safe to ignore, was already reported as RSC_005 in NCXHandler
}
if (!path.equals(""))
{
@@ -144,7 +153,7 @@ public class EpubNCXCheck implements DocumentValidator
if (n.getLength() > 0)
{
Element pageList = (Element) n.item(0);
- report.message(MessageId.NCX_005, new MessageLocation(navDocEntry, getElementLineNumber(pageList), getElementColumnNumber(pageList), pageList.getTagName()));
+ report.message(MessageId.NCX_005, EPUBLocation.create(navDocEntry, getElementLineNumber(pageList), getElementColumnNumber(pageList), pageList.getTagName()));
}
PackageManifest manifest = epack.getManifest();
@@ -164,13 +173,13 @@ public class EpubNCXCheck implements DocumentValidator
if (path != null && !path.equals(tocFileName) && !path.equals(navDocEntry) && !tocLinkSet.contains(path))
{
- report.message(MessageId.OPF_059, new MessageLocation(navDocEntry, -1, -1, path));
+ report.message(MessageId.OPF_059, EPUBLocation.create(navDocEntry, path));
}
}
else
{
// id not found in manifest
- report.message(MessageId.OPF_049, new MessageLocation(navDocEntry, -1, -1, epack.getPackageMainPath()), si.getIdref());
+ report.message(MessageId.OPF_049, EPUBLocation.create(navDocEntry, epack.getPackageMainPath()), si.getIdref());
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
index 545f9c8..b22a703 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java
@@ -1,20 +1,29 @@
package com.adobe.epubcheck.ctc;
+import java.util.HashSet;
+import java.util.Vector;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ctc.epubpackage.*;
+import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
+import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
+import com.adobe.epubcheck.ctc.epubpackage.PackageManifest;
+import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
+import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.EpubConstants;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.HandlerUtil;
import com.adobe.epubcheck.util.PathUtil;
-import org.w3c.dom.*;
-
-import java.util.HashSet;
-import java.util.Vector;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
public class EpubNavCheck implements DocumentValidator
{
@@ -59,7 +68,8 @@ public class EpubNavCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -148,7 +158,7 @@ public class EpubNavCheck implements DocumentValidator
}
else if (type.equals("page-list"))
{
- report.message(MessageId.NAV_002, new MessageLocation(navDocEntry, HandlerUtil.getElementLineNumber(navElement), HandlerUtil.getElementColumnNumber(navElement), "page-list"));
+ report.message(MessageId.NAV_002, EPUBLocation.create(navDocEntry, HandlerUtil.getElementLineNumber(navElement), HandlerUtil.getElementColumnNumber(navElement), "page-list"));
}
}
}
@@ -163,12 +173,15 @@ public class EpubNavCheck implements DocumentValidator
{
SpineItem si = spine.getItem(i);
ManifestItem mi = manifest.getItem(si.getIdref());
- String path = mi.getHref();
- path = PathUtil.resolveRelativeReference(epack.getPackageMainFile(), path, null);
-
- if (path != null && !path.equals(tocFileName) && !path.equals(navDocEntry) && !tocLinkSet.contains(path))
+ if (mi != null)
{
- report.message(MessageId.OPF_058, new MessageLocation(navDocEntry, -1, -1, path));
+ String path = mi.getHref();
+ path = PathUtil.resolveRelativeReference(epack.getPackageMainFile(), path, null);
+
+ if (path != null && !path.equals(tocFileName) && !path.equals(navDocEntry) && !tocLinkSet.contains(path))
+ {
+ report.message(MessageId.OPF_058, EPUBLocation.create(navDocEntry, -1, -1, path));
+ }
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
index 681b448..e71cfca 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java
@@ -1,19 +1,20 @@
package com.adobe.epubcheck.ctc;
+import java.util.Hashtable;
+import java.util.zip.ZipEntry;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.SearchDictionary;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import java.util.Hashtable;
-import java.util.zip.ZipEntry;
public class EpubSVGCheck implements DocumentValidator
{
@@ -58,7 +59,8 @@ public class EpubSVGCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(epack.getFileName()), fileToParse);
continue;
}
@@ -116,7 +118,7 @@ public class EpubSVGCheck implements DocumentValidator
String viewport = svgElement.getAttributeNS(svgNS, "viewBox");
if (viewport == null || viewport.length() == 0)
{
- report.message(MessageId.HTM_048, new MessageLocation(svgDocEntry, XmlDocParser.getElementLineNumber(svgElement), XmlDocParser.getElementColumnNumber(svgElement)));
+ report.message(MessageId.HTM_048, EPUBLocation.create(svgDocEntry, XmlDocParser.getElementLineNumber(svgElement), XmlDocParser.getElementColumnNumber(svgElement)));
}
}
}
@@ -131,7 +133,7 @@ public class EpubSVGCheck implements DocumentValidator
{
if (!href.startsWith("data:image"))
{
- report.message(MessageId.MED_006, new MessageLocation(svgDocEntry, XmlDocParser.getElementLineNumber(svgElement), XmlDocParser.getElementColumnNumber(svgElement)));
+ report.message(MessageId.MED_006, EPUBLocation.create(svgDocEntry, XmlDocParser.getElementLineNumber(svgElement), XmlDocParser.getElementColumnNumber(svgElement)));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
index ec9334c..42d79ea 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java
@@ -1,23 +1,27 @@
package com.adobe.epubcheck.ctc;
+import java.io.BufferedReader;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.regex.Matcher;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.ScriptTagHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.io.*;
-import java.util.regex.Matcher;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
public class EpubScriptCheck implements DocumentValidator
{
private final ZipFile zip;
@@ -47,7 +51,8 @@ public class EpubScriptCheck implements DocumentValidator
ZipEntry entry = this.zip.getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse);
continue;
}
sh.setFileName(fileToParse);
@@ -65,10 +70,10 @@ public class EpubScriptCheck implements DocumentValidator
}
if (epack.getVersion() != EPUBVersion.VERSION_2)
{
- report.message(MessageId.SCP_010, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.SCP_010, EPUBLocation.create(fileToParse));
if (mi.getProperties() == null || !mi.getProperties().contains("scripted"))
{
- report.message(MessageId.SCP_005, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.SCP_005, EPUBLocation.create(fileToParse));
}
}
}
@@ -90,7 +95,8 @@ public class EpubScriptCheck implements DocumentValidator
ZipEntry entry = this.zip.getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(fileToParse, -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(fileToParse), fileToParse);
return;
}
report.info(fileToParse, FeatureEnum.SCRIPT, "javascript");
@@ -98,11 +104,11 @@ public class EpubScriptCheck implements DocumentValidator
if (epack.getVersion() == EPUBVersion.VERSION_2)
{
- report.message(MessageId.SCP_004, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.SCP_004, EPUBLocation.create(fileToParse));
}
else
{
- report.message(MessageId.SCP_010, new MessageLocation(fileToParse, -1, -1));
+ report.message(MessageId.SCP_010, EPUBLocation.create(fileToParse));
}
try
@@ -121,11 +127,11 @@ public class EpubScriptCheck implements DocumentValidator
}
catch (FileNotFoundException ex)
{
- report.message(MessageId.RSC_001, new MessageLocation(fileToParse, -1, -1), fileToParse);
+ report.message(MessageId.RSC_001, EPUBLocation.create(fileToParse), fileToParse);
}
catch (IOException ex)
{
- report.message(MessageId.PKG_008, new MessageLocation(fileToParse, -1, -1), fileToParse);
+ report.message(MessageId.PKG_008, EPUBLocation.create(fileToParse), fileToParse);
}
finally
{
@@ -159,13 +165,13 @@ public class EpubScriptCheck implements DocumentValidator
int column = lower.indexOf("innerhtml");
if (column >= 0)
{
- report.message(MessageId.SCP_007, new MessageLocation(fileName, line, column, trimContext(script, column)));
+ report.message(MessageId.SCP_007, EPUBLocation.create(fileName, line, column, trimContext(script, column)));
}
column = lower.indexOf("innertext");
if (column >= 0)
{
- report.message(MessageId.SCP_008, new MessageLocation(fileName, line, column, trimContext(script, column)));
+ report.message(MessageId.SCP_008, EPUBLocation.create(fileName, line, column, trimContext(script, column)));
}
// the exact pattern is very complex and it slows down all script checking.
@@ -177,29 +183,29 @@ public class EpubScriptCheck implements DocumentValidator
m = ScriptTagHandler.evalPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_001, new MessageLocation(fileName, line, m.start(0), trimContext(script, m.start())));
+ report.message(MessageId.SCP_001, EPUBLocation.create(fileName, line, m.start(0), trimContext(script, m.start())));
}
}
m = ScriptTagHandler.localStoragePattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_003, new MessageLocation(fileName, line, m.start(0), trimContext(script, m.start())));
+ report.message(MessageId.SCP_003, EPUBLocation.create(fileName, line, m.start(0), trimContext(script, m.start())));
}
m = ScriptTagHandler.sessionStoragePattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_003, new MessageLocation(fileName, line, m.start(0), trimContext(script, m.start())));
+ report.message(MessageId.SCP_003, EPUBLocation.create(fileName, line, m.start(0), trimContext(script, m.start())));
}
m = ScriptTagHandler.xmlHttpRequestPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_002, new MessageLocation(fileName, line, m.start(0), trimContext(script, m.start())));
+ report.message(MessageId.SCP_002, EPUBLocation.create(fileName, line, m.start(0), trimContext(script, m.start())));
}
m = ScriptTagHandler.microsoftXmlHttpRequestPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_002, new MessageLocation(fileName, line, m.start(0), trimContext(script, m.start())));
+ report.message(MessageId.SCP_002, EPUBLocation.create(fileName, line, m.start(0), trimContext(script, m.start())));
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
index 2158cc0..288f400 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java
@@ -1,20 +1,19 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.SpanTagHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
public class EpubSpanCheck implements DocumentValidator
{
private final ZipFile zip;
@@ -45,7 +44,8 @@ public class EpubSpanCheck implements DocumentValidator
ZipEntry entry = this.zip.getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse);
continue;
}
@@ -53,7 +53,7 @@ public class EpubSpanCheck implements DocumentValidator
sh.countNestedElements(sh.getTopElement());
if (sh.getGenerateMessage() > 0)
{
- report.message(MessageId.HTM_022, new MessageLocation(mi.getHref(), -1, -1));
+ report.message(MessageId.HTM_022, EPUBLocation.create(mi.getHref()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
index 5e7d2a2..6f214a8 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java
@@ -1,14 +1,15 @@
package com.adobe.epubcheck.ctc;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.MetadataElement;
import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.EpubConstants;
import com.adobe.epubcheck.util.outWriter;
+
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -43,7 +44,7 @@ public class EpubSpineCheck implements DocumentValidator
Node spine = spines.getLength() > 0 ? spines.item(0) : null;
if (spine == null)
{
- report.message(MessageId.OPF_019, new MessageLocation(pathRootFile, -1, -1));
+ report.message(MessageId.OPF_019, EPUBLocation.create(pathRootFile));
outWriter.println("Spine element not found within package root document " + pathRootFile);
return false;
}
@@ -89,7 +90,7 @@ public class EpubSpineCheck implements DocumentValidator
NodeList spineElements = spine.item(0).getChildNodes();
if (spineElements.getLength() > maxSpineElements)
{
- report.message(MessageId.OPF_020, new MessageLocation(pathRootFile, -1, -1));
+ report.message(MessageId.OPF_020, EPUBLocation.create(pathRootFile));
return false;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
index 7292902..5386e21 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java
@@ -1,19 +1,16 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipEntry;
+
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
import com.adobe.epubcheck.ctc.xml.LinkTagHandler;
import com.adobe.epubcheck.ctc.xml.XMLContentDocParser;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.util.zip.ZipEntry;
-
public class EpubStyleSheetsCheck implements DocumentValidator
{
@@ -41,7 +38,8 @@ public class EpubStyleSheetsCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse);
continue;
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
index e28517e..690efe1 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java
@@ -1,16 +1,14 @@
package com.adobe.epubcheck.ctc;
+import java.util.zip.ZipEntry;
+
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.SearchDictionary;
import com.adobe.epubcheck.util.SearchDictionary.DictionaryType;
-import java.util.zip.ZipEntry;
-
public class EpubTextContentCheck implements DocumentValidator
{
private final Report report;
@@ -38,7 +36,8 @@ public class EpubTextContentCheck implements DocumentValidator
ZipEntry entry = epack.getZip().getEntry(fileToParse);
if (entry == null)
{
- report.message(MessageId.RSC_001, new MessageLocation(this.epack.getFileName(), -1, -1), fileToParse);
+ // already reported in core checkers
+ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse);
continue;
}
this.search.Search(fileToParse);
diff --git a/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java b/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
index 0f48d21..60b5276 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java
@@ -1,10 +1,10 @@
package com.adobe.epubcheck.ctc;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.util.EPUBVersion;
@@ -28,7 +28,7 @@ public class EpubTocCheck implements DocumentValidator
PackageSpine spine = epack.getSpine();
if (spine == null || (spine.getToc() == null && epack.getVersion() == EPUBVersion.VERSION_2))
{
- report.message(MessageId.NCX_002, new MessageLocation(pathRootFile, -1, -1));
+ report.message(MessageId.NCX_002, EPUBLocation.create(pathRootFile));
result = false;
}
return result;
diff --git a/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java b/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java
index 4e0ffdd..e6eb5ff 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java
@@ -1,16 +1,22 @@
package com.adobe.epubcheck.ctc;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ctc.epubpackage.*;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.EpubConstants;
+import java.util.Vector;
+import java.util.zip.ZipFile;
+
import org.w3c.dom.Document;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import java.util.Vector;
-import java.util.zip.ZipFile;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.ctc.epubpackage.EpubPackage;
+import com.adobe.epubcheck.ctc.epubpackage.ManifestItem;
+import com.adobe.epubcheck.ctc.epubpackage.MetadataElement;
+import com.adobe.epubcheck.ctc.epubpackage.PackageManifest;
+import com.adobe.epubcheck.ctc.epubpackage.PackageSpine;
+import com.adobe.epubcheck.ctc.epubpackage.SpineItem;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.EpubConstants;
class PackageReader
{
@@ -82,7 +88,7 @@ class PackageReader
{
NamedNodeMap attr = currentNode.getAttributes();
Node path = attr.getNamedItem("full-path");
- if (path != null)
+ if (path != null && !path.getNodeValue().isEmpty())
{
String nodeValue = path.getNodeValue();
rootFiles.add(nodeValue);
diff --git a/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java b/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java
index 683d3e8..b724add 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java
@@ -1,11 +1,19 @@
package com.adobe.epubcheck.ctc;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.EncryptionFilter;
-import com.adobe.epubcheck.util.EpubConstants;
-import com.adobe.epubcheck.util.NamespaceHelper;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Hashtable;
+import java.util.Stack;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -14,14 +22,12 @@ import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import javax.xml.parsers.*;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Hashtable;
-import java.util.Stack;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.ocf.EncryptionFilter;
+import com.adobe.epubcheck.util.EpubConstants;
+import com.adobe.epubcheck.util.NamespaceHelper;
class XmlDocParser
{
@@ -48,7 +54,7 @@ class XmlDocParser
if (is == null)
{
String fileName = new File(zip.getName()).getName();
- report.message(MessageId.RSC_001, new MessageLocation(fileName, -1, -1), fileEntry);
+ report.message(MessageId.RSC_001, EPUBLocation.create(fileName), fileEntry);
}
else
{
@@ -57,11 +63,11 @@ class XmlDocParser
}
catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(fileEntry, -1, -1), fileEntry);
+ report.message(MessageId.PKG_008, EPUBLocation.create(fileEntry), fileEntry);
}
catch (SAXException e)
{
- report.message(MessageId.RSC_005, new MessageLocation(fileEntry, -1, -1), e.getMessage());
+ report.message(MessageId.RSC_005, EPUBLocation.create(fileEntry), e.getMessage());
doc = null;
}
finally
@@ -183,7 +189,7 @@ class XmlDocParser
@Override
public void startPrefixMapping (String prefix, String uri) throws SAXException
{
- namespaceHelper.declareNamespace(prefix, uri, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
+ namespaceHelper.declareNamespace(prefix, uri, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
}
@Override
diff --git a/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java b/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java
index 3260254..fdd6cbf 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java
@@ -3,6 +3,7 @@ package com.adobe.epubcheck.ctc.css;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
@@ -18,9 +19,9 @@ import org.idpf.epubcheck.util.css.CssExceptions;
import org.idpf.epubcheck.util.css.CssGrammar;
import org.idpf.epubcheck.util.css.CssLocation;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.LocationImpl;
import com.adobe.epubcheck.util.TextSearchDictionaryEntry;
import com.google.common.base.Optional;
@@ -70,7 +71,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
if (cu.Count == 0)
{
assert (cu.Name != null && !cu.Name.isEmpty());
- report.message(MessageId.CSS_024, getCorrectedMessageLocation(cu.FileName, cu.Location.getLineNumber(), cu.Location.getColumnNumber(), cu.Name));
+ report.message(MessageId.CSS_024, getCorrectedEPUBLocation(cu.FileName, cu.Location.getLineNumber(), cu.Location.getColumnNumber(), cu.Name));
}
}
}
@@ -97,7 +98,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
public int Count;
}
- HashMap<String, ClassUsage> classMap = new HashMap<String, ClassUsage>();
+ HashMap<String, ClassUsage> classMap = new LinkedHashMap<String, ClassUsage>();
public EpubCSSCheckCSSHandler(Report report, boolean isGlobalFixedFormat, boolean hasIndividualFixedFormatDocuments)
{
@@ -224,7 +225,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
CssLocation location = atRule.getLocation();
if (ruleName.startsWith("@media"))
{
- getReport().message(MessageId.CSS_023, getCorrectedMessageLocation(path, location.getLine(), location.getColumn(), atRule.toCssString()));
+ getReport().message(MessageId.CSS_023, getCorrectedEPUBLocation(path, location.getLine(), location.getColumn(), atRule.toCssString()));
}
else if (keyframesPattern.matcher(ruleName).matches())
{
@@ -238,11 +239,11 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
}
}
- MessageLocation getCorrectedMessageLocation(String fileName, int lineNumber, int columnNumber, String context)
+ EPUBLocation getCorrectedEPUBLocation(String fileName, int lineNumber, int columnNumber, String context)
{
lineNumber = correctedLineNumber(lineNumber);
columnNumber = correctedColumnNumber(lineNumber, columnNumber);
- return new MessageLocation(fileName, lineNumber, columnNumber, context);
+ return EPUBLocation.create(fileName, lineNumber, columnNumber, context);
}
@Override
@@ -252,7 +253,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
{
if (!hasFontFaceDeclarations)
{
- getReport().message(MessageId.CSS_019, getCorrectedMessageLocation(path, atRule.getLocation().getLine(), atRule.getLocation().getColumn(), atRule.toCssString()), atRule.toCssString());
+ getReport().message(MessageId.CSS_019, getCorrectedEPUBLocation(path, atRule.getLocation().getLine(), atRule.getLocation().getColumn(), atRule.toCssString()), atRule.toCssString());
}
}
inKeyFrames = false;
@@ -505,7 +506,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
if (construct.getType() == CssGrammar.CssConstruct.Type.KEYWORD &&
"absolute".compareToIgnoreCase(construct.toCssString()) == 0)
{
- getReport().message(id, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), declaration.getName().get());
+ getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), declaration.getName().get());
break;
}
}
@@ -518,7 +519,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
boolean isImportant = declaration.getImportant();
if (isImportant)
{
- getReport().message(MessageId.CSS_013, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ getReport().message(MessageId.CSS_013, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
}
return isImportant;
}
@@ -528,7 +529,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
String declarationName = declaration.toCssString().toLowerCase();
if (declarationName.startsWith("margin-") || declarationName.equals("margin"))
{
- getReport().message(MessageId.CSS_022, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), declarationName);
+ getReport().message(MessageId.CSS_022, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), declarationName);
}
}
@@ -545,7 +546,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
String value = construct.toCssString().toLowerCase();
if (("smaller".compareTo(value) != 0) && ("larger".compareTo(value) != 0) && ("inherit".compareTo(value) != 0))
{
- getReport().message(id, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
}
}
break;
@@ -561,7 +562,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
case PERCENTAGE:
break;
default:
- getReport().message(id, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
break;
}
}
@@ -647,7 +648,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
else
{
// we got into a state where we didn't recognize the token as a font-size, but it didn't match style/variant/weight either.
- getReport().message(MessageId.CSS_020, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString());
+ getReport().message(MessageId.CSS_020, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString());
return;
}
}
@@ -710,7 +711,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
case NUMBER:
break;
case LENGTH:
- getReport().message(id, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
break;
}
}
@@ -826,7 +827,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
if (!isValidSystemFontName(name))
{
// report error here = missing size or font family
- getReport().message(MessageId.CSS_021, getCorrectedMessageLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
+ getReport().message(MessageId.CSS_021, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()));
}
return true; // return true here because we have handled the case of only 1 attribute in the list
}
@@ -848,18 +849,19 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
@Override
public void error(CssExceptions.CssException e) throws CssExceptions.CssException
{
- String message = e.getMessage();
-
- if (inKeyFrames)
- {
- Matcher m = invalidTokenStringFinder.matcher(message);
- if (m.matches())
- {
- return;
- }
- }
- CssLocation location = e.getLocation();
- report.message(MessageId.CSS_008, new MessageLocation(path, location.getLine(), location.getColumn()), message);
+ // Already handled in com.adobe.epubcheck.css.CSSHandler
+// String message = e.getMessage();
+//
+// if (inKeyFrames)
+// {
+// Matcher m = invalidTokenStringFinder.matcher(message);
+// if (m.matches())
+// {
+// return;
+// }
+// }
+// CssLocation location = e.getLocation();
+// report.message(MessageId.CSS_008, new EPUBLocation(path, location.getLine(), location.getColumn()), message);
}
void searchInsideValue(String entry, int line, int column, Vector<TextSearchDictionaryEntry> tds, String file, String context)
@@ -872,7 +874,7 @@ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandle
while (matcher.find(position))
{
position = matcher.end();
- report.message(de.getErrorCode(), getCorrectedMessageLocation(file, line, column, context));
+ report.message(de.getErrorCode(), getCorrectedEPUBLocation(file, line, column, context));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java b/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java
index 8904a32..20ee119 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java
@@ -28,13 +28,13 @@ public class PackageManifest
public ManifestItem getItem(String id)
{
- if (id == null || id.equals(""))
+ if (id == null || id.trim().equals(""))
{
return null;
}
for (ManifestItem item : items)
{
- if (id.equals(item.getId()))
+ if (id.trim().equals(item.getId().trim()))
{
return item;
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java b/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java
index 6a8f4e1..30ef456 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java
@@ -1,10 +1,13 @@
package com.adobe.epubcheck.ctc.xml;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ctc.css.EpubCSSCheckCSSHandler;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.util.LocationImpl;
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.Stack;
+import java.util.Vector;
+
import org.idpf.epubcheck.util.css.CssParser;
import org.idpf.epubcheck.util.css.CssSource;
import org.xml.sax.Attributes;
@@ -12,12 +15,11 @@ import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Stack;
-import java.util.Vector;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.ctc.css.EpubCSSCheckCSSHandler;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.util.LocationImpl;
public class CSSStyleAttributeHandler extends DefaultHandler
{
@@ -28,7 +30,7 @@ public class CSSStyleAttributeHandler extends DefaultHandler
private boolean isGlobalFixedFormat = false;
private boolean documentIsFixedFormat = false;
private CSSStyleAttributeHandler.StyleAttribute currentStyleTag = null;
- private final HashMap<String, StyleAttribute> styleAttributesValues = new HashMap<String, StyleAttribute>();
+ private final HashMap<String, StyleAttribute> styleAttributesValues = new LinkedHashMap<String, StyleAttribute>();
private final Stack<HashMap<String, EpubCSSCheckCSSHandler.ClassUsage>> localStyles = new Stack<HashMap<String, EpubCSSCheckCSSHandler.ClassUsage>>();
private final Stack<Integer> styleLevels = new Stack<Integer>();
private EpubCSSCheckCSSHandler cssHandler;
@@ -104,7 +106,7 @@ public class CSSStyleAttributeHandler extends DefaultHandler
{
assert (cu.Name != null && !cu.Name.isEmpty());
- report.message(MessageId.CSS_024, new MessageLocation(getFileName(), cu.Location.getLineNumber(), cu.Location.getColumnNumber(), key));
+ report.message(MessageId.CSS_024, EPUBLocation.create(getFileName(), cu.Location.getLineNumber(), cu.Location.getColumnNumber(), key));
}
}
}
@@ -117,7 +119,7 @@ public class CSSStyleAttributeHandler extends DefaultHandler
tagStack.push(qName.toLowerCase());
if (qName.compareToIgnoreCase("style") == 0)
{
- HashMap<String, EpubCSSCheckCSSHandler.ClassUsage> localStyleMap = new HashMap<String, EpubCSSCheckCSSHandler.ClassUsage>();
+ HashMap<String, EpubCSSCheckCSSHandler.ClassUsage> localStyleMap = new LinkedHashMap<String, EpubCSSCheckCSSHandler.ClassUsage>();
localStyles.push(localStyleMap);
this.styleLevels.push(tagStack.size() - 1); // we are pushing the depth of the style's PARENT node here, not the depth of the STYLE node
@@ -155,7 +157,7 @@ public class CSSStyleAttributeHandler extends DefaultHandler
String styleName = "." + value;
if (!IncrementLocalCssClassCount(styleName) && !IncrementGlobalCssClassCount(styleName))
{
- report.message(MessageId.CSS_025, new MessageLocation(getFileName(), locator.getLineNumber(), locator.getColumnNumber(), styleName));
+ report.message(MessageId.CSS_025, EPUBLocation.create(getFileName(), locator.getLineNumber(), locator.getColumnNumber(), styleName));
}
}
}
@@ -222,13 +224,13 @@ public class CSSStyleAttributeHandler extends DefaultHandler
EpubCSSCheckCSSHandler.ClassUsage cu = localStyleMap.get(key);
if (cu != null && cu.Count == 0)
{
- MessageLocation messageLocation = new MessageLocation(cu.FileName, cu.Location.getLineNumber(), cu.Location.getColumnNumber(), key);
+ EPUBLocation location = EPUBLocation.create(cu.FileName, cu.Location.getLineNumber(), cu.Location.getColumnNumber(), key);
if (cu != null)
{
assert (cu.Name != null && !cu.Name.isEmpty());
}
assert (key != null && !key.isEmpty());
- report.message(MessageId.CSS_024, messageLocation);
+ report.message(MessageId.CSS_024, location);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java b/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java
index dceef01..9322bfc 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java
@@ -1,8 +1,9 @@
package com.adobe.epubcheck.ctc.xml;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.NamespaceHelper;
+
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
@@ -25,7 +26,7 @@ public class Epub3StructureHandler extends DefaultHandler
@Override
public void startPrefixMapping (String prefix, String uri) throws SAXException
{
- namespaceHelper.declareNamespace(prefix, uri, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
+ namespaceHelper.declareNamespace(prefix, uri, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java b/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java
index cfd412a..b467004 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java
@@ -1,15 +1,7 @@
package com.adobe.epubcheck.ctc.xml;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.EpubConstants;
-import com.adobe.epubcheck.util.NamespaceHelper;
-import org.xml.sax.Attributes;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
+import static com.adobe.epubcheck.opf.OPFChecker30.isBlessedAudioType;
+import static com.adobe.epubcheck.opf.OPFChecker30.isBlessedVideoType;
import java.util.ArrayList;
import java.util.Collections;
@@ -17,8 +9,17 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Stack;
-import static com.adobe.epubcheck.opf.OPFChecker30.isBlessedAudioType;
-import static com.adobe.epubcheck.opf.OPFChecker30.isBlessedVideoType;
+import org.xml.sax.Attributes;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.EpubConstants;
+import com.adobe.epubcheck.util.NamespaceHelper;
public class HTMLTagsAnalyseHandler extends DefaultHandler
{
@@ -132,7 +133,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
public String controlId;
public int mark;
- public MessageLocation location;
+ public EPUBLocation location;
}
public void setDocumentLocator(Locator locator)
@@ -172,7 +173,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
@Override
public void startPrefixMapping (String prefix, String uri) throws SAXException
{
- namespaceHelper.declareNamespace(prefix, uri, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
+ namespaceHelper.declareNamespace(prefix, uri, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), prefix), report);
}
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
@@ -200,9 +201,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
mimeType = "null";
}
- report.message(MessageId.OPF_036, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber()), mimeType);
+ report.message(MessageId.OPF_036, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber()), mimeType);
}
}
else if (("source".compareTo(tagName) == 0) && ("audio".compareTo(tagStack.peek()) == 0))
@@ -215,9 +214,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
mimeType = "null";
}
- report.message(MessageId.OPF_056, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber()), mimeType);
+ report.message(MessageId.OPF_056, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber()), mimeType);
}
}
else if (("ul".compareTo(tagName) == 0) || ("ol".compareTo(tagName) == 0) || ("Dl".compareTo(tagName) == 0))
@@ -246,15 +243,13 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
mark = new ControlMark();
mark.controlId = id;
}
- mark.location = new MessageLocation(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), id);
+ mark.location = EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), id);
mark.mark |= HAS_INPUT;
formInputMarks.put(id, mark);
}
else if (type == null || "submit".compareToIgnoreCase(type) != 0) // submit buttons don't need a label
{
- report.message(MessageId.HTM_028, new MessageLocation(this.fileName,
- locator.getLineNumber(),
- locator.getColumnNumber()), tagName);
+ report.message(MessageId.HTM_028, EPUBLocation.create(this.fileName, locator.getLineNumber(), locator.getColumnNumber()), tagName);
}
}
else if ("label".compareTo(tagName) == 0)
@@ -271,16 +266,14 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
// only set the location if we are creating the entry here. This location will be overwritten
// by the input control location, but if there is no input that overrides it, the label location will
// be the one reported.
- mark.location = new MessageLocation(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), id);
+ mark.location = EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), id);
}
mark.mark |= HAS_LABEL;
formInputMarks.put(id, mark);
}
else
{
- report.message(MessageId.HTM_029, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), tagName));
+ report.message(MessageId.HTM_029, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
else if ("form".compareTo(tagName) == 0)
@@ -292,9 +285,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
String ns = attributes.getValue("xmlns");
if (ns == null || EpubConstants.HtmlNamespaceUri.compareTo(ns) != 0)
{
- report.message(MessageId.HTM_049, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), tagName));
+ report.message(MessageId.HTM_049, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
else if ("body".compareTo(tagName) == 0)
@@ -332,11 +323,9 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
hasViewport = true;
String contentAttribute = attributes.getValue("content");
- if (contentAttribute == null || !(contentAttribute.contains("width") && contentAttribute.contains("height")))
+ if (isFixed && (contentAttribute == null || !(contentAttribute.contains("width") && contentAttribute.contains("height"))))
{
- report.message(MessageId.HTM_047, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), tagName));
+ report.message(MessageId.HTM_047, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
}
@@ -344,7 +333,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
if (inBlockQuote || inFigure)
{
- report.message(MessageId.ACC_010, new MessageLocation(getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
+ report.message(MessageId.ACC_010, EPUBLocation.create(getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
@@ -352,18 +341,14 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
if (null != this.getFileName() && null == attributes.getValue("alt"))
{
- report.message(MessageId.ACC_001, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), tagName));
+ report.message(MessageId.ACC_001, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
if (nonTextTagsTitle.contains(tagName))
{
if (null != this.getFileName() && null == attributes.getValue("title"))
{
- report.message(MessageId.ACC_003, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), tagName));
+ report.message(MessageId.ACC_003, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), tagName));
}
}
String epubPrefix = namespaceHelper.findPrefixForUri(EpubConstants.EpubTypeNamespaceUri);
@@ -374,9 +359,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
if (typeAttr.contains("pagebreak"))
{
- report.message(MessageId.HTM_050, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(), "pagebreak"));
+ report.message(MessageId.HTM_050, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), "pagebreak"));
}
}
}
@@ -398,10 +381,7 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
if (count < 1)
{
report.message(MessageId.HTM_027,
- new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber(),
- qName)
+ EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber(), qName)
);
}
}
@@ -424,15 +404,11 @@ public class HTMLTagsAnalyseHandler extends DefaultHandler
{
if (!hasTitle)
{
- report.message(MessageId.HTM_033, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber()));
+ report.message(MessageId.HTM_033, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber()));
}
if (isFixed() && !hasViewport)
{
- report.message(MessageId.HTM_046, new MessageLocation(this.getFileName(),
- locator.getLineNumber(),
- locator.getColumnNumber()));
+ report.message(MessageId.HTM_046, EPUBLocation.create(this.getFileName(), locator.getLineNumber(), locator.getColumnNumber()));
}
}
else if ("blockquote".compareTo(tagName) == 0)
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java b/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java
index 4abacd4..e51da8f 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java
@@ -1,15 +1,17 @@
package com.adobe.epubcheck.ctc.xml;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.LocationImpl;
+
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.stream.Location;
+
import java.util.Vector;
public class LinkTagHandler extends DefaultHandler
@@ -53,10 +55,10 @@ public class LinkTagHandler extends DefaultHandler
{
if (firstOne != null)
{
- report.message(MessageId.CSS_012, new MessageLocation(fileName, firstOne.getLocation().getLineNumber(), firstOne.getLocation().getColumnNumber(), firstOne.getHrefAttribute()));
+ report.message(MessageId.CSS_012, EPUBLocation.create(fileName, firstOne.getLocation().getLineNumber(), firstOne.getLocation().getColumnNumber(), firstOne.getHrefAttribute()));
firstOne = null;
}
- report.message(MessageId.CSS_012, new MessageLocation(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
+ report.message(MessageId.CSS_012, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
}
}
@@ -65,11 +67,11 @@ public class LinkTagHandler extends DefaultHandler
String title = linkTag.getTitleAttribute();
if (title == null || title.trim().equals(""))
{
- report.message(MessageId.CSS_015, new MessageLocation(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
+ report.message(MessageId.CSS_015, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
}
if (styleSheetsCount == 0)
{
- report.message(MessageId.CSS_016, new MessageLocation(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
+ report.message(MessageId.CSS_016, EPUBLocation.create(fileName, linkTag.getLocation().getLineNumber(), linkTag.getLocation().getColumnNumber(), linkTag.getHrefAttribute()));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java b/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java
index 4708ef1..9323f50 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java
@@ -10,9 +10,9 @@ import org.xml.sax.Locator;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ops.OPSHandler30;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
@@ -79,7 +79,7 @@ public class ScriptTagHandler extends DefaultHandler
inScript = true;
if (this.version == EPUBVersion.VERSION_2)
{
- report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), qName));
+ report.message(MessageId.SCP_004, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), qName));
}
ScriptElement scriptElement = new ScriptElement();
boolean isExternal = false;
@@ -116,10 +116,10 @@ public class ScriptTagHandler extends DefaultHandler
this.inlineScriptCount++;
if (this.version == EPUBVersion.VERSION_2)
{
- report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
+ report.message(MessageId.SCP_004, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
report.message(MessageId.SCP_006,
- new MessageLocation(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
+ EPUBLocation.create(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
String attrValue = attributes.getValue(i);
CheckForInner(attrValue);
@@ -128,10 +128,10 @@ public class ScriptTagHandler extends DefaultHandler
{
if (this.version == EPUBVersion.VERSION_2)
{
- report.message(MessageId.SCP_004, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
+ report.message(MessageId.SCP_004, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
report.message(MessageId.SCP_009,
- new MessageLocation(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
+ EPUBLocation.create(this.fileName, locator.getLineNumber(), locator.getColumnNumber(), attrName));
}
}
}
@@ -164,12 +164,12 @@ public class ScriptTagHandler extends DefaultHandler
int column = lower.indexOf("innerhtml");
if (column >= 0)
{
- report.message(MessageId.SCP_007, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, column)));
+ report.message(MessageId.SCP_007, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, column)));
}
column = lower.indexOf("innertext");
if (column >= 0)
{
- report.message(MessageId.SCP_008, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, column)));
+ report.message(MessageId.SCP_008, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, column)));
}
@@ -182,28 +182,28 @@ public class ScriptTagHandler extends DefaultHandler
m = evalPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_001, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
+ report.message(MessageId.SCP_001, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
}
}
m = localStoragePattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_003, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
+ report.message(MessageId.SCP_003, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
}
m = sessionStoragePattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_003, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
+ report.message(MessageId.SCP_003, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
}
m = xmlHttpRequestPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_002, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
+ report.message(MessageId.SCP_002, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
}
m = microsoftXmlHttpRequestPattern.matcher(script);
if (m.find())
{
- report.message(MessageId.SCP_002, new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
+ report.message(MessageId.SCP_002, EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), trimContext(script, m.start())));
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java b/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java
index 9fec118..7f60f76 100644
--- a/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java
+++ b/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java
@@ -1,16 +1,5 @@
package com.adobe.epubcheck.ctc.xml;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.EncryptionFilter;
-import org.xml.sax.SAXException;
-import org.xml.sax.XMLReader;
-import org.xml.sax.helpers.DefaultHandler;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -19,6 +8,19 @@ import java.util.Hashtable;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.DefaultHandler;
+
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.ocf.EncryptionFilter;
+
public class XMLContentDocParser
{
@@ -64,15 +66,15 @@ public class XMLContentDocParser
message = message.substring(0, message.indexOf("("));
}
message = message.trim();
- report.message(MessageId.RSC_001, new MessageLocation(fileEntry, -1, -1), message);
+ report.message(MessageId.RSC_001, EPUBLocation.create(fileEntry), message);
}
catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(fileEntry, -1, -1), fileEntry);
+ report.message(MessageId.PKG_008, EPUBLocation.create(fileEntry), fileEntry);
}
catch (SAXException e)
{
- report.message(MessageId.RSC_005, new MessageLocation(fileEntry, -1, -1), e.getMessage());
+ report.message(MessageId.RSC_005, EPUBLocation.create(fileEntry), e.getMessage());
}
catch (ParserConfigurationException e)
{
diff --git a/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java b/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
index cc7686a..edd27e2 100755
--- a/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
+++ b/src/main/java/com/adobe/epubcheck/dtbook/DTBookChecker.java
@@ -22,85 +22,49 @@
package com.adobe.epubcheck.dtbook;
-import java.io.IOException;
-import java.io.InputStream;
-
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Preconditions;
public class DTBookChecker implements ContentChecker
{
- private final OCFPackage ocf;
-
+ private final ValidationContext context;
private final Report report;
-
private final String path;
- private final XRefChecker xrefChecker;
-
- private final EPUBVersion version;
-
- public DTBookChecker(OCFPackage ocf, Report report, String path,
- XRefChecker xrefChecker, EPUBVersion version)
+ public DTBookChecker(ValidationContext context)
{
- this.ocf = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.version = version;
+ Preconditions.checkState("application/x-dtbook+xml".equals(context.mimeType));
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
}
public void runChecks()
{
+ OCFPackage ocf = context.ocf.get();
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
}
else
{
- XMLParser dtbookParser;
- InputStream in = null;
- try
- {
- in = ocf.getInputStream(path);
- dtbookParser = new XMLParser(ocf, in, path,
- "application/x-dtbook+xml", report, version);
- dtbookParser.addValidator(XMLValidators.DTBOOK_RNG.get());
- DTBookHandler dtbookHandler = new DTBookHandler(dtbookParser, path,
- xrefChecker);
- dtbookParser.addXMLHandler(dtbookHandler);
- dtbookParser.process();
- }
- catch (IOException e)
- {
- throw new RuntimeException(e);
- }
- finally
- {
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (IOException ignored)
- {
- // eat it
- }
- }
+ XMLParser dtbookParser = new XMLParser(context);
+ dtbookParser.addValidator(XMLValidators.DTBOOK_RNG.get());
+ DTBookHandler dtbookHandler = new DTBookHandler(dtbookParser, path, context.xrefChecker.get());
+ dtbookParser.addXMLHandler(dtbookHandler);
+ dtbookParser.process();
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java b/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java
index 23ecdce..a8c80eb 100755
--- a/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/dtbook/DTBookCheckerFactory.java
@@ -22,22 +22,15 @@
package com.adobe.epubcheck.dtbook;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.opf.ValidationContext;
public class DTBookCheckerFactory implements ContentCheckerFactory
{
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public ContentChecker newInstance(ValidationContext context)
{
- return new DTBookChecker(ocf, report, path, xrefChecker, version);
+ return new DTBookChecker(context);
}
static private final DTBookCheckerFactory instance = new DTBookCheckerFactory();
diff --git a/src/main/java/com/adobe/epubcheck/dtbook/DTBookHandler.java b/src/main/java/com/adobe/epubcheck/dtbook/DTBookHandler.java
index 52215d9..880b627 100755
--- a/src/main/java/com/adobe/epubcheck/dtbook/DTBookHandler.java
+++ b/src/main/java/com/adobe/epubcheck/dtbook/DTBookHandler.java
@@ -22,16 +22,20 @@
package com.adobe.epubcheck.dtbook;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.ops.OPSHandler;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.HandlerUtil;
import com.adobe.epubcheck.util.PathUtil;
+import com.adobe.epubcheck.util.URISchemes;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLHandler;
import com.adobe.epubcheck.xml.XMLParser;
+import com.google.common.base.Preconditions;
public class DTBookHandler implements XMLHandler
{
@@ -72,57 +76,56 @@ public class DTBookHandler implements XMLHandler
if (ns.equals("http://www.daisy.org/z3986/2005/dtbook/"))
{
// link at href, a at href, img at src
- String uri = null;
+ String href = null;
/*
- * This section checks to see if the references used are registered
- * schema-types and whether they point to external resources. The
- * resources are only allowed to be external if the attribute
- * "external" is set to true.
- */
+ * This section checks to see if the references used are registered
+ * schema-types and whether they point to external resources. The
+ * resources are only allowed to be external if the attribute "external"
+ * is set to true.
+ */
if (name.equals("a"))
{
- uri = e.getAttribute("href");
+ href = e.getAttribute("href");
String external = e.getAttribute("external");
- if (uri != null && external.equals("true"))
+ if (href != null && external.equals("true"))
{
- if (OPSHandler.isRegisteredSchemeType(uri))
+ URI uri = checkURI(href);
+ if (uri != null && URISchemes.contains(uri.getScheme()))
{
- uri = null;
+ href = null;
}
- else if (uri.indexOf(':') > 0)
+ else if (uri.getScheme() != null)
{
parser.getReport().message(MessageId.OPF_021,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- uri);
- uri = null;
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), href);
+ href = null;
}
}
}
else if (name.equals("link"))
{
- uri = e.getAttribute("href");
+ href = e.getAttribute("href");
}
else if (name.equals("img"))
{
- uri = e.getAttribute("src");
+ href = e.getAttribute("src");
}
- if (uri != null)
+ if (href != null)
{
- //TODO check if dtbook uses xml:base of so set third param
- uri = PathUtil.resolveRelativeReference(path, uri, null);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), uri,
- name.equals("img") ? XRefChecker.RT_IMAGE
- : XRefChecker.RT_HYPERLINK);
- if (uri.startsWith("http"))
+ // TODO check if dtbook uses xml:base of so set third param
+ href = PathUtil.resolveRelativeReference(path, href, null);
+ xrefChecker.registerReference(path, parser.getLineNumber(), parser.getColumnNumber(), href,
+ name.equals("img") ? XRefChecker.Type.IMAGE : XRefChecker.Type.HYPERLINK);
+ URI uri = checkURI(href);
+ if (uri != null && "http".equals(uri.getScheme()))
{
- parser.getReport().info(path, FeatureEnum.REFERENCE, uri);
+ parser.getReport().info(path, FeatureEnum.REFERENCE, href);
}
}
if (id != null)
{
- xrefChecker.registerAnchor(path, parser.getLineNumber(),
- parser.getColumnNumber(), id, XRefChecker.RT_HYPERLINK);
+ xrefChecker.registerAnchor(path, parser.getLineNumber(), parser.getColumnNumber(), id,
+ XRefChecker.Type.HYPERLINK);
}
}
@@ -137,4 +140,18 @@ public class DTBookHandler implements XMLHandler
{
// do nothing
}
+
+ // TODO duplicated from OPSHandler
+ // should be in a URI utils class
+ private URI checkURI(String uri)
+ {
+ try
+ {
+ return new URI(Preconditions.checkNotNull(uri).trim());
+ } catch (URISyntaxException e)
+ {
+ parser.getReport().message(MessageId.RSC_020, parser.getLocation(), uri);
+ return null;
+ }
+ }
}
diff --git a/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java b/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java
index b4fe16e..1f193ea 100644
--- a/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java
+++ b/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java
@@ -21,6 +21,7 @@ import java.util.ResourceBundle.Control;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.outWriter;
@@ -50,8 +51,8 @@ public class MessageDictionary
}
Map<MessageId, Message> messages = new HashMap<MessageId, Message>();
- static final ResourceBundle labels = ResourceBundle.getBundle("com.adobe.epubcheck.messages.MessageBundle",
- Locale.getDefault(), new UTF8Control());
+ static final ResourceBundle labels = ResourceBundle.getBundle(
+ "com.adobe.epubcheck.messages.MessageBundle", Locale.getDefault(), new UTF8Control());
public Message getMessage(MessageId id)
{
@@ -64,7 +65,7 @@ public class MessageDictionary
{
Map<MessageId, Severity> map = new HashMap<MessageId, Severity>(MessageId.values().length);
- //Accessibility
+ // Accessibility
map.put(MessageId.ACC_001, Severity.USAGE);
map.put(MessageId.ACC_002, Severity.USAGE);
map.put(MessageId.ACC_003, Severity.SUPPRESSED);
@@ -92,7 +93,7 @@ public class MessageDictionary
map.put(MessageId.CHK_006, Severity.ERROR);
map.put(MessageId.CHK_007, Severity.ERROR);
- //CSS
+ // CSS
map.put(MessageId.CSS_001, Severity.ERROR);
map.put(MessageId.CSS_002, Severity.ERROR);
map.put(MessageId.CSS_003, Severity.ERROR);
@@ -102,7 +103,7 @@ public class MessageDictionary
map.put(MessageId.CSS_007, Severity.WARNING);
map.put(MessageId.CSS_008, Severity.ERROR);
map.put(MessageId.CSS_009, Severity.USAGE);
- map.put(MessageId.CSS_010, Severity.WARNING);
+ map.put(MessageId.CSS_010, Severity.ERROR);
map.put(MessageId.CSS_011, Severity.SUPPRESSED);
map.put(MessageId.CSS_012, Severity.USAGE);
map.put(MessageId.CSS_013, Severity.USAGE);
@@ -119,7 +120,7 @@ public class MessageDictionary
map.put(MessageId.CSS_027, Severity.USAGE);
map.put(MessageId.CSS_028, Severity.USAGE);
- //HTML
+ // HTML
map.put(MessageId.HTM_001, Severity.ERROR);
map.put(MessageId.HTM_002, Severity.WARNING);
map.put(MessageId.HTM_003, Severity.ERROR);
@@ -160,8 +161,10 @@ public class MessageDictionary
map.put(MessageId.HTM_048, Severity.ERROR);
map.put(MessageId.HTM_049, Severity.ERROR);
map.put(MessageId.HTM_050, Severity.USAGE);
+ map.put(MessageId.HTM_051, Severity.WARNING);
+ map.put(MessageId.HTM_052, Severity.ERROR);
- //Media
+ // Media
map.put(MessageId.MED_001, Severity.ERROR);
map.put(MessageId.MED_002, Severity.ERROR);
map.put(MessageId.MED_003, Severity.ERROR);
@@ -169,18 +172,26 @@ public class MessageDictionary
map.put(MessageId.MED_005, Severity.ERROR);
map.put(MessageId.MED_006, Severity.USAGE);
- //NAV
+ // NAV
map.put(MessageId.NAV_001, Severity.ERROR);
map.put(MessageId.NAV_002, Severity.USAGE);
- map.put(MessageId.NAV_003, Severity.SUPPRESSED);
-
- //NCX
+ map.put(MessageId.NAV_003, Severity.ERROR);
+ map.put(MessageId.NAV_004, Severity.USAGE);
+ map.put(MessageId.NAV_005, Severity.USAGE);
+ map.put(MessageId.NAV_006, Severity.USAGE);
+ map.put(MessageId.NAV_007, Severity.USAGE);
+ map.put(MessageId.NAV_008, Severity.USAGE);
+ map.put(MessageId.NAV_009, Severity.ERROR);
+
+ // NCX
+ map.put(MessageId.NCX_001, Severity.USAGE);
map.put(MessageId.NCX_002, Severity.ERROR);
map.put(MessageId.NCX_003, Severity.USAGE);
+ map.put(MessageId.NCX_004, Severity.USAGE);
map.put(MessageId.NCX_005, Severity.USAGE);
map.put(MessageId.NCX_006, Severity.USAGE);
- //OPF
+ // OPF
map.put(MessageId.OPF_001, Severity.ERROR);
map.put(MessageId.OPF_002, Severity.FATAL);
map.put(MessageId.OPF_003, Severity.WARNING);
@@ -195,7 +206,7 @@ public class MessageDictionary
map.put(MessageId.OPF_006, Severity.ERROR);
map.put(MessageId.OPF_007, Severity.WARNING);
map.put(MessageId.OPF_007a, Severity.ERROR);
- map.put(MessageId.OPF_007b, Severity.ERROR);
+ map.put(MessageId.OPF_007b, Severity.WARNING);
map.put(MessageId.OPF_008, Severity.ERROR);
map.put(MessageId.OPF_009, Severity.ERROR);
map.put(MessageId.OPF_010, Severity.ERROR);
@@ -210,8 +221,6 @@ public class MessageDictionary
map.put(MessageId.OPF_019, Severity.FATAL);
map.put(MessageId.OPF_020, Severity.SUPPRESSED);
map.put(MessageId.OPF_021, Severity.WARNING);
- map.put(MessageId.OPF_022, Severity.ERROR);
- map.put(MessageId.OPF_024, Severity.ERROR);
map.put(MessageId.OPF_025, Severity.ERROR);
map.put(MessageId.OPF_026, Severity.ERROR);
map.put(MessageId.OPF_027, Severity.ERROR);
@@ -243,7 +252,7 @@ public class MessageDictionary
map.put(MessageId.OPF_053, Severity.WARNING);
map.put(MessageId.OPF_054, Severity.ERROR);
map.put(MessageId.OPF_055, Severity.WARNING);
- map.put(MessageId.OPF_056, Severity.WARNING);
+ map.put(MessageId.OPF_056, Severity.USAGE);
map.put(MessageId.OPF_057, Severity.SUPPRESSED);
map.put(MessageId.OPF_058, Severity.USAGE);
map.put(MessageId.OPF_059, Severity.USAGE);
@@ -251,8 +260,29 @@ public class MessageDictionary
map.put(MessageId.OPF_061, Severity.WARNING);
map.put(MessageId.OPF_062, Severity.USAGE);
map.put(MessageId.OPF_063, Severity.WARNING);
-
- //PKG
+ map.put(MessageId.OPF_064, Severity.INFO);
+ map.put(MessageId.OPF_065, Severity.ERROR);
+ map.put(MessageId.OPF_066, Severity.ERROR);
+ map.put(MessageId.OPF_067, Severity.ERROR);
+ map.put(MessageId.OPF_068, Severity.ERROR);
+ map.put(MessageId.OPF_069, Severity.ERROR);
+ map.put(MessageId.OPF_070, Severity.WARNING);
+ map.put(MessageId.OPF_071, Severity.ERROR);
+ map.put(MessageId.OPF_072, Severity.USAGE);
+ map.put(MessageId.OPF_073, Severity.ERROR);
+ map.put(MessageId.OPF_074, Severity.ERROR);
+ map.put(MessageId.OPF_075, Severity.ERROR);
+ map.put(MessageId.OPF_076, Severity.ERROR);
+ map.put(MessageId.OPF_077, Severity.WARNING);
+ map.put(MessageId.OPF_078, Severity.ERROR);
+ map.put(MessageId.OPF_079, Severity.WARNING);
+ map.put(MessageId.OPF_080, Severity.WARNING);
+ map.put(MessageId.OPF_081, Severity.ERROR);
+ map.put(MessageId.OPF_082, Severity.ERROR);
+ map.put(MessageId.OPF_083, Severity.ERROR);
+ map.put(MessageId.OPF_084, Severity.ERROR);
+
+ // PKG
map.put(MessageId.PKG_001, Severity.WARNING);
map.put(MessageId.PKG_003, Severity.ERROR);
map.put(MessageId.PKG_004, Severity.FATAL);
@@ -273,8 +303,9 @@ public class MessageDictionary
map.put(MessageId.PKG_020, Severity.ERROR);
map.put(MessageId.PKG_021, Severity.ERROR);
map.put(MessageId.PKG_022, Severity.WARNING);
+ map.put(MessageId.PKG_023, Severity.USAGE);
- //Resources
+ // Resources
map.put(MessageId.RSC_001, Severity.ERROR);
map.put(MessageId.RSC_002, Severity.FATAL);
map.put(MessageId.RSC_003, Severity.ERROR);
@@ -282,10 +313,11 @@ public class MessageDictionary
map.put(MessageId.RSC_005, Severity.ERROR);
map.put(MessageId.RSC_006, Severity.ERROR);
map.put(MessageId.RSC_007, Severity.ERROR);
+ map.put(MessageId.RSC_007w, Severity.WARNING);
map.put(MessageId.RSC_008, Severity.ERROR);
map.put(MessageId.RSC_009, Severity.ERROR);
map.put(MessageId.RSC_010, Severity.ERROR);
- map.put(MessageId.RSC_011, Severity.WARNING);
+ map.put(MessageId.RSC_011, Severity.ERROR);
map.put(MessageId.RSC_012, Severity.ERROR);
map.put(MessageId.RSC_013, Severity.ERROR);
map.put(MessageId.RSC_014, Severity.ERROR);
@@ -293,8 +325,12 @@ public class MessageDictionary
map.put(MessageId.RSC_016, Severity.FATAL);
map.put(MessageId.RSC_017, Severity.WARNING);
map.put(MessageId.RSC_018, Severity.WARNING);
+ map.put(MessageId.RSC_019, Severity.WARNING);
+ map.put(MessageId.RSC_020, Severity.ERROR);
+ map.put(MessageId.RSC_021, Severity.ERROR);
+ map.put(MessageId.RSC_022, Severity.INFO);
- //Scripting
+ // Scripting
map.put(MessageId.SCP_001, Severity.USAGE);
map.put(MessageId.SCP_002, Severity.USAGE);
map.put(MessageId.SCP_003, Severity.USAGE);
@@ -361,10 +397,10 @@ public class MessageDictionary
try
{
id = MessageId.fromString(fields[0]);
- }
- catch (NoSuchElementException unused)
+ } catch (NoSuchElementException unused)
{
- report.message(MessageId.CHK_002, new MessageLocation("", lineNumber, 0), fields[0], PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
+ report.message(MessageId.CHK_002, EPUBLocation.create("", lineNumber, 0), fields[0],
+ PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
continue;
}
@@ -374,10 +410,10 @@ public class MessageDictionary
{
columnNumber += 1 + fields[0].length();
newSeverity = Severity.fromString(fields[1]);
- }
- catch (NoSuchElementException ignored)
+ } catch (NoSuchElementException ignored)
{
- report.message(MessageId.CHK_003, new MessageLocation("", lineNumber, columnNumber), fields[1], PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
+ report.message(MessageId.CHK_003, EPUBLocation.create("", lineNumber, columnNumber),
+ fields[1], PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
continue;
}
@@ -386,10 +422,12 @@ public class MessageDictionary
if (fields.length >= 3 && fields[2] != null && fields[2].length() > 0)
{
columnNumber += 1 + fields[1].length();
- messageText = checkMessageForParameterCount(lineNumber, columnNumber, message.getMessage(), fields[2]);
+ messageText = checkMessageForParameterCount(lineNumber, columnNumber,
+ message.getMessage(), fields[2]);
if (messageText == null)
{
- report.message(MessageId.CHK_004, new MessageLocation("", lineNumber, 0, fields[2]), PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
+ report.message(MessageId.CHK_004, EPUBLocation.create("", lineNumber, 0, fields[2]),
+ PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
continue;
}
}
@@ -398,7 +436,8 @@ public class MessageDictionary
Severity oldSeverity = getDefaultSeverities().get(message.getID());
if (newSeverity != oldSeverity)
{
- messageText = String.format(" (severity overridden from %1$s) %2$s", oldSeverity, messageText);
+ messageText = String.format(" (severity overridden from %1$s) %2$s", oldSeverity,
+ messageText);
}
}
@@ -406,34 +445,34 @@ public class MessageDictionary
if (fields.length >= 4 && fields[3] != null && fields[3].length() > 0)
{
columnNumber += 1 + fields[1].length();
- suggestionText = checkMessageForParameterCount(lineNumber, columnNumber, message.getSuggestion(), fields[3]);
+ suggestionText = checkMessageForParameterCount(lineNumber, columnNumber,
+ message.getSuggestion(), fields[3]);
if (suggestionText == null)
{
- report.message(MessageId.CHK_005, new MessageLocation("", lineNumber, 0, fields[3]), PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
+ report.message(MessageId.CHK_005, EPUBLocation.create("", lineNumber, 0, fields[3]),
+ PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()));
continue;
}
}
- if (message != null &&
- ((newSeverity != message.getSeverity()) ||
- (messageText.compareTo(message.getMessage()) != 0) ||
- (suggestionText.compareTo(message.getSuggestion()) != 0)))
+ if (message != null && ((newSeverity != message.getSeverity())
+ || (messageText.compareTo(message.getMessage()) != 0)
+ || (suggestionText.compareTo(message.getSuggestion()) != 0)))
{
- messages.put(id, new Message(message.getID(), newSeverity, message.getSeverity(), messageText, suggestionText));
+ messages.put(id, new Message(message.getID(), newSeverity, message.getSeverity(),
+ messageText, suggestionText));
}
}
++lineNumber;
}
- }
- catch (FileNotFoundException fnf)
+ } catch (FileNotFoundException fnf)
{
- report.message(MessageId.CHK_001, new MessageLocation(overrideFile.getAbsolutePath(), -1, -1));
- }
- catch (IOException ex)
+ report.message(MessageId.CHK_001, EPUBLocation.create(overrideFile.getAbsolutePath()));
+ } catch (IOException ex)
{
- report.message(MessageId.CHK_007, new MessageLocation("", lineNumber, columnNumber), PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()), ex.getMessage());
- }
- finally
+ report.message(MessageId.CHK_007, EPUBLocation.create("", lineNumber, columnNumber),
+ PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()), ex.getMessage());
+ } finally
{
try
{
@@ -445,15 +484,15 @@ public class MessageDictionary
{
fis.close();
}
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
}
}
- String checkMessageForParameterCount(int lineNumber, int columnNumber, String originalText, String newText)
+ String checkMessageForParameterCount(int lineNumber, int columnNumber, String originalText,
+ String newText)
{
if (newText != null)
{
@@ -485,11 +524,13 @@ public class MessageDictionary
{
max = number;
}
- }
- catch (NumberFormatException ex)
+ } catch (NumberFormatException ex)
{
- String pathAdjustedFileName = PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath());
- report.message(MessageId.CHK_006, new MessageLocation("", lineNumber, absoluteColumnNumber, text), pathAdjustedFileName);
+ String pathAdjustedFileName = PathUtil
+ .removeWorkingDirectory(overrideFile.getAbsolutePath());
+ report.message(MessageId.CHK_006,
+ EPUBLocation.create("", lineNumber, absoluteColumnNumber, text),
+ pathAdjustedFileName);
}
}
}
@@ -500,9 +541,9 @@ public class MessageDictionary
{
try
{
- messages.put(messageId, new Message(messageId, severity, labels.getString(messageId.name()), getSuggestion(messageId)));
- }
- catch (Exception e)
+ messages.put(messageId, new Message(messageId, severity, labels.getString(messageId.name()),
+ getSuggestion(messageId)));
+ } catch (Exception e)
{
outWriter.println("Couldn't locate message " + messageId.name());
}
@@ -514,16 +555,15 @@ public class MessageDictionary
try
{
result = labels.getString(messageId.name() + "_SUG");
- }
- catch (Exception ignore)
+ } catch (Exception ignore)
{
result = "";
}
return result;
}
- public void dumpMessages(OutputStreamWriter outputStream) throws
- IOException
+ public void dumpMessages(OutputStreamWriter outputStream)
+ throws IOException
{
// Output the messages in a tab separated format
outputStream.write("ID\tSeverity\tMessage\tSuggestion\n");
@@ -552,12 +592,11 @@ public class MessageDictionary
private static class UTF8Control extends Control
{
- public ResourceBundle newBundle
- (String baseName, Locale locale, String format, ClassLoader loader, boolean reload)
- throws
- IllegalAccessException,
- InstantiationException,
- IOException
+ public ResourceBundle newBundle(String baseName, Locale locale, String format,
+ ClassLoader loader, boolean reload)
+ throws IllegalAccessException,
+ InstantiationException,
+ IOException
{
// The below is a copy of the default implementation.
String bundleName = toBundleName(baseName, locale);
@@ -585,12 +624,11 @@ public class MessageDictionary
{
try
{
- // Only this line is changed to make it to read properties files as UTF-8.
+ // Only this line is changed to make it to read properties files as
+ // UTF-8.
bundle = new PropertyResourceBundle(
- new BufferedReader(
- new InputStreamReader(stream, Charsets.UTF_8)));
- }
- finally
+ new BufferedReader(new InputStreamReader(stream, Charsets.UTF_8)));
+ } finally
{
stream.close();
}
diff --git a/src/main/java/com/adobe/epubcheck/messages/MessageId.java b/src/main/java/com/adobe/epubcheck/messages/MessageId.java
index e111a65..65ca93d 100644
--- a/src/main/java/com/adobe/epubcheck/messages/MessageId.java
+++ b/src/main/java/com/adobe/epubcheck/messages/MessageId.java
@@ -124,6 +124,8 @@ public enum MessageId implements Comparable<MessageId>
HTM_048("HTM-048"),
HTM_049("HTM-049"),
HTM_050("HTM-050"),
+ HTM_051("HTM-051"),
+ HTM_052("HTM-052"),
// Messages associated with media (images, audio and video)
MED_001("MED-001"),
@@ -137,10 +139,18 @@ public enum MessageId implements Comparable<MessageId>
NAV_001("NAV-001"),
NAV_002("NAV-002"),
NAV_003("NAV-003"),
+ NAV_004("NAV-004"),
+ NAV_005("NAV-005"),
+ NAV_006("NAV-006"),
+ NAV_007("NAV-007"),
+ NAV_008("NAV-008"),
+ NAV_009("NAV-009"),
// Epub2 based table of content messages
+ NCX_001("NCX-001"),
NCX_002("NCX-002"),
NCX_003("NCX-003"),
+ NCX_004("NCX-004"),
NCX_005("NCX-005"),
NCX_006("NCX-006"),
@@ -174,8 +184,6 @@ public enum MessageId implements Comparable<MessageId>
OPF_019("OPF-019"),
OPF_020("OPF-020"),
OPF_021("OPF-021"),
- OPF_022("OPF-022"),
- OPF_024("OPF-024"),
OPF_025("OPF-025"),
OPF_026("OPF-026"),
OPF_027("OPF-027"),
@@ -215,6 +223,27 @@ public enum MessageId implements Comparable<MessageId>
OPF_061("OPF-061"),
OPF_062("OPF-062"),
OPF_063("OPF-063"),
+ OPF_064("OPF-064"),
+ OPF_065("OPF-065"),
+ OPF_066("OPF-066"),
+ OPF_067("OPF-067"),
+ OPF_068("OPF-068"),
+ OPF_069("OPF-069"),
+ OPF_070("OPF-070"),
+ OPF_071("OPF-071"),
+ OPF_072("OPF-072"),
+ OPF_073("OPF-073"),
+ OPF_074("OPF-074"),
+ OPF_075("OPF-075"),
+ OPF_076("OPF-076"),
+ OPF_077("OPF-077"),
+ OPF_078("OPF-078"),
+ OPF_079("OPF-079"),
+ OPF_080("OPF-080"),
+ OPF_081("OPF-081"),
+ OPF_082("OPF-082"),
+ OPF_083("OPF-083"),
+ OPF_084("OPF-084"),
// Messages relating to the entire package
PKG_001("PKG-001"),
@@ -237,6 +266,7 @@ public enum MessageId implements Comparable<MessageId>
PKG_020("PKG-020"),
PKG_021("PKG-021"),
PKG_022("PKG-022"),
+ PKG_023("PKG-023"),
// Messages relating to resources
RSC_001("RSC-001"),
@@ -246,6 +276,7 @@ public enum MessageId implements Comparable<MessageId>
RSC_005("RSC-005"),
RSC_006("RSC-006"),
RSC_007("RSC-007"),
+ RSC_007w("RSC-007w"),
RSC_008("RSC-008"),
RSC_009("RSC-009"),
RSC_010("RSC-010"),
@@ -257,6 +288,10 @@ public enum MessageId implements Comparable<MessageId>
RSC_016("RSC-016"),
RSC_017("RSC-017"),
RSC_018("RSC-018"),
+ RSC_019("RSC-019"),
+ RSC_020("RSC-020"),
+ RSC_021("RSC-021"),
+ RSC_022("RSC-022"),
// Messages relating to scripting
SCP_001("SCP-001"),
@@ -270,7 +305,6 @@ public enum MessageId implements Comparable<MessageId>
SCP_009("SCP-009"),
SCP_010("SCP-010");
-
private final String messageId;
MessageId(String feature)
diff --git a/src/main/java/com/adobe/epubcheck/messages/MessageLocation.java b/src/main/java/com/adobe/epubcheck/messages/MessageLocation.java
deleted file mode 100644
index cef6892..0000000
--- a/src/main/java/com/adobe/epubcheck/messages/MessageLocation.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package com.adobe.epubcheck.messages;
-
-import org.codehaus.jackson.annotate.JsonProperty;
-
-public class MessageLocation implements Comparable<MessageLocation>
-{
- @JsonProperty
- private String fileName;
- @JsonProperty
- private final int line;
- @JsonProperty
- private final int column;
- @JsonProperty
- private final String context;
-
- public MessageLocation(String fileName, int lineNumber, int column)
- {
- this(fileName, lineNumber, column, null);
- }
-
- public MessageLocation(String fileName, int lineNumber, int column, String context)
- {
- this.fileName = fileName;
- this.line = lineNumber;
- this.column = column;
- this.context = context;
- }
-
- public String getFileName()
- {
- return this.fileName == null ? "" : this.fileName;
- }
-
- public void setFileName(String value)
- {
- this.fileName = value;
- }
-
- public int getLine()
- {
- return this.line;
- }
-
- public int getColumn()
- {
- return this.column;
- }
-
- public String getContext()
- {
- return this.context;
- }
-
- @Override
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj == null || obj.getClass() != this.getClass())
- {
- return false;
- }
-
- MessageLocation other = (MessageLocation) obj;
- return !(this.getContext() == null && other.getContext() != null) && this.getFileName().equals(other.getFileName()) && this.getLine() == other.getLine() && this.getColumn() == other.getColumn() && (this.getContext() == null || this.getContext().equals(other.getContext()));
- }
-
- int safeCompare(String a, String b)
- {
- if (a == null && b != null) return -1;
- if (a != null && b == null) return 1;
- if (a == null /* && b == null */) return 0;
- return a.compareTo(b);
- }
-
-
- @Override
- public int compareTo(MessageLocation o)
- {
- int comp = safeCompare(this.fileName, o.fileName);
- if (comp != 0)
- {
- return comp;
- }
-
- comp = line - o.line;
- if (comp != 0)
- {
- return comp < 0 ? -1 : 1;
- }
-
- comp = column - o.column;
- if (comp != 0)
- {
- return comp < 0 ? -1 : 1;
- }
- comp = safeCompare(context, o.context);
- if (comp != 0)
- {
- return comp;
- }
-
- return 0;
- }
-}
diff --git a/src/main/java/com/adobe/epubcheck/nav/NavChecker.java b/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
index e074dee..26c01b2 100644
--- a/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
+++ b/src/main/java/com/adobe/epubcheck/nav/NavChecker.java
@@ -22,80 +22,78 @@
package com.adobe.epubcheck.nav;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Set;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+import static com.google.common.base.Predicates.*;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.ops.OPSHandler30;
+import com.adobe.epubcheck.opf.OPFData;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.util.ValidatorMap;
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
+import com.adobe.epubcheck.vocab.PackageVocabs;
import com.adobe.epubcheck.xml.XMLHandler;
import com.adobe.epubcheck.xml.XMLParser;
+import com.adobe.epubcheck.xml.XMLValidator;
import com.adobe.epubcheck.xml.XMLValidators;
-import com.google.common.collect.ImmutableSet;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
public class NavChecker implements ContentChecker, DocumentValidator
{
- private OCFPackage ocf;
+
+ @SuppressWarnings("unchecked")
+ private final static ValidatorMap validatorMap = ValidatorMap.builder()
+ .putAll(XMLValidators.NAV_30_RNC, XMLValidators.XHTML_30_SCH, XMLValidators.NAV_30_SCH)
+ .putAll(and(Predicates.or(profile(EPUBProfile.EDUPUB), hasPubType(OPFData.DC_TYPE_EDUPUB)),
+ not(
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.FIXED_LAYOUT))),
+ not(hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.NON_LINEAR)))),
+ XMLValidators.XHTML_EDUPUB_STRUCTURE_SCH, XMLValidators.XHTML_EDUPUB_SEMANTICS_SCH,
+ XMLValidators.XHTML_IDX_SCH)
+ .putAll(
+ and(or(profile(EPUBProfile.DICT), hasPubType(OPFData.DC_TYPE_DICT)),
+ mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_DICT_SCH)
+ .putAll(
+ and(or(profile(EPUBProfile.IDX), hasPubType(OPFData.DC_TYPE_INDEX),
+ hasProp(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.INDEX)),
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.IN_INDEX_COLLECTION))),
+ mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_IDX_SCH, XMLValidators.XHTML_IDX_INDEX_SCH)
+ .build();
+
+ private final ValidationContext context;
private final Report report;
private final String path;
- private XRefChecker xrefChecker;
- private final String properties;
- private final String mimeType;
- private final EPUBVersion version;
- private final GenericResourceProvider resourceProvider;
- private final Set<String> pubTypes;
- public NavChecker(GenericResourceProvider resourceProvider, Report report,
- String path, String mimeType, EPUBVersion version)
+ public NavChecker(ValidationContext context)
{
- if (version == EPUBVersion.VERSION_2)
+ Preconditions.checkState("application/xhtml+xml".equals(context.mimeType));
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
+ if (context.version == EPUBVersion.VERSION_2)
{
- report.message(MessageId.NAV_001, new MessageLocation(path, 0, 0));
+ context.report.message(MessageId.NAV_001, EPUBLocation.create(path));
}
- this.report = report;
- this.path = path;
- this.resourceProvider = resourceProvider;
- this.properties = "singleFileValidation";
- this.mimeType = mimeType;
- this.version = version;
- this.pubTypes = ImmutableSet.of();
- }
-
- public NavChecker(OCFPackage ocf, Report report, String path,
- String mimeType, String properties, XRefChecker xrefChecker, EPUBVersion version, Set<String> pubTypes)
- {
- if (version == EPUBVersion.VERSION_2)
- {
- report.message(MessageId.NAV_001, new MessageLocation(path, 0, 0));
- }
- this.ocf = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.resourceProvider = ocf;
- this.properties = properties;
- this.mimeType = mimeType;
- this.version = version;
- this.pubTypes = pubTypes;
}
+ @Override
public void runChecks()
{
- if (!ocf.hasEntry(path))
+ if (!context.ocf.get().hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(context.ocf.get().getName()), path);
}
- else if (!ocf.canDecrypt(path))
+ else if (!context.ocf.get().canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(context.ocf.get().getName()), path);
}
else
{
@@ -108,40 +106,17 @@ public class NavChecker implements ContentChecker, DocumentValidator
int fatalErrors = report.getFatalErrorCount();
int errors = report.getErrorCount();
int warnings = report.getWarningCount();
- InputStream in = null;
- try
- {
- in = resourceProvider.getInputStream(path);
- XMLParser navParser = new XMLParser(ocf, in, path,
- "application/xhtml+xml", report, version);
+ XMLParser navParser = new XMLParser(context);
- XMLHandler navHandler = new OPSHandler30(ocf, path, mimeType,
- properties, xrefChecker, navParser, report, version, pubTypes);
- navParser.addXMLHandler(navHandler);
- navParser.addValidator(XMLValidators.NAV_30_RNC.get());
- navParser.addValidator(XMLValidators.XHTML_30_SCH.get());
- navParser.addValidator(XMLValidators.NAV_30_SCH.get());
- navParser.process();
- }
- catch (IOException e)
- {
- report.message(MessageId.PKG_008, new MessageLocation(path, -1, -1), path);
- }
- finally
+ XMLHandler navHandler = new NavHandler(context, navParser);
+ navParser.addXMLHandler(navHandler);
+ for (XMLValidator validator : validatorMap.getValidators(context))
{
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (IOException ignored)
- {
- // eat it
- }
+ navParser.addValidator(validator);
}
+ navParser.process();
- return ((fatalErrors == report.getFatalErrorCount()) && (errors == report.getErrorCount()) && (warnings == report.getWarningCount()));
+ return ((fatalErrors == report.getFatalErrorCount()) && (errors == report.getErrorCount())
+ && (warnings == report.getWarningCount()));
}
}
diff --git a/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java b/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java
index c27e278..e74f65b 100644
--- a/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/nav/NavCheckerFactory.java
@@ -22,27 +22,17 @@
package com.adobe.epubcheck.nav;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.opf.ValidationContext;
public class NavCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
{
static private final NavCheckerFactory instance = new NavCheckerFactory();
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public NavChecker newInstance(ValidationContext context)
{
- return new NavChecker(ocf, report, path, mimeType, properties, xrefChecker, version, types);
+ return new NavChecker(context);
}
static public NavCheckerFactory getInstance()
@@ -50,10 +40,4 @@ public class NavCheckerFactory implements ContentCheckerFactory, DocumentValidat
return instance;
}
- public DocumentValidator newInstance(Report report, String path,
- GenericResourceProvider resourceProvider, String mimeType,
- EPUBVersion version)
- {
- return new NavChecker(resourceProvider, report, path, mimeType, version);
- }
}
diff --git a/src/main/java/com/adobe/epubcheck/nav/NavHandler.java b/src/main/java/com/adobe/epubcheck/nav/NavHandler.java
new file mode 100644
index 0000000..9cdc9d4
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/nav/NavHandler.java
@@ -0,0 +1,75 @@
+package com.adobe.epubcheck.nav;
+
+import java.util.Set;
+
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.ops.OPSHandler30;
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.adobe.epubcheck.vocab.StructureVocab.EPUB_TYPES;
+import com.adobe.epubcheck.xml.XMLElement;
+import com.adobe.epubcheck.xml.XMLParser;
+
+public class NavHandler extends OPSHandler30
+{
+
+ private boolean inToc = false;
+
+ NavHandler(ValidationContext context, XMLParser parser)
+ {
+ super(context, parser);
+ }
+
+ @Override
+ public void startElement()
+ {
+ super.startElement();
+ XMLElement e = parser.getCurrentElement();
+ String name = e.getName();
+ if (inToc && "a".equals(name))
+ {
+ context.featureReport.report(FeatureEnum.TOC_LINKS, parser.getLocation());
+ }
+ }
+
+ @Override
+ public void endElement()
+ {
+ super.endElement();
+ XMLElement e = parser.getCurrentElement();
+ String name = e.getName();
+ if (inToc && "nav".equals(name))
+ {
+ inToc = false;
+ }
+ }
+
+ protected void checkTypes(Set<EPUB_TYPES> types)
+ {
+ super.checkTypes(types);
+ if (types.contains(EPUB_TYPES.TOC))
+ {
+ inToc = true;
+ }
+ if (types.contains(EPUB_TYPES.PAGE_LIST))
+ {
+ context.featureReport.report(FeatureEnum.PAGE_LIST, parser.getLocation());
+ }
+ if (types.contains(EPUB_TYPES.LOI))
+ {
+ context.featureReport.report(FeatureEnum.LOI, parser.getLocation());
+ }
+ if (types.contains(EPUB_TYPES.LOT))
+ {
+ context.featureReport.report(FeatureEnum.LOT, parser.getLocation());
+ }
+ if (types.contains(EPUB_TYPES.LOA))
+ {
+ context.featureReport.report(FeatureEnum.LOA, parser.getLocation());
+ }
+ if (types.contains(EPUB_TYPES.LOV))
+ {
+ context.featureReport.report(FeatureEnum.LOV, parser.getLocation());
+ }
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java b/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
index 4d1389a..96fa15a 100755
--- a/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java
@@ -22,100 +22,67 @@
package com.adobe.epubcheck.ncx;
-import java.io.IOException;
-import java.io.InputStream;
-
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
-import com.adobe.epubcheck.opf.XRefChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Preconditions;
public class NCXChecker implements ContentChecker
{
- private final OCFPackage ocf;
+ private final ValidationContext context;
private final Report report;
private final String path;
- private final XRefChecker xrefChecker;
- private final EPUBVersion version;
- public NCXChecker(OCFPackage ocf, Report report, String path,
- XRefChecker xrefChecker, EPUBVersion version)
+ public NCXChecker(ValidationContext context)
{
- this.ocf = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.version = version;
+ Preconditions.checkState("application/x-dtbncx+xml".equals(context.mimeType));
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
}
public void runChecks()
{
+ OCFPackage ocf = context.ocf.get();
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
}
else
{
// relaxng
XMLParser ncxParser;
NCXHandler ncxHandler;
- InputStream in;
- try
- {
- in = ocf.getInputStream(path);
- }
- catch (IOException e)
- {
- in = null;
- }
- if (in == null)
- {
- return;
- }
- ncxParser = new XMLParser(ocf, in, path, "application/x-dtbncx+xml", report, version);
+ ncxParser = new XMLParser(context);
ncxParser.addValidator(XMLValidators.NCX_RNG.get());
- ncxHandler = new NCXHandler(ncxParser, path, xrefChecker);
+ ncxParser.addValidator(XMLValidators.NCX_SCH.get());
+ ncxHandler = new NCXHandler(ncxParser, path, context.xrefChecker.get());
ncxParser.addXMLHandler(ncxHandler);
ncxParser.process();
-
- if (ocf.getUniqueIdentifier() != null && !ocf.getUniqueIdentifier().equals(ncxHandler.getUid()))
- {
- report.message(MessageId.NCX_003,
- new MessageLocation(path, ncxParser.getLineNumber(), ncxParser.getColumnNumber(), String.format("%1$s: %2$s", ncxHandler.getUid(), ocf.getUniqueIdentifier())));
- }
-
-
- try
- {
- in = ocf.getInputStream(path);
- }
- catch (IOException e)
- {
- in = null;
- }
- if (in != null)
+ if (context.version == EPUBVersion.VERSION_2)
{
- ncxParser = new XMLParser(ocf, in, path, "application/x-dtbncx+xml", report, version);
- ncxParser.addValidator(XMLValidators.NCX_SCH.get());
- ncxParser.process();
- try
+ String ncxId = ncxHandler.getUid();
+ if (ncxId != null && !ncxId.equals(ncxId.trim()))
{
- in.close();
+ report.message(MessageId.NCX_004, ncxParser.getLocation());
}
- catch (IOException ignored)
+ // FIXME improve way to get this EPUB 2's single OPF
+ String uid = ocf.getOpfData().values().iterator().next().getUniqueIdentifier();
+ if (uid != null && ncxId != null && !uid.equals(ncxId.trim()))
{
- // eat it
+ report.message(MessageId.NCX_001, ncxParser.getLocation(), ncxHandler.getUid(), uid);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java b/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java
index c1ab665..99a9eb4 100755
--- a/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/ncx/NCXCheckerFactory.java
@@ -22,24 +22,17 @@
package com.adobe.epubcheck.ncx;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.opf.ValidationContext;
public class NCXCheckerFactory implements ContentCheckerFactory
{
static private final NCXCheckerFactory instance = new NCXCheckerFactory();
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public ContentChecker newInstance(ValidationContext context)
{
- return new NCXChecker(ocf, report, path, xrefChecker, version);
+ return new NCXChecker(context);
}
static public NCXCheckerFactory getInstance()
diff --git a/src/main/java/com/adobe/epubcheck/ncx/NCXHandler.java b/src/main/java/com/adobe/epubcheck/ncx/NCXHandler.java
index 14cf1c0..38595b5 100755
--- a/src/main/java/com/adobe/epubcheck/ncx/NCXHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ncx/NCXHandler.java
@@ -22,6 +22,7 @@
package com.adobe.epubcheck.ncx;
+import com.adobe.epubcheck.messages.MessageId;
import com.adobe.epubcheck.opf.XRefChecker;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.HandlerUtil;
@@ -46,8 +47,19 @@ public class NCXHandler implements XMLHandler
this.xrefChecker = xrefChecker;
}
- public void characters(char[] chars, int arg1, int arg2)
+ public void characters(char[] chars, int start, int len)
{
+
+ XMLElement e = parser.getCurrentElement();
+ String name = e.getName();
+ String ns = e.getNamespace();
+ boolean keepValue = ("http://www.daisy.org/z3986/2005/ncx/".equals(ns) && "text".equals(name));
+ if (keepValue)
+ {
+ String val = (String) e.getPrivateData();
+ String text = new String(chars, start, len);
+ e.setPrivateData((val == null) ? text : val + text);
+ }
}
public void ignorableWhitespace(char[] chars, int arg1, int arg2)
@@ -65,46 +77,60 @@ public class NCXHandler implements XMLHandler
XMLElement e = parser.getCurrentElement();
String ns = e.getNamespace();
String name = e.getName();
- if (ns.equals("http://www.daisy.org/z3986/2005/ncx/") && name.equals("content"))
+ if (ns.equals("http://www.daisy.org/z3986/2005/ncx/"))
{
- String href = e.getAttribute("src");
- if (href != null)
+ if ("content".equals(name))
{
- href = PathUtil.resolveRelativeReference(path, href, null);
- if (href.startsWith("http"))
+ String href = e.getAttribute("src");
+ if (href != null)
{
- parser.getReport().info(path, FeatureEnum.REFERENCE, href);
+ href = PathUtil.resolveRelativeReference(path, href, null);
+ if (href.startsWith("http:"))
+ {
+ parser.getReport().info(path, FeatureEnum.REFERENCE, href);
+ }
+ xrefChecker.registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.HYPERLINK);
}
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href,
- XRefChecker.RT_HYPERLINK);
}
else if ("meta".equals(name))
{
- String metaName = e.getAttribute("name");
- if ("dtb:uid".equals(metaName))
+ String metaName = e.getAttribute("name");
+ if ("dtb:uid".equals(metaName))
{
- String metaContent = e.getAttribute("content");
- if (metaContent != null)
- {
- uid = metaContent;
- }
- }
+ uid = e.getAttribute("content");
+ }
}
}
}
public void endElement()
{
+ XMLElement e = parser.getCurrentElement();
+ String ns = e.getNamespace();
+ String name = e.getName();
+ if (ns.equals("http://www.daisy.org/z3986/2005/ncx/"))
+ {
+ if ("text".equals(name))
+ {
+ String text = (String) e.getPrivateData();
+ if (text == null || text.trim().isEmpty())
+ {
+ parser.getReport().message(MessageId.NCX_006, parser.getLocation());
+ }
+ }
+ }
}
- public void processingInstruction(String arg0, String arg1){}
+ public void processingInstruction(String arg0, String arg1)
+ {
+ }
- /**
- * @return the uid
- */
- public String getUid()
+ /**
+ * @return the uid
+ */
+ public String getUid()
{
- return uid;
+ return uid;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java b/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
index ed781a7..5680a9e 100755
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java
@@ -22,73 +22,101 @@
package com.adobe.epubcheck.ocf;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+
import java.io.IOException;
import java.io.InputStream;
import java.text.Normalizer;
import java.text.Normalizer.Form;
import java.text.SimpleDateFormat;
import java.util.Date;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
+import com.adobe.epubcheck.api.FeatureReport;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFChecker;
-import com.adobe.epubcheck.opf.OPFChecker30;
+import com.adobe.epubcheck.opf.OPFCheckerFactory;
import com.adobe.epubcheck.opf.OPFData;
import com.adobe.epubcheck.opf.OPFHandler;
+import com.adobe.epubcheck.opf.OPFHandler30;
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.CheckUtil;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
-import com.adobe.epubcheck.util.OPSType;
-import com.adobe.epubcheck.xml.XMLHandler;
+import com.adobe.epubcheck.util.ValidatorMap;
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidator;
import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
public class OCFChecker
{
- private final OCFPackage ocf;
- private Report report;
- private final EPUBVersion version;
- // Hashtable encryptedItems;
- // private EPUBVersion version = EPUBVersion.VERSION_3;
-
- private static final HashMap<OPSType, XMLValidator> xmlValidatorMap;
-
- static
- {
- HashMap<OPSType, XMLValidator> map = new HashMap<OPSType, XMLValidator>();
- map.put(new OPSType(OCFData.containerEntry, EPUBVersion.VERSION_2), XMLValidators.CONTAINER_20_RNG.get());
- map.put(new OPSType(OCFData.containerEntry, EPUBVersion.VERSION_3), XMLValidators.CONTAINER_30_RNC.get());
-
- map.put(new OPSType(OCFData.encryptionEntry, EPUBVersion.VERSION_2), XMLValidators.ENC_20_RNG.get());
- map.put(new OPSType(OCFData.encryptionEntry, EPUBVersion.VERSION_3), XMLValidators.ENC_30_RNC.get());
- map.put(new OPSType(OCFData.signatureEntry, EPUBVersion.VERSION_2), XMLValidators.SIG_20_RNG.get());
- map.put(new OPSType(OCFData.signatureEntry, EPUBVersion.VERSION_3), XMLValidators.SIG_30_RNC.get());
-
- xmlValidatorMap = map;
- }
+ @SuppressWarnings("unchecked")
+ private static final ValidatorMap validatorMap = ValidatorMap.builder()
+ .put(Predicates.and(path(OCFData.containerEntry), version(EPUBVersion.VERSION_2)),
+ XMLValidators.CONTAINER_20_RNG)
+ .put(Predicates.and(path(OCFData.containerEntry), version(EPUBVersion.VERSION_3)),
+ XMLValidators.CONTAINER_30_RNC)
+ .put(Predicates.and(path(OCFData.containerEntry), version(EPUBVersion.VERSION_3)),
+ XMLValidators.CONTAINER_30_RENDITIONS_SCH)
+ .put(Predicates.and(path(OCFData.encryptionEntry), version(EPUBVersion.VERSION_3)),
+ XMLValidators.ENC_30_RNC)
+ .put(Predicates.and(path(OCFData.encryptionEntry), version(EPUBVersion.VERSION_2)),
+ XMLValidators.ENC_20_RNG)
+ .put(Predicates.and(path(OCFData.signatureEntry), version(EPUBVersion.VERSION_2)),
+ XMLValidators.SIG_20_RNG)
+ .put(Predicates.and(path(OCFData.signatureEntry), version(EPUBVersion.VERSION_3)),
+ XMLValidators.SIG_30_RNC)
+ .put(
+ Predicates.and(path(OCFData.metadataEntry),
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.MULTIPLE_RENDITION))),
+ XMLValidators.META_30_RNC)
+ .put(
+ Predicates.and(path(OCFData.metadataEntry),
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.MULTIPLE_RENDITION))),
+ XMLValidators.META_30_SCH)
+ .put(Predicates.and(path(OCFData.metadataEntry),
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.MULTIPLE_RENDITION)),
+ profile(EPUBProfile.EDUPUB)), XMLValidators.META_EDUPUB_SCH)
+ .putAll(hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.RENDITION_MAPPING)),
+ XMLValidators.RENDITION_MAPPING_RNC, XMLValidators.RENDITION_MAPPING_SCH)
+ .build();
+
+ private final ValidationContext context;
+ private final OCFPackage ocf;
+ private final Report report;
- public OCFChecker(OCFPackage ocf, Report report, EPUBVersion version)
+ public OCFChecker(ValidationContext context)
{
- this.ocf = ocf;
- this.setReport(report);
- this.version = version;
+ Preconditions.checkState(context.ocf.isPresent());
+ this.context = context;
+ this.ocf = context.ocf.get();
+ this.report = context.report;
}
public void runChecks()
{
- ocf.setReport(getReport());
+ // Create a new validation context builder from the parent context
+ // It will be augmented with detected validation version, profile, etc.
+ ValidationContextBuilder newContextBuilder = new ValidationContextBuilder(context);
+
+ ocf.setReport(report);
if (!ocf.hasEntry(OCFData.containerEntry))
{
- getReport().message(MessageId.RSC_002, new MessageLocation(ocf.getName(), 0, 0));
+ report.message(MessageId.RSC_002, EPUBLocation.create(ocf.getName()));
return;
}
long l = ocf.getTimeEntry(OCFData.containerEntry);
@@ -96,22 +124,22 @@ public class OCFChecker
{
Date d = new Date(l);
String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'").format(d);
- getReport().info(OCFData.containerEntry, FeatureEnum.CREATION_DATE, formattedDate);
+ report.info(OCFData.containerEntry, FeatureEnum.CREATION_DATE, formattedDate);
}
- OCFData containerHandler = ocf.getOcfData();
+ OCFData containerData = ocf.getOcfData();
// retrieve the paths of root files
- List<String> opfPaths = containerHandler.getEntries(OPFData.OPF_MIME_TYPE);
+ List<String> opfPaths = containerData.getEntries(OPFData.OPF_MIME_TYPE);
if (opfPaths == null || opfPaths.isEmpty())
{
- getReport().message(MessageId.RSC_003, new MessageLocation(OCFData.containerEntry, -1, -1));
+ report.message(MessageId.RSC_003, EPUBLocation.create(OCFData.containerEntry));
return;
}
else if (opfPaths.size() > 0)
{
- if(opfPaths.size() > 1)
+ if (opfPaths.size() > 1)
{
- getReport().info(null, FeatureEnum.EPUB_RENDITIONS_COUNT, Integer.toString(opfPaths.size()));
+ report.info(null, FeatureEnum.EPUB_RENDITIONS_COUNT, Integer.toString(opfPaths.size()));
}
// test every element for empty or missing @full-path attribute
@@ -122,78 +150,123 @@ public class OCFChecker
if (opfPath == null)
{
++rootfileErrorCounter;
- getReport().message(MessageId.OPF_016, new MessageLocation(OCFData.containerEntry, -1, -1));
+ report.message(MessageId.OPF_016, EPUBLocation.create(OCFData.containerEntry));
}
else if (opfPath.isEmpty())
{
++rootfileErrorCounter;
- getReport().message(MessageId.OPF_017, new MessageLocation(OCFData.containerEntry, -1, -1));
- }
+ report.message(MessageId.OPF_017, EPUBLocation.create(OCFData.containerEntry));
+ }
else if (!ocf.hasEntry(opfPath))
{
- getReport().message(MessageId.OPF_002, new MessageLocation(OCFData.containerEntry, -1, -1), opfPath);
+ report.message(MessageId.OPF_002, EPUBLocation.create(OCFData.containerEntry), opfPath);
return;
}
}
- if(rootfileErrorCounter == opfPaths.size())
+ if (rootfileErrorCounter == opfPaths.size())
{
- // end validation at this point when @full-path attribute is missing in container.xml
- // otherwise, tons of errors would be thrown ("XYZ exists in the zip file, but is not declared in the OPF file")
+ // end validation at this point when @full-path attribute is missing in
+ // container.xml
+ // otherwise, tons of errors would be thrown
+ // ("XYZ exists in the zip file, but is not declared in the OPF file")
return;
}
}
-
+ //
+ // Compute the validation version
+ // ------------------------------
// Detect the version of the first root file
// and compare with the asked version (if set)
EPUBVersion detectedVersion = null;
- EPUBVersion validationVersion;
+ final EPUBVersion validationVersion;
OPFData opfData = ocf.getOpfData().get(opfPaths.get(0));
- if (opfData == null)
- return;// The error must have been reported during parsing
+ if (opfData == null) return;// The error must have been reported during
+ // parsing
detectedVersion = opfData.getVersion();
report.info(null, FeatureEnum.FORMAT_VERSION, detectedVersion.toString());
- assert (detectedVersion != null);
+ assert(detectedVersion != null);
- if (version != null && version != detectedVersion)
+ if (context.version != EPUBVersion.Unknown && context.version != detectedVersion)
{
- getReport().message(MessageId.PKG_001, new MessageLocation(opfPaths.get(0), -1, -1), version, detectedVersion);
+ report.message(MessageId.PKG_001, EPUBLocation.create(opfPaths.get(0)), context.version,
+ detectedVersion);
- validationVersion = version;
+ validationVersion = context.version;
}
else
{
validationVersion = detectedVersion;
}
+ newContextBuilder.version(validationVersion);
+
+ //
+ // Compute the validation profile
+ // ------------------------------
+ EPUBProfile validationProfile = context.profile;
+ // FIXME get profile from metadata.xml if available
+ if (validationVersion == EPUBVersion.VERSION_2 && validationProfile != EPUBProfile.DEFAULT)
+ {
+ // Validation profile is unsupported for EPUB 2.0
+ report.message(MessageId.PKG_023, EPUBLocation.create(opfPaths.get(0)));
+ }
+ else if (validationVersion == EPUBVersion.VERSION_3)
+ {
+ // Override the given validation profile depending on the primary OPF
+ // dc:type
+ validationProfile = EPUBProfile.makeOPFCompatible(validationProfile, opfData, opfPaths.get(0),
+ report);
+ }
+ newContextBuilder.profile(validationProfile);
+ //
+ // Check multiple renditions
+ // ------------------------------
// EPUB 2.0 says there SHOULD be only one OPS rendition
if (validationVersion == EPUBVersion.VERSION_2 && opfPaths.size() > 1)
{
- getReport().message(MessageId.PKG_013, new MessageLocation(OCFData.containerEntry, -1, -1));
+ report.message(MessageId.PKG_013, EPUBLocation.create(OCFData.containerEntry));
+ }
+ // EPUB 3.0 Multiple Renditions recommends the presence of a metadata file
+ if (validationVersion == EPUBVersion.VERSION_3 && opfPaths.size() > 1)
+ {
+ newContextBuilder
+ .addProperty(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.MULTIPLE_RENDITION));
+ if (!ocf.hasEntry(OCFData.metadataEntry))
+ {
+ report.message(MessageId.RSC_019, EPUBLocation.create(ocf.getName()));
+ }
+ if (containerData.getMapping().isPresent())
+ {
+ validateRenditionMapping(new ValidationContextBuilder(newContextBuilder.build())
+ .mimetype("application/xhtml+xml").path(containerData.getMapping().get())
+ .addProperty(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.RENDITION_MAPPING))
+ .build());
+ }
}
+ //
// Check the mimetype file
+ // ------------------------------
+ //
InputStream mimetype = null;
try
{
mimetype = ocf.getInputStream("mimetype");
StringBuilder sb = new StringBuilder(2048);
if (ocf.hasEntry("mimetype")
- && !CheckUtil.checkTrailingSpaces(mimetype,
- validationVersion, sb))
+ && !CheckUtil.checkTrailingSpaces(mimetype, validationVersion, sb))
{
- getReport().message(MessageId.PKG_007, new MessageLocation("mimetype", 0, 0));
+ report.message(MessageId.PKG_007, EPUBLocation.create("mimetype"));
}
if (sb.length() != 0)
{
- getReport().info(null, FeatureEnum.FORMAT_NAME, sb.toString().trim());
+ report.info(null, FeatureEnum.FORMAT_NAME, sb.toString().trim());
}
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
// missing file will be reported later
- }
- finally
+ } finally
{
try
{
@@ -201,74 +274,75 @@ public class OCFChecker
{
mimetype.close();
}
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
// eat it
}
}
- // Validate the OCF files against the schema definitions
- validate(validationVersion);
+ //
+ // Check the META-INF files
+ // ------------------------------
+ //
+ validateMetaFiles(newContextBuilder.mimetype("xml").build());
+ //
+ // Check each OPF (i.e. Rendition)
+ // -------------------------------
+ //
// Validate each OPF and keep a reference of the OPFHandler
List<OPFHandler> opfHandlers = new LinkedList<OPFHandler>();
for (String opfPath : opfPaths)
{
- OPFChecker opfChecker;
-
- if (validationVersion == EPUBVersion.VERSION_2)
- {
- opfChecker = new OPFChecker(ocf, getReport(), opfPath, validationVersion);
- }
- else
- {
- opfChecker = new OPFChecker30(ocf, getReport(), opfPath, validationVersion);
- }
+ OPFChecker opfChecker = OPFCheckerFactory.getInstance()
+ .newInstance(newContextBuilder.path(opfPath).mimetype(OPFData.OPF_MIME_TYPE)
+ .featureReport(new FeatureReport()).build());
opfChecker.runChecks();
opfHandlers.add(opfChecker.getOPFHandler());
}
-
-
- // Check all file and directory entries in the container
+ //
+ // Check container integrity
+ // -------------------------------
+ //
try
{
- Set<String> entriesSet = new HashSet<String>();
- Set<String> normalizedEntriesSet = new HashSet<String>();
- for (String entry : ocf.getFileEntries())
+ Set<String> entriesSet = new HashSet<String>();
+ Set<String> normalizedEntriesSet = new HashSet<String>();
+ for (final String entry : ocf.getFileEntries())
{
- if (!entriesSet.add(entry.toLowerCase(Locale.ENGLISH)))
+ if (!entriesSet.add(entry.toLowerCase(Locale.ENGLISH)))
{
- getReport().message(MessageId.OPF_060, new MessageLocation(ocf.getPackagePath(), 0, 0), entry);
+ report.message(MessageId.OPF_060, EPUBLocation.create(ocf.getPackagePath()), entry);
}
else if (!normalizedEntriesSet.add(Normalizer.normalize(entry, Form.NFC)))
{
- getReport().message(MessageId.OPF_061, new MessageLocation(ocf.getPackagePath(), 0, 0), entry);
+ report.message(MessageId.OPF_061, EPUBLocation.create(ocf.getPackagePath()), entry);
}
ocf.reportMetadata(entry, report);
- if (!entry.startsWith("META-INF/")
- && !entry.startsWith("META-INF\\")
- && !entry.equals("mimetype")
- && !containerHandler.getEntries().contains(entry))
- {
- boolean isDeclared = false;
- for (OPFHandler opfHandler : opfHandlers)
- {
- if (opfHandler.getItemByPath(entry) != null)
+ // if the entry is not in the whitelist (META-INF/* + mimetype)
+ // and not declared in (one of) the OPF document(s)
+ if (!entry.startsWith("META-INF/") && !entry.startsWith("META-INF\\")
+ && !entry.equals("mimetype") && !containerData.getEntries().contains(entry)
+ && !entry.equals(containerData.getMapping().orNull())
+ && !Iterables.tryFind(opfHandlers, new Predicate<OPFHandler>()
{
- isDeclared = true;
- break;
- }
- }
- if (!isDeclared)
- {
- report.message(MessageId.OPF_003, new MessageLocation(ocf.getName(), -1, -1), entry);
- }
+ @Override
+ public boolean apply(OPFHandler opfHandler)
+ {
+ // found if declared as an OPF item
+ // or in an EPUB 3 link element
+ return opfHandler.getItemByPath(entry).isPresent()
+ || (validationVersion == EPUBVersion.VERSION_3
+ && ((OPFHandler30) opfHandler).getLinkedResources().hasPath(entry));
+ }
+ }).isPresent())
+ {
+ report.message(MessageId.OPF_003, EPUBLocation.create(ocf.getName()), entry);
}
- OCFFilenameChecker.checkCompatiblyEscaped(entry, getReport(), validationVersion);
+ OCFFilenameChecker.checkCompatiblyEscaped(entry, report, validationVersion);
}
for (String directory : ocf.getDirectoryEntries())
@@ -284,117 +358,69 @@ public class OCFChecker
}
if (!hasContents)
{
- getReport().message(MessageId.PKG_014, new MessageLocation(ocf.getName(), -1, -1), directory);
+ report.message(MessageId.PKG_014, EPUBLocation.create(ocf.getName()), directory);
}
}
- }
- catch (IOException e)
+ } catch (IOException e)
{
- getReport().message(MessageId.PKG_015, new MessageLocation(ocf.getName(), -1, -1), e.getMessage());
+ report.message(MessageId.PKG_015, EPUBLocation.create(ocf.getName()), e.getMessage());
}
-
- Report r = getReport();
-
}
- boolean validate(EPUBVersion version)
+ private boolean validateMetaFiles(ValidationContext context)
{
- XMLParser parser;
- InputStream in = null;
- try
- {
- // validate container
- in = ocf.getInputStream(OCFData.containerEntry);
- parser = new XMLParser(ocf, in, OCFData.containerEntry, "xml", getReport(), version);
- XMLHandler handler = new OCFHandler(parser);
- parser.addXMLHandler(handler);
- parser.addValidator(xmlValidatorMap.get(new OPSType(OCFData.containerEntry, version)));
- parser.process();
- try
- {
- if (in != null)
- {
- in.close();
- in = null;
- }
- }
- catch (IOException ignored)
- {
- // eat it
- }
-
- // Validate encryption.xml
- if (ocf.hasEntry(OCFData.encryptionEntry))
- {
- in = ocf.getInputStream(OCFData.encryptionEntry);
- parser = new XMLParser(ocf, in, OCFData.encryptionEntry, "xml", getReport(), version);
- handler = new EncryptionHandler(ocf, parser);
- parser.addXMLHandler(handler);
- parser.addValidator(xmlValidatorMap.get(new OPSType(OCFData.encryptionEntry, version)));
- parser.process();
- try
- {
- if (in != null)
- {
- in.close();
- in = null;
- }
- }
- catch (IOException ignored)
- {
- // eat it
- }
- getReport().info(null, FeatureEnum.HAS_ENCRYPTION, OCFData.encryptionEntry);
- }
-
- // validate signatures.xml
- if (ocf.hasEntry(OCFData.signatureEntry))
- {
- in = ocf.getInputStream(OCFData.signatureEntry);
- parser = new XMLParser(ocf, in, OCFData.signatureEntry, "xml", getReport(), version);
- handler = new OCFHandler(parser);
- parser.addXMLHandler(handler);
- parser.addValidator(xmlValidatorMap.get(new OPSType(OCFData.signatureEntry, version)));
- parser.process();
- try
- {
- in.close();
- }
- catch (Exception ignored)
- {
- }
- getReport().info(null, FeatureEnum.HAS_SIGNATURES, OCFData.signatureEntry);
- }
+ // validate container
+ validateMetaFile(new ValidationContextBuilder(context).path(OCFData.containerEntry).build());
+ // Validate encryption.xml
+ if (ocf.hasEntry(OCFData.encryptionEntry))
+ {
+ validateMetaFile(new ValidationContextBuilder(context).path(OCFData.encryptionEntry).build());
+ report.info(null, FeatureEnum.HAS_ENCRYPTION, OCFData.encryptionEntry);
}
- catch (Exception ignored)
+
+ // validate signatures.xml
+ if (ocf.hasEntry(OCFData.signatureEntry))
{
+ validateMetaFile(new ValidationContextBuilder(context).path(OCFData.signatureEntry).build());
+ report.info(null, FeatureEnum.HAS_SIGNATURES, OCFData.signatureEntry);
}
- finally
+
+ // validate signatures.xml
+ if (ocf.hasEntry(OCFData.metadataEntry))
{
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (IOException ignored)
- {
- // eat it
- }
+ validateMetaFile(new ValidationContextBuilder(context).path(OCFData.metadataEntry).build());
}
return false;
}
- private Report getReport()
+ private void validateMetaFile(ValidationContext context)
{
- return report;
+ XMLParser parser = new XMLParser(context);
+ if (context.path.equals(OCFData.encryptionEntry))
+ {
+ parser.addXMLHandler(new EncryptionHandler(ocf, parser));
+ }
+ else
+ {
+ parser.addXMLHandler(new OCFHandler(parser));
+ }
+ for (XMLValidator validator : validatorMap.getValidators(context))
+ {
+ parser.addValidator(validator);
+ }
+ parser.process();
}
- private void setReport(Report report)
+ private void validateRenditionMapping(ValidationContext context)
{
- this.report = report;
+ XMLParser parser = new XMLParser(context);
+ for (XMLValidator validator : validatorMap.getValidators(context))
+ {
+ parser.addValidator(validator);
+ }
+ parser.process();
}
+
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFData.java b/src/main/java/com/adobe/epubcheck/ocf/OCFData.java
index 1b23e12..fbb8a23 100644
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFData.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFData.java
@@ -2,10 +2,13 @@ package com.adobe.epubcheck.ocf;
import java.util.List;
+import com.google.common.base.Optional;
+
public interface OCFData
{
static final String containerEntry = "META-INF/container.xml";
static final String encryptionEntry = "META-INF/encryption.xml";
+ static final String metadataEntry = "META-INF/metadata.xml";
static final String signatureEntry = "META-INF/signatures.xml";
/**
@@ -18,4 +21,10 @@ public interface OCFData
* @return the full paths of all the root files of the container
*/
public List<String> getEntries();
+
+ /**
+ * @return the full path of the Rendition Mapping Document, or
+ * {@link Optional#absent()} is no such document is declared.
+ */
+ public Optional<String> getMapping();
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java b/src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java
index d8337da..2765da9 100644
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFFilenameChecker.java
@@ -1,8 +1,8 @@
package com.adobe.epubcheck.ocf;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.EPUBVersion;
import java.util.HashSet;
@@ -43,7 +43,7 @@ public final class OCFFilenameChecker
if (str.endsWith("."))
{
- report.message(MessageId.PKG_011, new MessageLocation(str, 0, 0));
+ report.message(MessageId.PKG_011, EPUBLocation.create(str));
test += ".";
}
@@ -71,11 +71,11 @@ public final class OCFFilenameChecker
if (result.length() > 1)
{
result = result.substring(0, result.length() - 1);
- report.message(MessageId.PKG_009, new MessageLocation(str, 0, 0), result);
+ report.message(MessageId.PKG_009, EPUBLocation.create(str), result);
}
if (spaces)
{
- report.message(MessageId.PKG_010, new MessageLocation(str, 0, 0));
+ report.message(MessageId.PKG_010, EPUBLocation.create(str));
}
if (version == EPUBVersion.VERSION_3)
@@ -92,7 +92,7 @@ public final class OCFFilenameChecker
String nonAscii = str.replaceAll("[\\p{ASCII}]", "");
if (nonAscii.length() > 0)
{
- report.message(MessageId.PKG_012, new MessageLocation(str, 0, 0), nonAscii);
+ report.message(MessageId.PKG_012, EPUBLocation.create(str), nonAscii);
}
return nonAscii;
}
@@ -125,7 +125,7 @@ public final class OCFFilenameChecker
if (result.length() > 1)
{
result = result.substring(0, result.length() - 1);
- report.message(MessageId.PKG_009, new MessageLocation(str, 0, 0), result);
+ report.message(MessageId.PKG_009, EPUBLocation.create(str), result);
}
return test;
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFHandler.java b/src/main/java/com/adobe/epubcheck/ocf/OCFHandler.java
index 7a93218..f388e01 100755
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFHandler.java
@@ -22,18 +22,26 @@
package com.adobe.epubcheck.ocf;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
import com.adobe.epubcheck.util.HandlerUtil;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLHandler;
import com.adobe.epubcheck.xml.XMLParser;
-
-import java.util.*;
+import com.google.common.base.Optional;
+import com.google.common.base.Strings;
public class OCFHandler implements OCFData, XMLHandler
{
private final Map<String, List<String>> entries = new HashMap<String, List<String>>();
private final XMLParser parser;
+ private String mappingDoc = null;
private boolean checkedUnsupportedXmlVersion = false;
+
OCFHandler(XMLParser parser)
{
this.parser = parser;
@@ -63,6 +71,12 @@ public class OCFHandler implements OCFData, XMLHandler
return Collections.unmodifiableList(result);
}
+ @Override
+ public Optional<String> getMapping()
+ {
+ return Optional.fromNullable(mappingDoc);
+ }
+
public void startElement()
{
if (!checkedUnsupportedXmlVersion)
@@ -73,16 +87,26 @@ public class OCFHandler implements OCFData, XMLHandler
XMLElement e = parser.getCurrentElement();
String ns = e.getNamespace();
- if (e.getName().equals("rootfile") && ns != null
- && ns.equals("urn:oasis:names:tc:opendocument:xmlns:container"))
+ if ("urn:oasis:names:tc:opendocument:xmlns:container".equals(ns))
{
- String mediaType = (e.getAttribute("media-type") != null) ? e.getAttribute("media-type").trim() : "unknown";
- String fullPath = e.getAttribute("full-path");
- if (!entries.containsKey(mediaType))
+ if ("rootfile".equals(e.getName()))
+ {
+ String mediaType = (e.getAttribute("media-type") != null)
+ ? e.getAttribute("media-type").trim() : "unknown";
+ String fullPath = e.getAttribute("full-path");
+ if (!entries.containsKey(mediaType))
+ {
+ entries.put(mediaType, new LinkedList<String>());
+ }
+ entries.get(mediaType).add(fullPath);
+ }
+ else if ("link".equals(e.getName()))
{
- entries.put(mediaType, new LinkedList<String>());
+ if ("mapping".equals(Strings.nullToEmpty(e.getAttribute("rel")).trim()))
+ {
+ mappingDoc = e.getAttribute("href");
+ }
}
- entries.get(mediaType).add(fullPath);
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java b/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
index 339037c..2b809c2 100644
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java
@@ -9,17 +9,18 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFData;
import com.adobe.epubcheck.opf.OPFPeeker;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.GenericResourceProvider;
import com.adobe.epubcheck.util.InvalidVersionException;
import com.adobe.epubcheck.xml.XMLParser;
+import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
-import com.google.common.io.Closer;
public abstract class OCFPackage implements GenericResourceProvider
{
@@ -31,61 +32,43 @@ public abstract class OCFPackage implements GenericResourceProvider
@Override
public OCFData get()
{
- if (OCFPackage.this.reporter == null) {
- throw new IllegalStateException("Reporter has not been set");
- }
- try
- {
- XMLParser containerParser;
- Closer closer = Closer.create();
- try {
- InputStream in = closer.register(getInputStream(OCFData.containerEntry));
- containerParser = new XMLParser(OCFPackage.this, in,
- OCFData.containerEntry, "xml", reporter, null);
- OCFHandler containerHandler = new OCFHandler(containerParser);
- containerParser.addXMLHandler(containerHandler);
- containerParser.process();
- return containerHandler;
- } catch (Throwable e) {
- // ensure that any checked exception types other than IOException that could be thrown are
- // provided here, e.g. throw closer.rethrow(e, CheckedException.class);
- throw closer.rethrow(e);
- } finally {
- closer.close();
- }
- } catch (IOException e)
- {
- throw new RuntimeException(e);
- }
+ Preconditions.checkNotNull(reporter);
+ XMLParser containerParser = new XMLParser(new ValidationContextBuilder()
+ .path(OCFData.containerEntry).resourceProvider(OCFPackage.this).report(reporter)
+ .mimetype("xml").build());
+ OCFHandler containerHandler = new OCFHandler(containerParser);
+ containerParser.addXMLHandler(containerHandler);
+ containerParser.process();
+ return containerHandler;
}
});
-
- private final Supplier<Map<String, OPFData>> opfData = Suppliers.memoize(new Supplier<Map<String, OPFData>>(){
- @Override
- public Map<String, OPFData> get()
- {
- if (OCFPackage.this.reporter == null) {
- throw new IllegalStateException("Reporter has not been set");
- }
- Map<String, OPFData> result = new HashMap<String, OPFData>();
- for (String opfPath : ocfData.get().getEntries(OPFData.OPF_MIME_TYPE))
+
+ private final Supplier<Map<String, OPFData>> opfData = Suppliers
+ .memoize(new Supplier<Map<String, OPFData>>()
{
- OPFPeeker peeker = new OPFPeeker(opfPath, reporter, OCFPackage.this);
- try
- {
- result.put(opfPath, peeker.peek());
- } catch (InvalidVersionException e)
+ @Override
+ public Map<String, OPFData> get()
{
- reporter.message(MessageId.OPF_001, new MessageLocation(opfPath, -1, -1), e.getMessage());
+ Preconditions.checkNotNull(reporter);
+ Map<String, OPFData> result = new HashMap<String, OPFData>();
+ for (String opfPath : ocfData.get().getEntries(OPFData.OPF_MIME_TYPE))
+ {
+ OPFPeeker peeker = new OPFPeeker(opfPath, reporter, OCFPackage.this);
+ try
+ {
+ result.put(opfPath, peeker.peek());
+ } catch (InvalidVersionException e)
+ {
+ reporter.message(MessageId.OPF_001, EPUBLocation.create(opfPath),
+ e.getMessage());
+ } catch (IOException ignored)
+ {
+ // missing file will be reported later
+ }
+ }
+ return Collections.unmodifiableMap(result);
}
- catch (IOException ignored)
- {
- // missing file will be reported later
- }
- }
- return Collections.unmodifiableMap(result);
- }
- });
+ });
public OCFPackage()
{
@@ -97,15 +80,9 @@ public abstract class OCFPackage implements GenericResourceProvider
enc.put(name, encryptionFilter);
}
- public void setUniqueIdentifier(String idval) {
- uniqueIdentifier = idval;
- }
- public String getUniqueIdentifier() {
- return uniqueIdentifier;
- }
-
/**
- * @param name the name of a relative file that is possibly in the container
+ * @param name
+ * the name of a relative file that is possibly in the container
* @return true if the file is in the container, false otherwise
*/
public abstract boolean hasEntry(String name);
@@ -113,36 +90,39 @@ public abstract class OCFPackage implements GenericResourceProvider
public abstract long getTimeEntry(String name);
/**
- * @param name the name of a relative file to fetch from the container.
+ * @param name
+ * the name of a relative file to fetch from the container.
* @return an InputStream representing the data from the named file, possibly
* decrypted if an appropriate encryption filter has been set
*/
- public abstract InputStream getInputStream(String name) throws
- IOException;
+ public abstract InputStream getInputStream(String name)
+ throws IOException;
+
+ /**
+ * @return a list of all the entries in this container. May contain duplicate
+ * entries (which is invalid in EPUB).
+ * @throws IOException
+ */
+ public abstract List<String> getEntries()
+ throws IOException;
/**
- * @return a list of all the entries in this container. May contain duplicate entries (which is invalid in EPUB).
- * @throws IOException
- */
- public abstract List<String> getEntries() throws IOException;
-
- /**
* @return a set of relative file names of files in this container
* @throws IOException
*/
- public abstract Set<String> getFileEntries() throws
- IOException;
+ public abstract Set<String> getFileEntries()
+ throws IOException;
/**
* @return a set of relative directory entries in this container
* @throws IOException
*/
- public abstract Set<String> getDirectoryEntries() throws
- IOException;
-
+ public abstract Set<String> getDirectoryEntries()
+ throws IOException;
/**
- * @param fileName name of the file to test
+ * @param fileName
+ * name of the file to test
* @return true if I have an Encryption filter for this particular file.
*/
public boolean canDecrypt(String fileName)
@@ -152,11 +132,15 @@ public abstract class OCFPackage implements GenericResourceProvider
}
/**
- * This method parses the container entry and stores important data, but does /not/
- * validate the container against a schema definition.
- * <p>The parsed OCFData objects are memoized.</p>
- * <p>This OCFPackage's reporter is used to report any error that may occur the first time the
- * OCFData is parsed.</p>
+ * This method parses the container entry and stores important data, but does
+ * /not/ validate the container against a schema definition.
+ * <p>
+ * The parsed OCFData objects are memoized.
+ * </p>
+ * <p>
+ * This OCFPackage's reporter is used to report any error that may occur the
+ * first time the OCFData is parsed.
+ * </p>
*
*/
public OCFData getOcfData()
@@ -164,13 +148,17 @@ public abstract class OCFPackage implements GenericResourceProvider
return ocfData.get();
}
-
/**
- * This method parses the OPF root files contained in an OCFContainer and stores important data,
- * but does /not/ validate the OPF file against a schema definition.
- * <p>The parsed OPFData objects are memoized.</p>
- * <p>This OCFPackage's reporter is used to report any error that may occur the first time the
- * OPFData is parsed.</p>
+ * This method parses the OPF root files contained in an OCFContainer and
+ * stores important data, but does /not/ validate the OPF file against a
+ * schema definition.
+ * <p>
+ * The parsed OPFData objects are memoized.
+ * </p>
+ * <p>
+ * This OCFPackage's reporter is used to report any error that may occur the
+ * first time the OPFData is parsed.
+ * </p>
*
* @return an map with the OPF root files as keys and the OPFData as values.
*/
@@ -184,8 +172,9 @@ public abstract class OCFPackage implements GenericResourceProvider
public abstract String getName();
public abstract String getPackagePath();
-
- public void setReport(Report reporter) {
+
+ public void setReport(Report reporter)
+ {
this.reporter = reporter;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java b/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java
index cd8198d..18b609e 100644
--- a/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java
+++ b/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java
@@ -1,10 +1,5 @@
package com.adobe.epubcheck.ocf;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.util.FeatureEnum;
-
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
@@ -15,9 +10,15 @@ import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import java.util.TreeSet;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.util.FeatureEnum;
+
public class OCFZipPackage extends OCFPackage
{
@@ -38,8 +39,8 @@ public class OCFZipPackage extends OCFPackage
synchronized (zip)
{
allEntries = new LinkedList<String>();
- fileEntries = new HashSet<String>();
- dirEntries = new HashSet<String>();
+ fileEntries = new TreeSet<String>();
+ dirEntries = new TreeSet<String>();
try
{
@@ -138,15 +139,6 @@ public class OCFZipPackage extends OCFPackage
{
listEntries();
}
- HashSet<String> entryNames = new HashSet<String>();
- for (Enumeration<? extends ZipEntry> entries = zip.entries(); entries.hasMoreElements(); )
- {
- ZipEntry entry = entries.nextElement();
- if (!entry.isDirectory())
- {
- entryNames.add(entry.getName());
- }
- }
return Collections.unmodifiableSet(fileEntries);
}
}
@@ -189,7 +181,7 @@ public class OCFZipPackage extends OCFPackage
}
catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(fileName, -1, -1), fileName);
+ report.message(MessageId.PKG_008, EPUBLocation.create(fileName), fileName);
}
finally
{
diff --git a/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java
index 387f118..5645fc0 100755
--- a/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/opf/ContentCheckerFactory.java
@@ -22,15 +22,8 @@
package com.adobe.epubcheck.opf;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.util.EPUBVersion;
public interface ContentCheckerFactory
{
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> pubTypes);
+ public ContentChecker newInstance(ValidationContext context);
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java b/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java
index 2195466..bd0e779 100644
--- a/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java
+++ b/src/main/java/com/adobe/epubcheck/opf/DocumentValidatorFactory.java
@@ -22,13 +22,15 @@
package com.adobe.epubcheck.opf;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.GenericResourceProvider;
public interface DocumentValidatorFactory
{
- public DocumentValidator newInstance(Report report, String path,
- GenericResourceProvider resourceProvider, String mimeType,
- EPUBVersion version);
+ public DocumentValidator newInstance(ValidationContext context);
+// public DocumentValidator newInstance(Report report, String path,
+// GenericResourceProvider resourceProvider, String mimeType,
+// EPUBVersion version, EPUBProfile profile);
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java b/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java
index 270d104..03f5cc5 100755
--- a/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java
+++ b/src/main/java/com/adobe/epubcheck/opf/GenericContentChecker.java
@@ -22,9 +22,9 @@
package com.adobe.epubcheck.opf;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
public class GenericContentChecker implements ContentChecker
@@ -44,11 +44,11 @@ public class GenericContentChecker implements ContentChecker
{
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(this.ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(this.ocf.getName()), path);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java
index 2428640..17edc3a 100755
--- a/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/opf/GenericContentCheckerFactory.java
@@ -22,21 +22,13 @@
package com.adobe.epubcheck.opf;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.util.EPUBVersion;
-
public class GenericContentCheckerFactory implements ContentCheckerFactory
{
static private final GenericContentCheckerFactory instance = new GenericContentCheckerFactory();
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public ContentChecker newInstance(ValidationContext context)
{
- return new GenericContentChecker(ocf, report, path);
+ return new GenericContentChecker(context.ocf.get(), context.report, context.path);
}
static public GenericContentCheckerFactory getInstance()
diff --git a/src/main/java/com/adobe/epubcheck/opf/LinkedResource.java b/src/main/java/com/adobe/epubcheck/opf/LinkedResource.java
new file mode 100644
index 0000000..40c8981
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/LinkedResource.java
@@ -0,0 +1,159 @@
+package com.adobe.epubcheck.opf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import com.adobe.epubcheck.vocab.Property;
+import com.google.common.base.Optional;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Represents a linked resource in a Package Document, i.e. a resource
+ * referenced from a <code>link</code> element (either at the package level or
+ * in collections).
+ */
+public final class LinkedResource
+{
+
+ private final Optional<String> id;
+ private final String uri;
+ private final String path;
+ private final Set<Property> rel;
+ private final Optional<String> refines;
+ private final Optional<String> mimetype;
+
+ /**
+ * Returns an {@link Optional} containing the value of the ID of the
+ * <code>link</code> , or {@link Optional#absent()} if the element has no ID.
+ */
+ public Optional<String> getId()
+ {
+ return id;
+ }
+
+ /**
+ * Returns the URI of the linked resource as defined in the <code>href</code>
+ * attribute of the <code>link</code> element. Guaranteed non-null.
+ */
+ public String getURI()
+ {
+ return uri;
+ }
+
+ /**
+ * Returns the "path" of the linked resource, i.e. its URI minus a possible
+ * fragment. Guaranteed non-null.
+ */
+ public String getPath()
+ {
+ return path;
+ }
+
+ /**
+ * Returns the set of properties defining the nature of the resource, as
+ * defined in the <code>rel</code> attribute.
+ *
+ * @return the set of rel properties (may be empty for collection resources).
+ * Guaranteed non-null.
+ */
+ public Set<Property> getRel()
+ {
+ return rel;
+ }
+
+ /**
+ * Returns an {@link Optional} containing the value of the
+ * <code>refines</code> attribute of the <code>link</code> , or
+ * {@link Optional#absent()} if the element has no such attribute.
+ */
+ public Optional<String> getRefines()
+ {
+ return refines;
+ }
+
+ /**
+ * Returns an {@link Optional} containing the declared media type of this
+ * resource as specified in the <code>media-type</code> attribute, or
+ * {@link Optional#absent()} if the media type is not declared.
+ */
+ public Optional<String> getMimeType()
+ {
+ return mimetype;
+ }
+
+ private LinkedResource(Optional<String> id, String uri, String resource, Set<Property> rel,
+ Optional<String> refines, Optional<String> mimetype)
+ {
+ this.id = checkNotNull(id);
+ this.uri = checkNotNull(uri);
+ this.path = checkNotNull(resource);
+ this.rel = checkNotNull(rel);
+ this.refines = checkNotNull(refines);
+ this.mimetype = checkNotNull(mimetype);
+ }
+
+ /**
+ * A builder for {@link LinkedResource}.
+ */
+ public static final class Builder
+ {
+
+ private final String uri;
+ private String id = null;
+ private Set<Property> rel = null;
+ private String refines = null;
+ private String mimetype = null;
+
+ /**
+ * Creates a new builder for a resource of the given URI (must not be null).
+ */
+ public Builder(String uri)
+ {
+ this.uri = checkNotNull(uri).trim();
+ }
+
+ public Builder id(String id)
+ {
+ this.id = id;
+ return this;
+ }
+
+ public Builder rel(Set<Property> rel)
+ {
+ this.rel = rel;
+ return this;
+ }
+
+ public Builder refines(String refines)
+ {
+ this.refines = refines;
+ return this;
+ }
+
+ public Builder mimetype(String mimetype)
+ {
+ this.mimetype = mimetype;
+ return this;
+ }
+
+ /**
+ * Returns a newly created {@link LinkedResource}.
+ */
+ public LinkedResource build()
+ {
+ return new LinkedResource(optional(id), uri, uri.replaceFirst("#.*$", ""),
+ rel == null ? ImmutableSet.<Property> of() : ImmutableSet.copyOf(rel), optional(refines),
+ optional(mimetype));
+ }
+
+ // Returns an optional containing the given string
+ // or absent if the string is null or empty or space-only
+ private Optional<String> optional(String string)
+ {
+ return Optional.fromNullable(Strings.emptyToNull(Strings.nullToEmpty(id).trim()));
+ }
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/LinkedResources.java b/src/main/java/com/adobe/epubcheck/opf/LinkedResources.java
new file mode 100644
index 0000000..f534b6e
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/LinkedResources.java
@@ -0,0 +1,134 @@
+package com.adobe.epubcheck.opf;
+
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+
+import com.google.common.base.Optional;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+
+/**
+ * Represents a set of linked resources (i.e. resources defined by
+ * <code>link</code> elements in a Package Document), with predictable iteration
+ * order.
+ */
+public final class LinkedResources
+{
+
+ private final List<LinkedResource> resources;
+ private final Map<String, LinkedResource> resourcesById;
+ private final ListMultimap<String, LinkedResource> resourcesByPath;
+
+ /**
+ * Search the linked resource with the given ID.
+ *
+ * @param id
+ * the ID of the resource to search, can be <code>null</code>.
+ * @return An {@link Optional} containing the linked resource if found, or
+ * {@link Optional#absent()} if not found.
+ */
+ public Optional<LinkedResource> getById(String id)
+ {
+ return Optional.fromNullable(resourcesById.get(id));
+ }
+
+ /**
+ * Search the linked resource with the given path. All resource whose
+ * <code>href</code> URI minus fragment is equal to the given path are
+ * returned, in document order.
+ *
+ * @param path
+ * the URI (without fragment) of the resource to search, can be
+ * <code>null</code>.
+ * @return A list of linked resources referencing the resource at
+ * <code>path</code> or a fragment thereof ; an empty list is returned
+ * if no such resource is found.
+ */
+ public List<LinkedResource> getByPath(String path)
+ {
+ return resourcesByPath.get(path);
+ }
+
+ /**
+ * Returns the list of all linked resources in this set, in document order.
+ *
+ * @return the list of all linked resources in this set.
+ */
+ public List<LinkedResource> asList()
+ {
+ return resources;
+ }
+
+ /**
+ * Returns <code>true</code> if this set contains a linked resource
+ * referencing the given path (or fragment thereof).
+ */
+ public boolean hasPath(String path)
+ {
+ return !getByPath(path).isEmpty();
+ }
+
+ private LinkedResources(Iterable<LinkedResource> resources)
+ {
+ ImmutableList.Builder<LinkedResource> listBuilder = ImmutableList.builder();
+ ImmutableListMultimap.Builder<String, LinkedResource> byPathBuilder = ImmutableListMultimap
+ .builder();
+ Map<String, LinkedResource> byIdMap = Maps.newHashMap();
+ for (LinkedResource resource : resources)
+ {
+ listBuilder.add(resource);
+ byPathBuilder.put(resource.getPath(), resource);
+ if (resource.getId().isPresent()) byIdMap.put(resource.getId().get(), resource);
+ }
+ this.resources = listBuilder.build();
+ this.resourcesByPath = byPathBuilder.build();
+ this.resourcesById = ImmutableMap.copyOf(byIdMap);
+ }
+
+ /**
+ * Creates a new builder. Calling this method is identical to calling the
+ * empty {@link Builder} constructor.
+ *
+ * @return a newly created builder.
+ */
+ public static Builder builder()
+ {
+ return new Builder();
+ }
+
+ /**
+ * A builder for {@link LinkedResources}.
+ *
+ */
+ public static final class Builder
+ {
+ private final LinkedHashSet<LinkedResource> resources = Sets.newLinkedHashSet();
+
+ /**
+ * Add a new linked resource to this builder.
+ *
+ * @param resource
+ * the resource to add.
+ * @return this builder.
+ */
+ public Builder add(LinkedResource resource)
+ {
+ if (resource != null) resources.add(resource);
+ return this;
+ }
+
+ /**
+ * Returns a newly created set of linked resources.
+ */
+ public LinkedResources build()
+ {
+ return new LinkedResources(resources);
+ }
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/MetadataSet.java b/src/main/java/com/adobe/epubcheck/opf/MetadataSet.java
new file mode 100644
index 0000000..317f85d
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/MetadataSet.java
@@ -0,0 +1,560 @@
+package com.adobe.epubcheck.opf;
+
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Set;
+
+import com.adobe.epubcheck.vocab.Property;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.base.Strings;
+import com.google.common.base.Supplier;
+import com.google.common.base.Suppliers;
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.ImmutableSetMultimap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.LinkedListMultimap;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Multimap;
+import com.google.common.collect.SetMultimap;
+
+/**
+ * Represents a set of metadata as declared in the <code>metadata</code> element
+ * in an EPUB Publication document (OPF).
+ * <p>
+ * The graph of refines is resolved when building the metadata set.
+ * <p>
+ *
+ * @author Romain Deltour
+ *
+ */
+public final class MetadataSet
+{
+
+ // multimap of all metadata expressions, by property
+ private final SetMultimap<Property, Metadata> all;
+ // multimap of all metadata primary expressions, by property
+ private final SetMultimap<Property, Metadata> primary;
+ // multimap of metadata expressions refining a given ID
+ private final SetMultimap<String, Metadata> refiners;
+ // map of refining metadata to refined metadata
+ private final Map<Metadata, Metadata> refines;
+ // memoized view of the set of all metadata expressions
+ private final Supplier<Set<Metadata>> allSet = Suppliers.memoize(new Supplier<Set<Metadata>>()
+ {
+ @Override
+ public Set<Metadata> get()
+ {
+ return ImmutableSet.copyOf(all.values());
+ }
+
+ });
+ // memoized view of the set of all metadata primary expressions
+ private final Supplier<Set<Metadata>> primarySet = Suppliers
+ .memoize(new Supplier<Set<Metadata>>()
+ {
+ @Override
+ public Set<Metadata> get()
+ {
+ return ImmutableSet.copyOf(primary.values());
+ }
+
+ });
+
+ private MetadataSet(Multimap<Property, Metadata> all, Multimap<Property, Metadata> primary,
+ Map<Metadata, Metadata> refines, Multimap<String, Metadata> refiners)
+ {
+ this.all = ImmutableSetMultimap.copyOf(all);
+ this.primary = ImmutableSetMultimap.copyOf(primary);
+ this.refines = ImmutableMap.copyOf(refines);
+ this.refiners = ImmutableSetMultimap.copyOf(refiners);
+ }
+
+ /**
+ * Returns a set of all primary metadata expressions.
+ *
+ * @return an immutable set (possibly empty) of all primary metadata
+ * expressions.
+ */
+ public Set<Metadata> getPrimary()
+ {
+ return primarySet.get();
+ }
+
+ /**
+ * Returns a set of all metadata expressions (primary+subexpressions).
+ *
+ * @return an immutable set (possibly empty) of all metadata expressions.
+ */
+ public Set<Metadata> getAll()
+ {
+ return allSet.get();
+ }
+
+ /**
+ * Returns <code>true</code> if this metadata set contains a primary
+ * expression for the given property
+ *
+ * @param property
+ * a property from a metadata vocabulary
+ * @return <code>true</code> if this metadata set contains a primary
+ * expression for the given property
+ */
+ public boolean containsPrimary(Property property)
+ {
+ return primary.containsKey(property);
+ }
+
+ /**
+ * Returns <code>true</code> if this metadata set contains a primary
+ * expression for the given property and the given value
+ *
+ * @param property
+ * a property from a metadata vocabulary
+ * @param value
+ * the value to search
+ * @return <code>true</code> if this metadata set contains a primary
+ * expression for the given property and value
+ */
+ public boolean containsPrimary(Property property, String value)
+ {
+ for (Metadata meta : primary.get(property))
+ {
+ if (meta.getValue().equals(value))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns <code>true</code> if this metadata set contains an expression
+ * (primary or subexpression) for the given property
+ *
+ * @param property
+ * a property from a metadata vocabulary
+ * @return <code>true</code> if this metadata set contains an expression for
+ * the given property
+ */
+ public boolean containsAny(Property property)
+ {
+ return all.containsKey(property);
+ }
+
+ /**
+ * Returns the set of metadata primary expressions for the given property.
+ *
+ * @param property
+ * a property from a metadata vocabulary
+ * @return the set of metadata primary expressions for the given property, or
+ * an empty set if none exist.
+ */
+ public Set<Metadata> getPrimary(Property property)
+ {
+ return primary.get(property);
+ }
+
+ /**
+ * Returns the set of all metadata expressions (primary and subexpressions)
+ * for the given property.
+ *
+ * @param property
+ * a property from a metadata vocabulary
+ * @return the set of all metadata expressions for the given property, or an
+ * empty set if none exist.
+ */
+ public Set<Metadata> getAny(Property property)
+ {
+ return all.get(property);
+ }
+
+ /**
+ * Returns an optional metadata expression refined by the given metadata
+ * expression.
+ *
+ * @param meta
+ * a metadata expression
+ * @return {@link Optional#absent()} if the given metadata expression does not
+ * refine another metadata expression or a
+ * {@link Optional#of(Metadata)} containing the refined metadata
+ * expression
+ */
+ public Optional<Metadata> getRefinedBy(Metadata meta)
+ {
+ return Optional.fromNullable(refines.get(meta));
+ }
+
+ /**
+ * Returns the set of all metadata subexpressions refining the metadata or
+ * resource identified by the given ID.
+ *
+ * @param id
+ * a string ID
+ * @return the set of all metadata subexpressions refining the given ID, or an
+ * empty set if none exist.
+ */
+ public Set<Metadata> getRefining(String id)
+ {
+ return refiners.get(id);
+ }
+
+ /**
+ * Search all refining expressions of the given metadata expressions, and
+ * return the first one that matches the given property and value (if
+ * present).
+ * <p>
+ * If <code>value</code> is {@link Optional#absent()}
+ * </p>
+ * , only the property is used in the lookup.
+ *
+ * @param metas
+ * A set of metadata expressions to search
+ * @param property
+ * The property of the searched expression
+ * @param value
+ * The value of the searched expression, can be absent if the value
+ * is not relevant in the search
+ * @return an {@link Optional} containing an expression refining one of the
+ * expressions in <code>metas</code> and matching the given property
+ * and value, or {@link Optional#absent()} if none is found.
+ */
+ public static Optional<Metadata> tryFindInRefines(Set<Metadata> metas, final Property property,
+ final Optional<String> value)
+ {
+ Preconditions.checkNotNull(metas);
+ Preconditions.checkNotNull(property);
+ Preconditions.checkNotNull(value);
+ return Iterables.tryFind(metas, new Predicate<Metadata>()
+ {
+ @Override
+ public boolean apply(Metadata meta)
+ {
+ return tryFind(meta.getRefiners(), property, value).isPresent();
+ }
+ });
+ }
+
+ /**
+ * Search all the given expressions and return the first one that matches the
+ * given property and value (if present).
+ * <p>
+ * If <code>value</code> is {@link Optional#absent()}
+ * </p>
+ * , only the property is used in the lookup.
+ *
+ * @param metas
+ * A set of metadata expressions to search
+ * @param property
+ * The property of the searched expression
+ * @param value
+ * The value of the searched expression, can be absent if the value
+ * is not relevant in the search
+ * @return an {@link Optional} containing an expression in the
+ * <code>metas</code> set matching the given property and value, or
+ * {@link Optional#absent()} if none is found.
+ */
+ public static Optional<Metadata> tryFind(Set<Metadata> metas, final Property property,
+ final Optional<String> value)
+ {
+ Preconditions.checkNotNull(metas);
+ Preconditions.checkNotNull(property);
+ Preconditions.checkNotNull(value);
+ return Iterables.tryFind(metas, new Predicate<Metadata>()
+ {
+
+ @Override
+ public boolean apply(Metadata meta)
+ {
+ return property.equals(meta.getProperty())
+ && (!value.isPresent() || value.get().equals(meta.getValue()));
+ }
+ });
+ }
+
+ /**
+ * Represents a metadata expression.
+ *
+ */
+ public static final class Metadata
+ {
+ private final Optional<String> id;
+ private final Property property;
+ private final String value;
+ private final Optional<String> refines;
+ private final Set<Metadata> refiners;
+
+ private Metadata(String id, Property property, String value, String refines,
+ Set<Metadata> refiners)
+ {
+ Preconditions.checkNotNull(property);
+ this.id = Optional.fromNullable(id);
+ this.property = property;
+ this.value = value == null ? "" : value.trim();
+ this.refines = refines == null ? Optional.<String> absent()
+ : refines.startsWith("#") ? Optional.fromNullable(Strings.emptyToNull(refines
+ .substring(1))) : Optional.of(refines);
+ this.refiners = refiners == null ? ImmutableSet.<MetadataSet.Metadata> of() : refiners;
+ }
+
+ /**
+ * The ID of the element holding the expression.
+ *
+ * @return the ID of the element holding the expression (possibly absent).
+ */
+ public Optional<String> getId()
+ {
+ return id;
+ }
+
+ /**
+ * The property representing the statement of the expression.
+ *
+ * @return the property representing the statement of the expression.
+ */
+ public Property getProperty()
+ {
+ return property;
+ }
+
+ /**
+ * The value of the assertion of the expression.
+ *
+ * @return the value of the assertion of the expression.
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * The ID of the resource or expression refined by this expression.
+ *
+ * @return the ID of the resource or expression refined by this expression
+ * (possibly absent).
+ */
+ public Optional<String> getRefines()
+ {
+ return refines;
+ }
+
+ /**
+ * The set of metadata expressions refining this metadata expression.
+ *
+ * @return the set (possibly empty) of metadata expressions refining this
+ * metadata expression.
+ */
+ public Set<Metadata> getRefiners()
+ {
+ return refiners;
+ }
+
+ @Override
+ public String toString()
+ {
+ return "Metadata [id=" + id + ", property=" + property + ", value=" + value + ", refines="
+ + refines + "]";
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((property == null) ? 0 : property.hashCode());
+ result = prime * result + ((refines == null) ? 0 : refines.hashCode());
+ result = prime * result + ((value == null) ? 0 : value.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ Metadata other = (Metadata) obj;
+ if (id == null)
+ {
+ if (other.id != null) return false;
+ }
+ else if (!id.equals(other.id)) return false;
+ if (property == null)
+ {
+ if (other.property != null) return false;
+ }
+ else if (!property.equals(other.property)) return false;
+ if (refines == null)
+ {
+ if (other.refines != null) return false;
+ }
+ else if (!refines.equals(other.refines)) return false;
+ if (value == null)
+ {
+ if (other.value != null) return false;
+ }
+ else if (!value.equals(other.value)) return false;
+ return true;
+ }
+
+ }
+
+ /**
+ * Creates a new builder. Calling this method is identical to calling the
+ * empty {@link Builder} constructor.
+ *
+ * @return a newly created builder.
+ */
+ public static Builder builder()
+ {
+ return new Builder();
+ }
+
+ /**
+ * A builder for sets of metadata expressions.
+ *
+ */
+ public static final class Builder
+ {
+ // Primary metadata expressions, mapped by properties
+ private final Multimap<Property, Metadata> primary = HashMultimap.create();
+ // All metadata expressions (primary+subexpressions), mapped by properties
+ private final Multimap<Property, Metadata> all = HashMultimap.create();
+ // A list of temporary incomplete metadata objects to build
+ private final LinkedList<Metadata> tempMetas = Lists.newLinkedList();
+ // A map of (possibly temporary) metadata objects refining the given IDs
+ private final Multimap<String, Metadata> refinersMap = LinkedListMultimap.create();
+ // A map of refining-to-refined metadata objects
+ private final Map<Metadata, Metadata> refines = Maps.newHashMap();
+ // A map of the status of metadata being visited by DFS
+ private final Map<Metadata, Visit> visits = Maps.newHashMap();
+
+ // holds the status of visited metadata in the DFS sort
+ private static enum Visit
+ {
+ UNVISITED,
+ VISITED,
+ VISITING;
+ public static Visit safe(Visit visit)
+ {
+ return visit != null ? visit : UNVISITED;
+ }
+ }
+
+ /**
+ * Builds the set. Must be called after all metadata expressions have been
+ * added.
+ *
+ * @return an immutable metadata set
+ * @throws IllegalStateException
+ * if a cycle is found in the graph of refining expressions
+ */
+ public MetadataSet build()
+ {
+ // DFS recursive build of metadata and their refining metadata
+ // Note: metadata consistency (e.g. whether @refines point to valid IDs)
+ // has already been checked in schemas
+ for (Metadata metadata : tempMetas)
+ {
+ build(metadata);
+ }
+ return new MetadataSet(all, primary, refines, refinersMap);
+ }
+
+ // builds a metadata and all its refining metadata recursively
+ private Metadata build(Metadata meta)
+ {
+ Preconditions.checkArgument(meta.getId().isPresent());
+ switch (Visit.safe(visits.get(meta)))
+ {
+ case VISITED:
+ // has already been built
+ return meta;
+ case VISITING:
+ throw new IllegalStateException("Not a DAG");
+ default:
+ break;
+ }
+ visits.put(meta, Visit.VISITING);
+ Set<Metadata> refiners = new HashSet<Metadata>();
+ // recursively build the current metadata's refining metadata
+ for (Metadata refiner : refinersMap.get(meta.getId().get()))
+ {
+ // add the refining metadata to the "refiners" set
+ // - if the refining metadata has no ID, it's final already
+ // - otherwise, build it recursively
+ refiners.add((refiner.getId().isPresent()) ? build(refiner) : refiner);
+ }
+ // build the finalized metadata and put it in the final maps
+ Metadata result = new Metadata(meta.getId().get(), meta.getProperty(), meta.getValue(), meta
+ .getRefines().orNull(), refiners);
+ for (Metadata refiner : refiners)
+ {
+ refines.put(refiner, result);
+ }
+ if (result.getRefines().isPresent())
+ {
+ // re-add built metadata to the refiners map
+ refinersMap.remove(result.getRefines().get(), meta);
+ refinersMap.put(result.getRefines().get(), result);
+ }
+ else
+ {
+ primary.put(result.getProperty(), result);
+ }
+ all.put(result.getProperty(), result);
+ visits.put(meta, Visit.VISITED);
+ return result;
+ }
+
+ /**
+ * Adds a metadata expression to the set being built.
+ *
+ * @param id
+ * the ID of the element holding the expression, can be null.
+ * @param property
+ * the property representing the statement of the expression (must
+ * not be null)
+ * @param value
+ * the value representing the assertion of the expression (can, but
+ * should not, be null)
+ * @param refines
+ * the ID of the expression or resource refined by this expression.
+ * If the given string starts with the character '#' (relative
+ * fragment URI), it is stripped to get the ID. Can be null
+ * @return this builder
+ */
+ public Builder meta(String id, Property property, String value, String refines)
+ {
+ // create a (possibly temporary) metadata from the given fields
+ Metadata meta = new Metadata(id, property, value, refines, null);
+ if (id == null)
+ {
+ // the metadata cannot be refined, put it in the final maps
+ if (!meta.refines.isPresent())
+ {
+ primary.put(property, meta);
+ }
+ all.put(property, meta);
+ }
+ else
+ {
+ // the metadata may be refined, store it to the temporary list
+ tempMetas.add(meta);
+ }
+ if (meta.refines.isPresent())
+ {
+ // if the metadata refines something, store it to the map of "refiners"
+ refinersMap.put(meta.refines.get(), meta);
+ }
+ return this;
+ }
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java b/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
index 790f19a..cb870af 100755
--- a/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java
@@ -22,138 +22,127 @@
package com.adobe.epubcheck.opf;
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.LinkedList;
import java.util.List;
import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.bitmap.BitmapCheckerFactory;
import com.adobe.epubcheck.css.CSSCheckerFactory;
import com.adobe.epubcheck.dtbook.DTBookCheckerFactory;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.nav.NavCheckerFactory;
import com.adobe.epubcheck.ncx.NCXCheckerFactory;
import com.adobe.epubcheck.ocf.OCFFilenameChecker;
import com.adobe.epubcheck.ocf.OCFPackage;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.ops.OPSCheckerFactory;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
-import com.adobe.epubcheck.util.GenericResourceProvider;
import com.adobe.epubcheck.util.PathUtil;
+import com.adobe.epubcheck.util.ValidatorMap;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidator;
import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Optional;
+import com.google.common.base.Predicates;
-public class OPFChecker implements DocumentValidator
+public class OPFChecker implements DocumentValidator, ContentChecker
{
- final OCFPackage ocf;
- final OPFData opfData;
- final Report report;
- final String path;
- final XRefChecker xrefChecker;
- OPFHandler opfHandler = null;
- XMLParser opfParser = null;
- final List<XMLValidator> opfValidators = new LinkedList<XMLValidator>();
-
- final Hashtable<String, ContentCheckerFactory> contentCheckerFactoryMap = new Hashtable<String, ContentCheckerFactory>();
- final EPUBVersion version;
- final GenericResourceProvider resourceProvider;
+
+ private final static ValidatorMap validatorMap = ValidatorMap.builder()
+ .put(version(EPUBVersion.VERSION_2), XMLValidators.OPF_20_RNG)
+ .put(version(EPUBVersion.VERSION_2), XMLValidators.OPF_20_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_RNC)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_COLLECTION_DO_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_COLLECTION_DICT_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_COLLECTION_IDX_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_COLLECTION_MANIFEST_SCH)
+ .put(version(EPUBVersion.VERSION_3), XMLValidators.OPF_30_COLLECTION_PREVIEW_SCH)
+ .put(Predicates.or(profile(EPUBProfile.DICT), hasPubType(OPFData.DC_TYPE_DICT)),
+ XMLValidators.OPF_DICT_SCH)
+ .put(Predicates.or(profile(EPUBProfile.EDUPUB), hasPubType(OPFData.DC_TYPE_EDUPUB)),
+ XMLValidators.OPF_EDUPUB_SCH)
+ .put(Predicates.or(profile(EPUBProfile.PREVIEW), hasPubType(OPFData.DC_TYPE_PREVIEW)),
+ XMLValidators.OPF_PREVIEW_SCH)
+ .build();
+
+ protected final ValidationContext context;
+ protected final Report report;
+ protected final String path;
+ protected final EPUBVersion version;
+ protected OPFHandler opfHandler = null;
+ protected XMLParser opfParser = null;
+ protected final Hashtable<String, ContentCheckerFactory> contentCheckerFactoryMap = new Hashtable<String, ContentCheckerFactory>();
protected void initContentCheckerFactoryMap()
{
Hashtable<String, ContentCheckerFactory> map = new Hashtable<String, ContentCheckerFactory>();
map.put("application/xhtml+xml", OPSCheckerFactory.getInstance());
- map.put("text/html", OPSCheckerFactory.getInstance());
- map.put("text/x-oeb1-document", OPSCheckerFactory.getInstance());
+ map.put("application/x-dtbook+xml", DTBookCheckerFactory.getInstance());
map.put("image/jpeg", BitmapCheckerFactory.getInstance());
map.put("image/gif", BitmapCheckerFactory.getInstance());
map.put("image/png", BitmapCheckerFactory.getInstance());
map.put("image/svg+xml", OPSCheckerFactory.getInstance());
- map.put("application/x-dtbook+xml", DTBookCheckerFactory.getInstance());
map.put("text/css", CSSCheckerFactory.getInstance());
+ map.put("text/html", OPSCheckerFactory.getInstance());
+ map.put("text/x-oeb1-document", OPSCheckerFactory.getInstance());
contentCheckerFactoryMap.putAll(map);
}
-
- protected void initValidators()
- {
- opfValidators.add(XMLValidators.OPF_20_RNG.get());
- opfValidators.add(XMLValidators.OPF_20_SCH.get());
- }
- public OPFChecker(OCFPackage ocf, Report report, String path, EPUBVersion version)
- {
- this.ocf = ocf;
- this.resourceProvider = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = new XRefChecker(ocf, report, version);
- this.version = version;
- this.opfData = ocf.getOpfData().get(path);
- initValidators();
- initContentCheckerFactoryMap();
- }
-
- public OPFChecker(String path, GenericResourceProvider resourceProvider, Report report)
- {
- this(path, resourceProvider, report, EPUBVersion.VERSION_2);
- }
-
- protected OPFChecker(String path, GenericResourceProvider resourceProvider, Report report, EPUBVersion version)
+ public OPFChecker(ValidationContext context)
{
+ // The following context fields are not overridden from the parent context
+ this.report = context.report;
+ this.path = context.path;
+ this.version = context.version;
+
+ // Create a new validation context from the parent
+ ValidationContextBuilder newContext = new ValidationContextBuilder(context);
+ if (context.ocf.isPresent())
+ {
+ // Get the OPFData peeked from the OCF
+ OPFData opfData = context.ocf.get().getOpfData().get(context.path);
+ newContext.pubTypes(opfData != null ? opfData.getTypes() : null);
+ newContext.xrefChecker(new XRefChecker(context.ocf.get(), context.report, context.version));
+ newContext.profile(EPUBProfile.makeOPFCompatible(context.profile, opfData, path, report));
+ }
+ this.context = newContext.build();
- this.ocf = null; //unused in this mode
- this.xrefChecker = null; //unused in this mode
- this.opfData = null; //unused in this mode
- this.resourceProvider = resourceProvider;
- this.report = report;
- this.path = path;
- this.version = version;
- initValidators();
+ // Initialize validators and factories
initContentCheckerFactoryMap();
}
public void runChecks()
{
+ OCFPackage ocf = context.ocf.get();
+ XRefChecker xrefChecker = context.xrefChecker.get();
if (!ocf.hasEntry(path))
{
- report.message(MessageId.PKG_020, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.PKG_020, EPUBLocation.create(ocf.getName()), path);
return;
}
validate();
if (!opfHandler.checkUniqueIdentExists())
{
- report.message(MessageId.OPF_030, new MessageLocation(path, -1, -1), opfHandler.getIdentId());
- } else {
- ocf.setUniqueIdentifier(opfHandler.getUid());
+ report.message(MessageId.OPF_030, EPUBLocation.create(path), opfHandler.getIdentId());
}
- int itemCount = opfHandler.getItemCount();
- report.info(null, FeatureEnum.ITEMS_COUNT, Integer.toString(itemCount));
- for (int i = 0; i < itemCount; i++)
+ List<OPFItem> items = opfHandler.getItems();
+ report.info(null, FeatureEnum.ITEMS_COUNT, Integer.toString(items.size()));
+ for (OPFItem item : items)
{
- OPFItem item = opfHandler.getItem(i);
- try
- {
- xrefChecker.registerResource(item.getPath(),
- item.getMimeType(), item.isInSpine(),
- new FallbackChecker().checkItemFallbacks(item, opfHandler, true),
- new FallbackChecker().checkImageFallbacks(item, opfHandler));
- }
- catch (IllegalArgumentException e)
- {
- report.message(MessageId.RSC_005,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- e.getMessage());
- }
+ xrefChecker.registerResource(item,
+ new FallbackChecker().checkItemFallbacks(item, opfHandler, true),
+ new FallbackChecker().checkImageFallbacks(item, opfHandler));
report.info(item.getPath(), FeatureEnum.DECLARED_MIMETYPE, item.getMimeType());
}
@@ -161,11 +150,9 @@ public class OPFChecker implements DocumentValidator
checkGuide();
checkBindings();
- for (int i = 0; i < itemCount; i++)
+ for (OPFItem item : items)
{
- OPFItem item = opfHandler.getItem(i);
-
- if (!item.path.matches("^[^:/?#]+://.*"))
+ if (!item.getPath().matches("^[^:/?#]+://.*"))
{
checkItemContent(item);
}
@@ -174,41 +161,39 @@ public class OPFChecker implements DocumentValidator
xrefChecker.checkReferences();
}
- void checkBindings()
+ protected void checkBindings()
{
}
- void checkGuide()
+ protected void checkGuide()
{
int refCount = opfHandler.getReferenceCount();
for (int i = 0; i < refCount; i++)
{
OPFReference ref = opfHandler.getReference(i);
String itemPath = PathUtil.removeAnchor(ref.getHref());
- OPFItem item = opfHandler.getItemByPath(itemPath);
- if (item == null)
+ Optional<OPFItem> item = opfHandler.getItemByPath(itemPath);
+ if (!item.isPresent())
{
report.message(MessageId.OPF_031,
- new MessageLocation(path, ref.getLineNumber(), ref.getColumnNumber()),
- ref.getHref());
+ EPUBLocation.create(path, ref.getLineNumber(), ref.getColumnNumber()), ref.getHref());
}
else
{
- if (!isBlessedItemType(item.mimeType, version) &&
- !isDeprecatedBlessedItemType(item.mimeType))
+ if (!isBlessedItemType(item.get().getMimeType(), version)
+ && !isDeprecatedBlessedItemType(item.get().getMimeType()))
{
report.message(MessageId.OPF_032,
- new MessageLocation(path, ref.getLineNumber(), ref.getColumnNumber()),
- ref.getHref());
+ EPUBLocation.create(path, ref.getLineNumber(), ref.getColumnNumber()), ref.getHref());
}
}
}
}
- void initHandler()
+ protected void initHandler()
{
- opfHandler = new OPFHandler(path, report, xrefChecker, opfParser, version);
+ opfHandler = new OPFHandler(context, opfParser);
}
public OPFHandler getOPFHandler()
@@ -223,88 +208,70 @@ public class OPFChecker implements DocumentValidator
int errorsSoFar = report.getErrorCount();
int warningsSoFar = report.getWarningCount();
- InputStream in = null;
- try
+ opfParser = new XMLParser(new ValidationContextBuilder(context).mimetype("opf").build());
+ initHandler();
+ opfParser.addXMLHandler(opfHandler);
+ for (XMLValidator validator : validatorMap.getValidators(context))
{
- in = resourceProvider.getInputStream(path);
- opfParser = new XMLParser(ocf, new BufferedInputStream(
- in), path, "opf",
- report, version);
- initHandler();
- opfParser.addXMLHandler(opfHandler);
- for (XMLValidator validator : opfValidators)
- {
- opfParser.addValidator(validator);
- }
- opfParser.process();
- }
- catch (IOException e)
- {
- report.message(MessageId.PKG_008, new MessageLocation(path, 0, 0), path);
+ opfParser.addValidator(validator);
}
- finally
+ opfParser.process();
+
+ for (OPFItem item : opfHandler.getItems())
{
- try
+ // only check Filename CompatiblyEscaped when in "-mode opf"
+ // this is when 'xrefChecker' Object is null which is an indicator for
+ // single file validation
+ // (Had no better possibility in mind since "mode" isn't available in
+ // OPFChecker.java)
+ //
+ // bugfix for issue 239
+ if (!context.xrefChecker.isPresent())
{
- if (in != null)
- {
- in.close();
- }
+ OCFFilenameChecker.checkCompatiblyEscaped(item.getPath(), report, version);
}
- catch (Exception ignored)
+ if (!item.equals(opfHandler.getItemByPath(item.getPath()).orNull()))
{
- // eat the error
+ report.message(MessageId.OPF_074,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()),
+ item.getPath());
+ }
+ else
+ {
+ checkItem(item, opfHandler);
}
}
-
- int itemCount = opfHandler.getItemCount();
- for (int i = 0; i < itemCount; i++)
- {
- OPFItem item = opfHandler.getItem(i);
-
- // only check Filename CompatiblyEscaped when in "-mode opf"
- // this is when 'xrefChecker' Object is null which is an indicator for single file validation
- // (Had no better possibility in mind since "mode" isn't available in OPFChecker.java)
- //
- // bugfix for issue 239
- if(xrefChecker == null) {
- OCFFilenameChecker.checkCompatiblyEscaped(item.getPath(), report, version);
- }
- checkItem(item, opfHandler);
- }
-
- int spineItemCount = opfHandler.getSpineItemCount();
- int nonLinearCount = 0;
- for (int i = 0; i < spineItemCount; i++)
+ if (!opfHandler.getSpineItems().isEmpty())
{
- OPFItem item = opfHandler.getSpineItem(i);
- checkSpineItem(item, opfHandler);
- if (!item.getSpineLinear())
+ boolean linearFound = false;
+ int spineIndex = 0;
+ for (OPFItem item : opfHandler.getSpineItems())
{
- nonLinearCount++;
+ checkSpineItem(item, opfHandler);
+ if (item.isLinear())
+ {
+ linearFound = true;
+ }
+ report.info(item.getPath(), FeatureEnum.SPINE_INDEX, Integer.toString(spineIndex++));
+ }
+ if (!linearFound)
+ {
+ report.message(MessageId.OPF_033, EPUBLocation.create(path));
}
- report.info(item.getPath(), FeatureEnum.SPINE_INDEX, Integer.toString(i));
- }
- if (nonLinearCount == spineItemCount && spineItemCount > 0)
- {
- //test > 0 to not trigger this when opf is malformed etc
- report.message(MessageId.OPF_033, new MessageLocation(path, -1, -1));
}
if (version == EPUBVersion.VERSION_2)
{
// check for >1 itemrefs to any given spine item
// http://code.google.com/p/epubcheck/issues/detail?id=182
- List<OPFItem> seen = new ArrayList<OPFItem>();
- for (int i = 0; i < opfHandler.getSpineItemCount(); i++)
+ Set<OPFItem> seen = new HashSet<OPFItem>();
+ for (OPFItem item : opfHandler.getSpineItems())
{
- OPFItem item = opfHandler.getSpineItem(i);
if (seen.contains(item))
{
report.message(MessageId.OPF_034,
- new MessageLocation(path, item.getLineNumber(), item.getLineNumber()),
- item.getId());
+ EPUBLocation.create(path, item.getLineNumber(), item.getLineNumber()), item.getId());
}
else
{
@@ -313,8 +280,7 @@ public class OPFChecker implements DocumentValidator
}
}
- return fatalErrorsSoFar == report.getFatalErrorCount()
- && errorsSoFar == report.getErrorCount()
+ return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
&& warningsSoFar == report.getWarningCount();
}
@@ -322,13 +288,11 @@ public class OPFChecker implements DocumentValidator
{
if (version == EPUBVersion.VERSION_2)
{
- return type.equals("application/xhtml+xml")
- || type.equals("application/x-dtbook+xml");
+ return type.equals("application/xhtml+xml") || type.equals("application/x-dtbook+xml");
}
else
{
- return type.equals("application/xhtml+xml")
- || type.equals("image/svg+xml");
+ return type.equals("application/xhtml+xml") || type.equals("image/svg+xml");
}
}
@@ -337,142 +301,130 @@ public class OPFChecker implements DocumentValidator
return type.equals("text/x-oeb1-document") || type.equals("text/html");
}
- protected static boolean isBlessedStyleType(String type)
+ public static boolean isBlessedStyleType(String type)
{
return type.equals("text/css");
}
- protected static boolean isDeprecatedBlessedStyleType(String type)
+ public static boolean isDeprecatedBlessedStyleType(String type)
{
return type.equals("text/x-oeb1-css");
}
public static boolean isBlessedImageType(String type)
{
- return type.equals("image/gif") || type.equals("image/png")
- || type.equals("image/jpeg") || type.equals("image/svg+xml");
+ return type.equals("image/gif") || type.equals("image/png") || type.equals("image/jpeg")
+ || type.equals("image/svg+xml");
}
public static boolean isBlessedFontMimetype20(String mime)
{
- return mime != null && (mime.startsWith("font/") || mime.startsWith("application/font") || mime.startsWith("application/x-font") || "application/vnd.ms-opentype".equals(mime));
+ return mime != null && (mime.startsWith("font/") || mime.startsWith("application/font")
+ || mime.startsWith("application/x-font") || "application/vnd.ms-opentype".equals(mime));
}
- void checkItem(OPFItem item, OPFHandler opfHandler)
+ protected void checkItem(OPFItem item, OPFHandler opfHandler)
{
String mimeType = item.getMimeType();
- String fallback = item.getFallback();
- if (mimeType == null || mimeType.equals(""))
- {
- // Ensures that media-type attribute is not empty
- // report.error(path, item.getLineNumber(), item.getColumnNumber(),
- // "empty media-type attribute");
- }
- else if (!mimeType.matches("[a-zA-Z0-9!#$&+-^_]+/[a-zA-Z0-9!#$&+-^_]+"))
+ Optional<String> fallback = item.getFallback();
+ if (!mimeType.matches("[a-zA-Z0-9!#$&+-^_]+/[a-zA-Z0-9!#$&+-^_]+"))
{
/*
- * Ensures that media-type attribute has correct content. The
- * media-type must have a type and a sub-type divided by '/' The
- * allowable content for the media-type attribute is defined in
- * RFC4288 section 4.2
- */
+ * Ensures that media-type attribute has correct content. The media-type
+ * must have a type and a sub-type divided by '/' The allowable content
+ * for the media-type attribute is defined in RFC4288 section 4.2
+ */
// report.error(path, item.getLineNumber(), item.getColumnNumber(),
// "invalid content for media-type attribute");
}
- else if (isDeprecatedBlessedItemType(mimeType)
- || isDeprecatedBlessedStyleType(mimeType))
+ else if (isDeprecatedBlessedItemType(mimeType) || isDeprecatedBlessedStyleType(mimeType))
{
- if (opfHandler.getOpf20PackageFile()
- && mimeType.equals("text/html"))
+ if (opfHandler.getOpf20PackageFile() && mimeType.equals("text/html"))
{
- report.message(MessageId.OPF_035, new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
+ report.message(MessageId.OPF_035,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
}
- else if (opfHandler.getOpf12PackageFile()
- && mimeType.equals("text/html"))
+ else if (opfHandler.getOpf12PackageFile() && mimeType.equals("text/html"))
{
- report.message(MessageId.OPF_038, new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()), mimeType);
+ report.message(MessageId.OPF_038,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
+ mimeType);
}
else if (opfHandler.getOpf20PackageFile())
{
report.message(MessageId.OPF_037,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
mimeType);
}
}
- if (opfHandler.getOpf12PackageFile() && fallback == null)
+ if (opfHandler.getOpf12PackageFile() && !fallback.isPresent())
{
if (isBlessedItemType(mimeType, version))
{
report.message(MessageId.OPF_038,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
mimeType);
}
else if (isBlessedStyleType(mimeType))
{
report.message(MessageId.OPF_039,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()),
mimeType);
}
}
- if (fallback != null)
+ if (fallback.isPresent())
{
- OPFItem fallbackItem = opfHandler.getItemById(fallback);
- if (fallbackItem == null)
+ Optional<OPFItem> fallbackItem = opfHandler.getItemById(fallback.get());
+ if (!fallbackItem.isPresent())
{
report.message(MessageId.OPF_040,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
}
}
-
- String fallbackStyle = item.getFallbackStyle();
- if (fallbackStyle != null)
+
+ if (item.getFallbackStyle().isPresent())
{
- OPFItem fallbackStyleItem = opfHandler.getItemById(fallbackStyle);
- if (fallbackStyleItem == null)
+ Optional<OPFItem> fallbackStyleItem = opfHandler.getItemById(item.getFallbackStyle().get());
+ if (!fallbackStyleItem.isPresent())
{
report.message(MessageId.OPF_041,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber(), item.getId()));
}
}
}
- void checkItemContent(OPFItem item)
+ protected void checkItemContent(OPFItem item)
{
- String mimeType = item.getMimeType();
- String path = item.getPath();
- String properties = item.getProperties();
-
- if (mimeType != null)
+ String mimetype = item.getMimeType();
+ ContentCheckerFactory checkerFactory;
+ if (item.isNcx())
{
- ContentCheckerFactory checkerFactory;
- if (item.isNcx())
- {
- checkerFactory = NCXCheckerFactory.getInstance();
- }
- else if (item.isNav())
- {
- checkerFactory = NavCheckerFactory.getInstance();
- }
- else
- {
- checkerFactory = contentCheckerFactoryMap.get(mimeType);
- }
+ checkerFactory = NCXCheckerFactory.getInstance();
+ }
+ else if (item.isNav())
+ {
+ checkerFactory = NavCheckerFactory.getInstance();
+ }
+ else
+ {
+ checkerFactory = contentCheckerFactoryMap.get(mimetype);
+ }
- if (checkerFactory == null)
- {
- checkerFactory = GenericContentCheckerFactory.getInstance();
- }
- if (checkerFactory != null)
- {
- ContentChecker checker = checkerFactory.newInstance(ocf,
- report, path, mimeType, properties, xrefChecker,
- version, opfData.getTypes());
- checker.runChecks();
- }
+ if (checkerFactory == null)
+ {
+ checkerFactory = GenericContentCheckerFactory.getInstance();
+ }
+ if (checkerFactory != null)
+ {
+ // Create the content checker with an overridden validation context
+ ContentChecker checker = checkerFactory.newInstance(new ValidationContextBuilder(context)
+ .path(item.getPath()).mimetype(mimetype).properties(item.getProperties()).build());
+ // Validate
+ checker.runChecks();
}
}
- void checkSpineItem(OPFItem item, OPFHandler opfHandler)
+ protected void checkSpineItem(OPFItem item, OPFHandler opfHandler)
{
// These checks are okay to be done on <spine> items, but they really
// should be done on all
@@ -482,32 +434,23 @@ public class OPFChecker implements DocumentValidator
// needing fallbacks).
// [GC 11/15/09]
String mimeType = item.getMimeType();
- if (mimeType != null)
+ if (isBlessedStyleType(mimeType) || isDeprecatedBlessedStyleType(mimeType)
+ || isBlessedImageType(mimeType))
{
- if (isBlessedStyleType(mimeType)
- || isDeprecatedBlessedStyleType(mimeType)
- || isBlessedImageType(mimeType))
- {
- report.message(MessageId.OPF_042,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- mimeType);
- }
- else if (!isBlessedItemType(mimeType, version)
- && !isDeprecatedBlessedItemType(mimeType)
- && item.getFallback() == null)
- {
- report.message(MessageId.OPF_043,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- mimeType);
- }
- else if (!isBlessedItemType(mimeType, version)
- && !isDeprecatedBlessedItemType(mimeType)
- && !new FallbackChecker().checkItemFallbacks(item, opfHandler, true))
- {
- report.message(MessageId.OPF_044,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- mimeType);
- }
+ report.message(MessageId.OPF_042,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), mimeType);
+ }
+ else if (!isBlessedItemType(mimeType, version) && !isDeprecatedBlessedItemType(mimeType)
+ && !item.getFallback().isPresent())
+ {
+ report.message(MessageId.OPF_043,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), mimeType);
+ }
+ else if (!isBlessedItemType(mimeType, version) && !isDeprecatedBlessedItemType(mimeType)
+ && !new FallbackChecker().checkItemFallbacks(item, opfHandler, true))
+ {
+ report.message(MessageId.OPF_044,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), mimeType);
}
}
@@ -522,14 +465,13 @@ public class OPFChecker implements DocumentValidator
boolean checkItemFallbacks(OPFItem item, OPFHandler opfHandler, boolean checkFallbackStyle)
{
- String fallback = item.getFallback();
- if (fallback != null)
+ if (item.getFallback().isPresent())
{
- fallback = fallback.trim();
+ String fallback = item.getFallback().get();
if (checked.contains(fallback))
{
report.message(MessageId.OPF_045,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()));
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()));
return false;
}
else
@@ -537,39 +479,33 @@ public class OPFChecker implements DocumentValidator
checked.add(fallback);
}
- OPFItem fallbackItem = opfHandler.getItemById(fallback);
- if (fallbackItem != null)
+ Optional<OPFItem> fallbackItem = opfHandler.getItemById(fallback);
+ if (fallbackItem.isPresent())
{
- String mimeType = fallbackItem.getMimeType();
- if (mimeType != null)
+ String mimeType = fallbackItem.get().getMimeType();
+ if (isBlessedItemType(mimeType, version) || isDeprecatedBlessedItemType(mimeType))
{
- if (isBlessedItemType(mimeType, version)
- || isDeprecatedBlessedItemType(mimeType))
- {
- return true;
- }
- if (checkItemFallbacks(fallbackItem, opfHandler, checkFallbackStyle))
- {
- return true;
- }
-
+ return true;
}
+ if (checkItemFallbacks(fallbackItem.get(), opfHandler, checkFallbackStyle))
+ {
+ return true;
+ }
+
}
}
if (!checkFallbackStyle)
{
return false;
}
-
- String fallbackStyle = item.getFallbackStyle();
- if (fallbackStyle != null)
+ if (item.getFallbackStyle().isPresent())
{
- OPFItem fallbackStyleItem = opfHandler.getItemById(fallbackStyle);
- if (fallbackStyleItem != null)
+ String fallbackStyle = item.getFallbackStyle().get();
+ Optional<OPFItem> fallbackStyleItem = opfHandler.getItemById(fallbackStyle);
+ if (fallbackStyleItem.isPresent())
{
- String mimeType = fallbackStyleItem.getMimeType();
- return mimeType != null && (isBlessedStyleType(mimeType)
- || isDeprecatedBlessedStyleType(mimeType));
+ String mimeType = fallbackStyleItem.get().getMimeType();
+ return (isBlessedStyleType(mimeType) || isDeprecatedBlessedStyleType(mimeType));
}
}
return false;
@@ -577,34 +513,30 @@ public class OPFChecker implements DocumentValidator
boolean checkImageFallbacks(OPFItem item, OPFHandler opfHandler)
{
- String fallback = item.getFallback();
- if (fallback != null)
+ if (item.getFallback().isPresent())
{
- fallback = fallback.trim();
+ String fallback = item.getFallback().get();
if (checked.contains(fallback))
{
report.message(MessageId.OPF_045,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()));
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()));
return false;
}
else
{
checked.add(fallback);
}
- OPFItem fallbackItem = opfHandler.getItemById(fallback);
- if (fallbackItem != null)
+ Optional<OPFItem> fallbackItem = opfHandler.getItemById(fallback);
+ if (fallbackItem.isPresent())
{
- String mimeType = fallbackItem.getMimeType();
- if (mimeType != null)
+ String mimeType = fallbackItem.get().getMimeType();
+ if (isBlessedImageType(mimeType))
+ {
+ return true;
+ }
+ if (checkImageFallbacks(fallbackItem.get(), opfHandler))
{
- if (isBlessedImageType(mimeType))
- {
- return true;
- }
- if (checkImageFallbacks(fallbackItem, opfHandler))
- {
- return true;
- }
+ return true;
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java b/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
index f33dca9..3e9aaf8 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFChecker30.java
@@ -22,44 +22,48 @@
package com.adobe.epubcheck.opf;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
-import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
+import com.adobe.epubcheck.api.FeatureReport.Feature;
import com.adobe.epubcheck.bitmap.BitmapCheckerFactory;
import com.adobe.epubcheck.css.CSSCheckerFactory;
import com.adobe.epubcheck.dtbook.DTBookCheckerFactory;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
+import com.adobe.epubcheck.opf.MetadataSet.Metadata;
+import com.adobe.epubcheck.opf.ResourceCollection.Roles;
import com.adobe.epubcheck.ops.OPSCheckerFactory;
import com.adobe.epubcheck.overlay.OverlayCheckerFactory;
import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
-import com.adobe.epubcheck.xml.XMLValidator;
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.adobe.epubcheck.vocab.DCMESVocab;
+import com.adobe.epubcheck.vocab.PackageVocabs;
+import com.google.common.base.Optional;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Iterables;
import com.google.common.io.Files;
+import dict.SearchKeyMapCheckerFactory;
+
public class OPFChecker30 extends OPFChecker implements DocumentValidator
{
- public OPFChecker30(OCFPackage ocf, Report report, String path,
- EPUBVersion version)
+ public OPFChecker30(ValidationContext context)
{
- super(ocf, report, path, version);
+ super(context);
}
- public OPFChecker30(String path, GenericResourceProvider resourceProvider,
- Report report)
- {
- super(path, resourceProvider, report, EPUBVersion.VERSION_3);
- }
-
-
@Override
protected void initContentCheckerFactoryMap()
{
HashMap<String, ContentCheckerFactory> map = new HashMap<String, ContentCheckerFactory>();
+ map.put("application/vnd.epub.search-key-map+xml", SearchKeyMapCheckerFactory.getInstance());
+ map.put("application/smil+xml", OverlayCheckerFactory.getInstance());
map.put("application/xhtml+xml", OPSCheckerFactory.getInstance());
map.put("application/x-dtbook+xml", DTBookCheckerFactory.getInstance());
map.put("image/jpeg", BitmapCheckerFactory.getInstance());
@@ -67,36 +71,46 @@ public class OPFChecker30 extends OPFChecker implements DocumentValidator
map.put("image/png", BitmapCheckerFactory.getInstance());
map.put("image/svg+xml", OPSCheckerFactory.getInstance());
map.put("text/css", CSSCheckerFactory.getInstance());
- map.put("application/smil+xml", OverlayCheckerFactory.getInstance());
contentCheckerFactoryMap.clear();
contentCheckerFactoryMap.putAll(map);
}
-
+
@Override
- protected void initValidators()
+ public void initHandler()
{
- opfValidators.clear();
- opfValidators.add(new XMLValidator("schema/30/package-30.rnc"));
- opfValidators.add(new XMLValidator("schema/30/package-30.sch"));
- opfValidators.add(new XMLValidator("schema/30/collection-do-30.sch"));
- opfValidators.add(new XMLValidator("schema/30/collection-manifest-30.sch"));
- if (opfData != null && opfData.getTypes().contains(OPFData.DC_TYPE_EDUPUB))
- {
- opfValidators.add(new XMLValidator("schema/30/edupub/edu-opf.sch"));
- }
+ opfHandler = new OPFHandler30(context, opfParser);
}
@Override
- public void initHandler()
+ public void runChecks()
{
- opfHandler = new OPFHandler30(path, report, xrefChecker, opfParser, version);
+ super.runChecks();
+ checkCollectionsContent();
+ checkPagination();
+ checkSemantics();
+ checkNav();
+ checkSpecifics();
+ }
+
+ @Override
+ public boolean validate()
+ {
+ int fatalErrorsSoFar = report.getFatalErrorCount();
+ int errorsSoFar = report.getErrorCount();
+ int warningsSoFar = report.getWarningCount();
+
+ super.validate();
+ checkLinkedResources();
+ checkCollections();
+
+ return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
+ && warningsSoFar == report.getWarningCount();
}
@Override
protected void checkItem(OPFItem item, OPFHandler opfHandler)
{
String mimeType = item.getMimeType();
- String fallback = item.getFallback();
if (mimeType == null || mimeType.equals(""))
{
// report.error(path, item.getLineNumber(), item.getColumnNumber(),
@@ -110,32 +124,29 @@ public class OPFChecker30 extends OPFChecker implements DocumentValidator
// "invalid content for media-type attribute");
return;
}
-
- if ("application/xhtml+xml".equals(mimeType) && !"xhtml".equals(Files.getFileExtension(item.getPath())))
+
+ if ("application/xhtml+xml".equals(mimeType)
+ && !"xhtml".equals(Files.getFileExtension(item.getPath())))
{
report.message(MessageId.HTM_014a,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()), item.getPath());
- }
-
- if (fallback != null)
- {
- OPFItem fallbackItem = opfHandler.getItemById(fallback);
- if (fallbackItem == null)
- {
- report.message(MessageId.OPF_040,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()));
- }
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), item.getPath());
}
+
+ // Note: item fallback existence is checked in schematron, i.e.:
+ // opfHandler.getItemById(item.getFallback().get()).isPresent() == true
+
}
@Override
protected void checkSpineItem(OPFItem item, OPFHandler opfHandler)
{
-
String mimeType = item.getMimeType();
- if (mimeType == null)
+
+ if (item.getProperties()
+ .contains(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.DATA_NAV)))
{
- return;
+ report.message(MessageId.OPF_077,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()));
}
if (isBlessedItemType(mimeType, version))
@@ -143,85 +154,338 @@ public class OPFChecker30 extends OPFChecker implements DocumentValidator
return;
}
- if (item.getFallback() == null)
+ if (!item.getFallback().isPresent())
{
report.message(MessageId.OPF_043,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- mimeType);
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), mimeType);
}
else if (!new FallbackChecker().checkItemFallbacks(item, opfHandler, false))
{
report.message(MessageId.OPF_044,
- new MessageLocation(path, item.getLineNumber(), item.getColumnNumber()),
- mimeType);
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()), mimeType);
}
}
@Override
protected void checkBindings()
{
- Set<String> mimeTypes = xrefChecker.getBindingsMimeTypes();
+ Set<String> mimeTypes = context.xrefChecker.get().getBindingsMimeTypes();
Iterator<String> it = mimeTypes.iterator();
String mimeType;
while (it.hasNext())
{
mimeType = it.next();
- String handlerSrc = xrefChecker.getBindingHandlerSrc(mimeType);
- OPFItem handler = opfHandler.getItemByPath(handlerSrc);
+ String handlerId = context.xrefChecker.get().getBindingHandlerId(mimeType);
+ OPFItem handler = opfHandler.getItemById(handlerId).get();
if (!handler.isScripted())
{
- report.message(MessageId.OPF_046,
- new MessageLocation(handlerSrc, handler.lineNumber, handler.columnNumber));
+ report.message(MessageId.OPF_046, EPUBLocation.create(handler.getPath(),
+ handler.getLineNumber(), handler.getColumnNumber()));
+ }
+ }
+ }
+
+ // protected boolean checkItemFallbacks(OPFItem item, OPFHandler opfHandler) {
+ // String fallback = item.getFallback();
+ // if (fallback != null) {
+ // OPFItem fallbackItem = opfHandler.getItemById(fallback);
+ // if (fallbackItem != null) {
+ // String mimeType = fallbackItem.getMimeType();
+ // if (mimeType != null) {
+ // if (OPFChecker.isBlessedItemType(mimeType, version))
+ // return true;
+ // if (checkItemFallbacks(fallbackItem, opfHandler))
+ // return true;
+ // }
+ // }
+ // }
+ // return false;
+ // }
+
+ private void checkCollections()
+ {
+ for (ResourceCollection collection : ((OPFHandler30) opfHandler).getCollections().asList())
+ {
+ if (collection.hasRole(ResourceCollection.Roles.DICTIONARY))
+ {
+ checkDictCollection(collection);
+ }
+ if (collection.hasRole(ResourceCollection.Roles.INDEX))
+ {
+ checkIndexCollection(collection);
+ }
+ if (collection.hasRole(ResourceCollection.Roles.PREVIEW))
+ {
+ checkPreviewCollection(collection);
+ }
+ }
+
+ }
+
+ private void checkCollectionsContent()
+ {
+ for (ResourceCollection collection : ((OPFHandler30) opfHandler).getCollections().asList())
+ {
+ if (collection.hasRole(ResourceCollection.Roles.DICTIONARY))
+ {
+ checkDictCollectionContent(collection);
+ }
+ }
+
+ }
+
+ private void checkDictCollection(ResourceCollection collection)
+ {
+ if (collection.hasRole(Roles.DICTIONARY))
+ {
+ boolean skmFound = false;
+ for (LinkedResource resource : collection.getResources().asList())
+ {
+ Optional<OPFItem> item = opfHandler.getItemByPath(resource.getPath());
+ if (!item.isPresent())
+ {
+ report.message(MessageId.OPF_081, EPUBLocation.create(path), resource.getPath());
+ }
+ else if ("application/vnd.epub.search-key-map+xml".equals(item.get().getMimeType()))
+ {
+ if (skmFound)
+ {
+ // More than one Search Key Map
+ report.message(MessageId.OPF_082, EPUBLocation.create(path));
+ }
+ skmFound = true;
+ }
+ else if (!"application/xhtml+xml".equals(item.get().getMimeType()))
+ {
+ report.message(MessageId.OPF_084, EPUBLocation.create(path), resource.getPath());
+ }
+ }
+ if (!skmFound)
+ {
+ // No Search Key Map
+ report.message(MessageId.OPF_083, EPUBLocation.create(path));
+ }
+ }
+ }
+
+ private void checkDictCollectionContent(ResourceCollection collection)
+ {
+ if (collection.hasRole(Roles.DICTIONARY))
+ {
+ boolean dictFound = false;
+ for (LinkedResource resource : collection.getResources().asList())
+ {
+ final Optional<OPFItem> item = opfHandler.getItemByPath(resource.getPath());
+ if (!dictFound && item.isPresent()
+ && "application/xhtml+xml".equals(item.get().getMimeType()))
+ {
+ // Search if this resource was reported as DICTIONARY content
+ dictFound = Iterables.tryFind(context.featureReport.getFeature(FeatureEnum.DICTIONARY),
+ new Predicate<Feature>()
+ {
+
+ @Override
+ public boolean apply(Feature dict)
+ {
+ return item.get().getPath().equals(dict.getLocation().get().getPath());
+ }
+ }).isPresent();
+ }
+ }
+ if (!dictFound)
+ {
+ // No Dictionary content
+ report.message(MessageId.OPF_078, EPUBLocation.create(path));
}
}
}
+ private void checkIndexCollection(ResourceCollection collection)
+ {
+ if (collection.hasRole(Roles.INDEX) || collection.hasRole(Roles.INDEX_GROUP))
+ {
+ for (LinkedResource resource : collection.getResources().asList())
+ {
+ Optional<OPFItem> item = opfHandler.getItemByPath(resource.getPath());
+ if (!item.isPresent() || !"application/xhtml+xml".equals(item.get().getMimeType()))
+ {
+ report.message(MessageId.OPF_071, EPUBLocation.create(path));
+ }
+ }
+ for (ResourceCollection childCollection : collection.getCollections().asList())
+ {
+ checkIndexCollection(childCollection);
+ }
+ }
+ }
+
+ private void checkPreviewCollection(ResourceCollection collection)
+ {
-// protected boolean checkItemFallbacks(OPFItem item, OPFHandler opfHandler) {
-// String fallback = item.getFallback();
-// if (fallback != null) {
-// OPFItem fallbackItem = opfHandler.getItemById(fallback);
-// if (fallbackItem != null) {
-// String mimeType = fallbackItem.getMimeType();
-// if (mimeType != null) {
-// if (OPFChecker.isBlessedItemType(mimeType, version))
-// return true;
-// if (checkItemFallbacks(fallbackItem, opfHandler))
-// return true;
-// }
-// }
-// }
-// return false;
-// }
+ if (collection.hasRole(Roles.PREVIEW))
+ {
+ for (LinkedResource resource : collection.getResources().asList())
+ {
+ Optional<OPFItem> item = opfHandler.getItemByPath(resource.getPath());
+ if (!item.isPresent() || !("application/xhtml+xml".equals(item.get().getMimeType())
+ || "image/svg+xml".equals(item.get().getMimeType())))
+ {
+ report.message(MessageId.OPF_075, EPUBLocation.create(path));
+ }
+ else
+ {
+ try
+ {
+ URI uri = new URI(resource.getURI());
+ if (Optional.fromNullable(uri.getFragment()).or("").startsWith("epubcfi("))
+ {
+ report.message(MessageId.OPF_076, EPUBLocation.create(path));
+ }
+ } catch (URISyntaxException e)
+ {
+ report.message(MessageId.RSC_020, EPUBLocation.create(path));
+ }
+ }
+ }
+ }
+
+ }
+
+ private void checkLinkedResources()
+ {
+ LinkedResources links = ((OPFHandler30) opfHandler).getLinkedResources();
+ for (LinkedResource link : links.asList())
+ {
+ if (opfHandler.getItemByPath(link.getPath()).isPresent())
+ {
+ report.message(MessageId.OPF_067, EPUBLocation.create(path), link.getPath());
+ }
+ }
+ }
+
+ private void checkPagination()
+ {
+ if (context.profile == EPUBProfile.EDUPUB || context.pubTypes.contains(OPFData.DC_TYPE_EDUPUB))
+ {
+ if (context.featureReport.hasFeature(FeatureEnum.PAGE_BREAK))
+ {
+ // Check there is a page list
+ if (!context.featureReport.hasFeature(FeatureEnum.PAGE_LIST))
+ {
+ report.message(MessageId.NAV_003, EPUBLocation.create(path));
+ }
+ // Search a "dc:source" metadata expression
+ Set<Metadata> dcSourceMetas = ((OPFHandler30) opfHandler).getMetadata()
+ .getPrimary(DCMESVocab.VOCAB.get(DCMESVocab.PROPERTIES.SOURCE));
+ if (dcSourceMetas.isEmpty())
+ {
+ report.message(MessageId.OPF_066, EPUBLocation.create(path));
+ }
+ else
+ {
+ // Search a "source-of : pagination" expression refining a "dc:source"
+ if (!MetadataSet.tryFindInRefines(dcSourceMetas,
+ PackageVocabs.META_VOCAB.get(PackageVocabs.META_PROPERTIES.SOURCE_OF),
+ Optional.of("pagination")).isPresent())
+ {
+ report.message(MessageId.OPF_066, EPUBLocation.create(path));
+ }
+ }
+ }
+ }
+ }
+
+ private void checkSemantics()
+ {
+ if (context.profile == EPUBProfile.EDUPUB || context.pubTypes.contains(OPFData.DC_TYPE_EDUPUB))
+ {
+ if (context.featureReport.hasFeature(FeatureEnum.HAS_MICRODATA)
+ && !context.featureReport.hasFeature(FeatureEnum.HAS_RDFA))
+ {
+ report.message(MessageId.HTM_051, context.featureReport
+ .getFeature(FeatureEnum.HAS_MICRODATA).iterator().next().getLocation().get());
+ }
+ }
+ }
+
+ private void checkNav()
+ {
+ if (context.profile == EPUBProfile.EDUPUB || context.pubTypes.contains(OPFData.DC_TYPE_EDUPUB))
+ {
+ Set<Feature> sections = context.featureReport.getFeature(FeatureEnum.SECTIONS);
+ Set<Feature> tocLinks = context.featureReport.getFeature(FeatureEnum.TOC_LINKS);
+ if (sections.size() != tocLinks.size())
+ {
+ report.message(MessageId.NAV_004, tocLinks.isEmpty() ? EPUBLocation.create(path)
+ : tocLinks.iterator().next().getLocation().get());
+ }
+ if (context.featureReport.hasFeature(FeatureEnum.AUDIO)
+ && !context.featureReport.hasFeature(FeatureEnum.LOA))
+ {
+ report.message(MessageId.NAV_005, tocLinks.isEmpty() ? EPUBLocation.create(path)
+ : tocLinks.iterator().next().getLocation().get());
+ }
+ if (context.featureReport.hasFeature(FeatureEnum.FIGURE)
+ && !context.featureReport.hasFeature(FeatureEnum.LOI))
+ {
+ report.message(MessageId.NAV_006, tocLinks.isEmpty() ? EPUBLocation.create(path)
+ : tocLinks.iterator().next().getLocation().get());
+ }
+ if (context.featureReport.hasFeature(FeatureEnum.TABLE)
+ && !context.featureReport.hasFeature(FeatureEnum.LOT))
+ {
+ report.message(MessageId.NAV_007, tocLinks.isEmpty() ? EPUBLocation.create(path)
+ : tocLinks.iterator().next().getLocation().get());
+ }
+ if (context.featureReport.hasFeature(FeatureEnum.VIDEO)
+ && !context.featureReport.hasFeature(FeatureEnum.LOV))
+ {
+ report.message(MessageId.NAV_008, tocLinks.isEmpty() ? EPUBLocation.create(path)
+ : tocLinks.iterator().next().getLocation().get());
+ }
+ }
+ }
+
+ private void checkSpecifics()
+ {
+ if (context.featureReport.hasFeature(FeatureEnum.DICTIONARY)
+ && !context.pubTypes.contains(OPFData.DC_TYPE_DICT))
+ {
+ report.message(MessageId.OPF_079, context.featureReport.getFeature(FeatureEnum.DICTIONARY)
+ .iterator().next().getLocation().get());
+ }
+ if (context.profile == EPUBProfile.DICT || context.pubTypes.contains(OPFData.DC_TYPE_DICT))
+ {
+ if (!context.featureReport.hasFeature(FeatureEnum.DICTIONARY))
+ {
+ report.message(MessageId.OPF_078, EPUBLocation.create(path));
+ }
+ }
+ }
public static boolean isBlessedAudioType(String type)
{
- return type.equals("audio/mpeg") || type.equals("audio/mp4") || type.equals("audio/ogg");
+ return type.equals("audio/mpeg") || type.equals("audio/mp4");
}
public static boolean isBlessedVideoType(String type)
{
- return type.startsWith("video/h264") || type.startsWith("video/webm") || type.startsWith("video/mp4");
+ return type.startsWith("video/h264") || type.startsWith("video/webm")
+ || type.startsWith("video/mp4");
}
public static boolean isBlessedFontType(String type)
{
- return type.equals("application/vnd.ms-opentype")
- || type.equals("application/font-woff")
+ return type.equals("application/vnd.ms-opentype") || type.equals("application/font-woff")
|| type.equals("image/svg+xml");
}
public static boolean isCoreMediaType(String type)
{
- return isBlessedAudioType(type)
- || isBlessedVideoType(type)
- || isBlessedFontType(type)
- || isBlessedItemType(type, EPUBVersion.VERSION_3)
- || isBlessedImageType(type)
- || type.equals("text/javascript")
- || type.equals("application/pls+xml")
- || type.equals("application/smil+xml")
- || type.equals("image/svg+xml");
+ return isBlessedAudioType(type) || isBlessedVideoType(type) || isBlessedFontType(type)
+ || isBlessedItemType(type, EPUBVersion.VERSION_3) || isBlessedImageType(type)
+ || type.equals("text/javascript") || type.equals("application/pls+xml")
+ || type.equals("application/smil+xml") || type.equals("image/svg+xml");
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java b/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java
index e79691a..40ba1e7 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFCheckerFactory.java
@@ -22,11 +22,9 @@
package com.adobe.epubcheck.opf;
-import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
-public class OPFCheckerFactory implements DocumentValidatorFactory
+public class OPFCheckerFactory implements DocumentValidatorFactory, ContentCheckerFactory
{
static private final OPFCheckerFactory instance = new OPFCheckerFactory();
@@ -35,17 +33,15 @@ public class OPFCheckerFactory implements DocumentValidatorFactory
return instance;
}
- public DocumentValidator newInstance(Report report, String path,
- GenericResourceProvider resourceProvider, String mimeType,
- EPUBVersion version)
+ public OPFChecker newInstance(ValidationContext context)
{
- if (version == EPUBVersion.VERSION_2)
+ if (context.version == EPUBVersion.VERSION_2)
{
- return new OPFChecker(path, resourceProvider, report);
+ return new OPFChecker(context);
}
else
{
- return new OPFChecker30(path, resourceProvider, report);
+ return new OPFChecker30(context);
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFData.java b/src/main/java/com/adobe/epubcheck/opf/OPFData.java
index 7e3a994..84ef16c 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFData.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFData.java
@@ -9,7 +9,10 @@ import com.google.common.collect.Sets;
public final class OPFData
{
public static final String OPF_MIME_TYPE = "application/oebps-package+xml";
+ public static final String DC_TYPE_DICT = "dictionary";
public static final String DC_TYPE_EDUPUB = "edupub";
+ public static final String DC_TYPE_INDEX = "index";
+ public static final String DC_TYPE_PREVIEW = "preview";
public static class OPFDataBuilder
{
@@ -66,7 +69,7 @@ public final class OPFData
public String getUniqueIdentifier()
{
- // Note: can be null, correctness is checked in OPFHandler
+ // Note: can be null, correctness is checked in OPFHandler
return uniqueId;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java b/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java
index 732eb8a..865f9d5 100755
--- a/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java
@@ -22,40 +22,58 @@
package com.adobe.epubcheck.opf;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Vector;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.util.*;
+import com.adobe.epubcheck.util.DateParser;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.adobe.epubcheck.util.HandlerUtil;
+import com.adobe.epubcheck.util.InvalidDateException;
+import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLHandler;
import com.adobe.epubcheck.xml.XMLParser;
-
-import java.text.SimpleDateFormat;
-import java.util.*;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.Maps;
public class OPFHandler implements XMLHandler
{
- final Hashtable<String, OPFItem> itemMapById = new Hashtable<String, OPFItem>();
- final Hashtable<String, OPFItem> itemMapByPath = new Hashtable<String, OPFItem>();
- String pageMapId = null;
- MessageLocation pageMapReferenceLocation = null;
+ protected final String path;
+ protected final XMLParser parser;
+ protected final Report report;
+ protected final ValidationContext context;
+
+ protected String pageMapId = null;
+ protected EPUBLocation pageMapReferenceLocation = null;
+
+ // Map of ID to OPFItem builders
+ // Final OPFItem objects will be built after parsing
+ protected final Map<String, OPFItem.Builder> itemBuilders = Maps.newLinkedHashMap();
+ protected final Map<String, OPFItem.Builder> itemBuildersByPath = Maps.newLinkedHashMap();
+ // A list of all spine item IDs
+ private final List<String> spineIDs = new LinkedList<String>();
+ // Represents the set of items in this Package Doc
+ private OPFItems items = null;
// Hashtable encryptedItems;
- final XMLParser parser;
-
- private final Vector<OPFItem> spine = new Vector<OPFItem>();
- final Vector<OPFItem> items = new Vector<OPFItem>();
private final Vector<OPFReference> refs = new Vector<OPFReference>();
- final Report report;
-
private static final HashSet<String> validRoles = new HashSet<String>();
- final String path;
-
- final XRefChecker xrefChecker;
-
// This string holds the value of the <package> element's unique-identifier
// attribute
// that will be used to make sure that the unique-identifier references an
@@ -69,53 +87,41 @@ public class OPFHandler implements XMLHandler
// unique-identifier attribute
// from the packaging element. The default value is false.
private boolean uniqueIdentExists = false;
- // This string holds the value of the <dc:identifier> element detected
- String uid;
-
- private boolean opf12PackageFile = false;
+ // This string holds the value of the <dc:identifier> element detected
+ String uid;
- private final EPUBVersion version;
+ private boolean opf12PackageFile = false;
- private boolean globalPrePaginated = false;
private boolean checkedUnsupportedXmlVersion = false;
static
{
- String[] list = {"acp", "act", "adp", "aft", "anl", "anm", "ann",
- "ant", "app", "aqt", "arc", "ard", "arr", "art", "asg", "asn",
- "att", "auc", "aud", "aui", "aus", "aut", "bdd", "bjd", "bkd",
- "bkp", "bnd", "bpd", "bsl", "ccp", "chr", "clb", "cli", "cll",
- "clr", "clt", "cmm", "cmp", "cmt", "cng", "cnd", "cns", "coe",
- "col", "com", "cos", "cot", "cov", "cpc", "cpe", "cph", "cpl",
- "cpt", "cre", "crp", "crr", "csl", "csp", "cst", "ctb", "cte",
- "ctg", "ctr", "cts", "ctt", "cur", "cwt", "dfd", "dfe", "dft",
- "dgg", "dis", "dln", "dnc", "dnr", "dpc", "dpt", "drm", "drt",
- "dsr", "dst", "dtc", "dte", "dtm", "dto", "dub", "edt", "egr",
- "elg", "elt", "eng", "etr", "exp", "fac", "fld", "flm", "fmo",
- "fpy", "fnd", "frg", "gis", "grt", "hnr", "hst", "ill", "ilu",
- "ins", "inv", "itr", "ive", "ivr", "lbr", "lbt", "ldr", "led",
- "lee", "lel", "len", "let", "lgd", "lie", "lil", "lit", "lsa",
- "lse", "lso", "ltg", "lyr", "mcp", "mfr", "mdc", "mod", "mon",
- "mrk", "msd", "mte", "mus", "nrt", "opn", "org", "orm", "oth",
- "own", "pat", "pbd", "pbl", "pdr", "pfr", "pht", "plt", "pma",
- "pmn", "pop", "ppm", "ppt", "prc", "prd", "prf", "prg", "prm",
- "pro", "prt", "pta", "pte", "ptf", "pth", "ptt", "rbr", "rce",
- "rcp", "red", "ren", "res", "rev", "rps", "rpt", "rpy", "rse",
- "rsg", "rsp", "rst", "rth", "rtm", "sad", "sce", "scl", "scr",
- "sds", "sec", "sgn", "sht", "sng", "spk", "spn", "spy", "srv",
- "std", "stl", "stm", "stn", "str", "tcd", "tch", "ths", "trc",
- "trl", "tyd", "tyg", "vdg", "voc", "wam", "wdc", "wde", "wit"};
+ String[] list = { "acp", "act", "adp", "aft", "anl", "anm", "ann", "ant", "app", "aqt", "arc",
+ "ard", "arr", "art", "asg", "asn", "att", "auc", "aud", "aui", "aus", "aut", "bdd", "bjd",
+ "bkd", "bkp", "bnd", "bpd", "bsl", "ccp", "chr", "clb", "cli", "cll", "clr", "clt", "cmm",
+ "cmp", "cmt", "cng", "cnd", "cns", "coe", "col", "com", "cos", "cot", "cov", "cpc", "cpe",
+ "cph", "cpl", "cpt", "cre", "crp", "crr", "csl", "csp", "cst", "ctb", "cte", "ctg", "ctr",
+ "cts", "ctt", "cur", "cwt", "dfd", "dfe", "dft", "dgg", "dis", "dln", "dnc", "dnr", "dpc",
+ "dpt", "drm", "drt", "dsr", "dst", "dtc", "dte", "dtm", "dto", "dub", "edt", "egr", "elg",
+ "elt", "eng", "etr", "exp", "fac", "fld", "flm", "fmo", "fpy", "fnd", "frg", "gis", "grt",
+ "hnr", "hst", "ill", "ilu", "ins", "inv", "itr", "ive", "ivr", "lbr", "lbt", "ldr", "led",
+ "lee", "lel", "len", "let", "lgd", "lie", "lil", "lit", "lsa", "lse", "lso", "ltg", "lyr",
+ "mcp", "mfr", "mdc", "mod", "mon", "mrk", "msd", "mte", "mus", "nrt", "opn", "org", "orm",
+ "oth", "own", "pat", "pbd", "pbl", "pdr", "pfr", "pht", "plt", "pma", "pmn", "pop", "ppm",
+ "ppt", "prc", "prd", "prf", "prg", "prm", "pro", "prt", "pta", "pte", "ptf", "pth", "ptt",
+ "rbr", "rce", "rcp", "red", "ren", "res", "rev", "rps", "rpt", "rpy", "rse", "rsg", "rsp",
+ "rst", "rth", "rtm", "sad", "sce", "scl", "scr", "sds", "sec", "sgn", "sht", "sng", "spk",
+ "spn", "spy", "srv", "std", "stl", "stm", "stn", "str", "tcd", "tch", "ths", "trc", "trl",
+ "tyd", "tyg", "vdg", "voc", "wam", "wdc", "wde", "wit" };
Collections.addAll(validRoles, list);
}
- public OPFHandler(String path, Report report,
- XRefChecker xrefChecker, XMLParser parser, EPUBVersion version)
+ public OPFHandler(ValidationContext context, XMLParser parser)
{
- this.path = path;
- this.report = report;
- this.xrefChecker = xrefChecker;
+ this.context = context;
+ this.path = context.path;
+ this.report = context.report;
this.parser = parser;
- this.version = version;
}
public boolean getOpf12PackageFile()
@@ -128,34 +134,60 @@ public class OPFHandler implements XMLHandler
return (!opf12PackageFile);
}
- public OPFItem getItemById(String id)
- {
- return itemMapById.get(id);
- }
-
- public OPFItem getItemByPath(String path)
- {
- return itemMapByPath.get(path);
- }
-
- public int getSpineItemCount()
+ /**
+ * Search the list of item by ID.
+ *
+ * @param id
+ * the ID of the item to search
+ * @return an {@link Optional} containing the item of the given ID if found,
+ * or {@link Optional#absent()}
+ */
+ public Optional<OPFItem> getItemById(String id)
{
- return spine.size();
+ return (items != null) ? items.getItemById(id) : Optional.<OPFItem> absent();
}
- public OPFItem getSpineItem(int index)
+ /**
+ * Search the list of item by path.
+ *
+ * @param id
+ * the path of the item to search
+ * @return an {@link Optional} containing the item of the given path if found,
+ * or {@link Optional#absent()}
+ */
+ public Optional<OPFItem> getItemByPath(String path)
{
- return spine.elementAt(index);
+ return (items != null) ? items.getItemByPath(path) : Optional.<OPFItem> absent();
}
- public int getItemCount()
+ /**
+ * Returns an immutable list of the items in the spine. May contain duplicates
+ * if several <code>itemref</code> elements point to the same item.
+ * <p>
+ * Returns the empty list if the items have not been parsed yet.
+ * </p>
+ *
+ * @return the list of items in the spine, guaranteed non-null.
+ */
+ public List<OPFItem> getSpineItems()
{
- return items.size();
+ return (items != null) ? items.getSpineItems() : ImmutableList.<OPFItem> of();
}
- public OPFItem getItem(int index)
+ /**
+ * Returns an immutable list of all the items in the OPF, in document order,
+ * including those represented by <code>link</code> elements pointing to local
+ * resources.
+ *
+ * <p>
+ * Returns the empty list if the items have not been parsed yet.
+ * </p>
+ *
+ * @return the list of all items, guaranteed non-null.
+ */
+ public List<OPFItem> getItems()
{
- return items.elementAt(index);
+ return (items != null) ? items.getItems() : ImmutableList.<OPFItem> of();
}
public int getReferenceCount()
@@ -180,10 +212,12 @@ public class OPFHandler implements XMLHandler
{
return uniqueIdentExists;
}
-
- public String getUid() {
- return uid;
- }
+
+ public String getUid()
+ {
+ return uid;
+ }
+
// public void setEncryptedItems(Hashtable encryptedItems) {
// this.encryptedItems = encryptedItems;
// }
@@ -200,12 +234,10 @@ public class OPFHandler implements XMLHandler
HandlerUtil.checkXMLVersion(parser);
checkedUnsupportedXmlVersion = true;
}
- boolean registerEntry = true;
XMLElement e = parser.getCurrentElement();
String ns = e.getNamespace();
-
- if (ns == null
- || ns.equals("")
+
+ if (ns == null || ns.equals("")
|| ns.equals("http://openebook.org/namespaces/oeb-package/1.0/")
|| ns.equals("http://www.idpf.org/2007/opf"))
{
@@ -214,15 +246,16 @@ public class OPFHandler implements XMLHandler
{
if (!ns.equals("http://www.idpf.org/2007/opf"))
{
- report.message(MessageId.OPF_047, new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ report.message(MessageId.OPF_047,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
opf12PackageFile = true;
}
/*
- * This section checks to see the value of the unique-identifier
- * attribute and stores it in the String uniqueIdent or reports
- * an error if the unique-identifier attribute is missing or
- * does not have a value
- */
+ * This section checks to see the value of the unique-identifier
+ * attribute and stores it in the String uniqueIdent or reports an error
+ * if the unique-identifier attribute is missing or does not have a
+ * value
+ */
String uniqueIdentAttr = e.getAttribute("unique-identifier");
if (uniqueIdentAttr != null && !uniqueIdentAttr.equals(""))
{
@@ -230,101 +263,75 @@ public class OPFHandler implements XMLHandler
}
else
{
- report.message(MessageId.OPF_048, new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ report.message(MessageId.OPF_048,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
}
else if (name.equals("item"))
{
String id = e.getAttribute("id");
- String href = e.getAttribute("href");
- if (href != null
- && !(version == EPUBVersion.VERSION_3 && href
- .matches("^[^:/?#]+://.*"))) {
- try
- {
- href = PathUtil.resolveRelativeReference(path, href,
- null);
- }
- catch (IllegalArgumentException ex)
- {
- report.message(MessageId.OPF_010,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href),
- ex.getMessage());
- href = null;
- }
- }
- if (href != null && href.matches("^[^:/?#]+://.*")) {
-
- report.info(path, FeatureEnum.REFERENCE, href);
- }
- String mimeType = e.getAttribute("media-type");
- String fallback = e.getAttribute("fallback");
-
- // dirty fix for issue 271: treat @fallback attribute in EPUB3 like fallback-style in EPUB2
- // then all the epubcheck mechanisms on checking stylesheet fallbacks will work as in EPUB 2
- String fallbackStyle = (version == EPUBVersion.VERSION_3) ? e.getAttribute("fallback") : e.getAttribute("fallback-style");
-
- String namespace = e.getAttribute("island-type");
- String properties = e.getAttribute("properties");
- if (properties != null)
- {
- properties = properties.replaceAll("[\\s]+", " ");
- }
-
- if (version == EPUBVersion.VERSION_3
- && href.matches("^[^:/?#]+://.*")
- && !OPFChecker30.isBlessedAudioType(mimeType)
- && !OPFChecker30.isBlessedVideoType(mimeType))
+ if (id != null)
{
- if (OPFChecker30.isCoreMediaType(mimeType))
+ String href = e.getAttribute("href");
+ if (href != null
+ && !(context.version == EPUBVersion.VERSION_3 && href.matches("^[^:/?#]+://.*")))
{
- report.message(MessageId.OPF_010,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), href);
+ try
+ {
+ href = PathUtil.resolveRelativeReference(path, href, null);
+ } catch (IllegalArgumentException ex)
+ {
+ report
+ .message(MessageId.OPF_010, EPUBLocation.create(path, parser.getLineNumber(),
+ parser.getColumnNumber(), href), ex.getMessage());
+ href = null;
+ }
}
- else
+ if (href != null && href.matches("^[^:/?#]+://.*"))
{
- // mgy 20120414: this shouldn't even be a warning
- // report.warning(
- // path,
- // parser.getLineNumber(),
- // parser.getColumnNumber(),
- // "Remote resource not validated");
- }
- }
- OPFItem item = new OPFItem(id, href, mimeType, fallback,
- fallbackStyle, namespace, properties,
- parser.getLineNumber(), parser.getColumnNumber());
-
- if (id != null)
- {
- itemMapById.put(id, item);
- report.info(href, FeatureEnum.UNIQUE_IDENT, id);
- }
- else
- {
- System.err.printf("Item is missing id : %s\n", href);
- }
- if (properties != null)
- {
- String propertyArray[] = properties.split(" ");
- for (String aPropertyArray : propertyArray)
+ report.info(path, FeatureEnum.REFERENCE, href);
+ }
+ String mimeType = e.getAttribute("media-type");
+ String fallback = e.getAttribute("fallback");
+
+ // dirty fix for issue 271: treat @fallback attribute in EPUB3 like
+ // fallback-style in EPUB2
+ // then all the epubcheck mechanisms on checking stylesheet fallbacks
+ // will work as in EPUB 2
+ String fallbackStyle = (context.version == EPUBVersion.VERSION_3) ? e
+ .getAttribute("fallback") : e.getAttribute("fallback-style");
+
+ if (context.version == EPUBVersion.VERSION_3 && href.matches("^[^:/?#]+://.*")
+ && !OPFChecker30.isBlessedAudioType(mimeType)
+ && !OPFChecker30.isBlessedVideoType(mimeType))
{
- if (aPropertyArray.equals("nav"))
+ if (OPFChecker30.isCoreMediaType(mimeType))
{
- item.setNav(true);
+ report
+ .message(MessageId.RSC_006,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()),
+ href);
}
- if (aPropertyArray.equals("scripted"))
+ else
{
- item.setScripted(true);
+ // mgy 20120414: this shouldn't even be a warning
+ // report.warning(
+ // path,
+ // parser.getLineNumber(),
+ // parser.getColumnNumber(),
+ // "Remote resource not validated");
}
}
- }
- if (href != null && registerEntry)
- {
- itemMapByPath.put(href, item);
- items.add(item);
+ OPFItem.Builder itemBuilder = new OPFItem.Builder(id, href, mimeType,
+ parser.getLineNumber(), parser.getColumnNumber()).fallback(fallback).fallbackStyle(
+ fallbackStyle);
+
+ itemBuilders.put(id.trim(), itemBuilder);
+ itemBuildersByPath.put(href, itemBuilder);
+
+ report.info(href, FeatureEnum.UNIQUE_IDENT, id);
}
}
else if (name.equals("reference"))
@@ -332,21 +339,18 @@ public class OPFHandler implements XMLHandler
String type = e.getAttribute("type");
String title = e.getAttribute("title");
String href = e.getAttribute("href");
- if (href != null && xrefChecker != null)
+ if (href != null && context.xrefChecker.isPresent())
{
try
{
- href = PathUtil.resolveRelativeReference(path, href,
- null);
- xrefChecker.registerReference(path,
- parser.getLineNumber(),
- parser.getColumnNumber(), href,
- XRefChecker.RT_GENERIC);
- }
- catch (IllegalArgumentException ex)
+ href = PathUtil.resolveRelativeReference(path, href, null);
+ context.xrefChecker.get().registerReference(path, parser.getLineNumber(),
+ parser.getColumnNumber(), href, XRefChecker.Type.GENERIC);
+ } catch (IllegalArgumentException ex)
{
report.message(MessageId.OPF_010,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href), ex.getMessage());
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href),
+ ex.getMessage());
href = null;
}
}
@@ -354,9 +358,9 @@ public class OPFHandler implements XMLHandler
{
report.info(path, FeatureEnum.REFERENCE, href);
}
-
- OPFReference ref = new OPFReference(type, title, href,
- parser.getLineNumber(), parser.getColumnNumber());
+
+ OPFReference ref = new OPFReference(type, title, href, parser.getLineNumber(),
+ parser.getColumnNumber());
refs.add(ref);
}
else if (name.equals("spine"))
@@ -365,32 +369,24 @@ public class OPFHandler implements XMLHandler
if (pageMap != null)
{
pageMapId = pageMap;
- pageMapReferenceLocation = new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), String.format("page-map=\"%1$s\"", pageMapId));
+ pageMapReferenceLocation = EPUBLocation.create(path, parser.getLineNumber(),
+ parser.getColumnNumber(), String.format("page-map=\"%1$s\"", pageMapId));
report.message(MessageId.OPF_062, pageMapReferenceLocation);
}
String idref = e.getAttribute("toc");
if (idref != null)
{
- OPFItem toc = itemMapById.get(idref);
- if (toc == null)
+ if (itemBuilders.containsKey(idref.trim()))
{
- report.message(MessageId.OPF_049,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- idref);
- report.info(null, FeatureEnum.HAS_NCX, "false");
+ OPFItem.Builder toc = itemBuilders.get(idref.trim());
+ toc.ncx();
}
else
{
- toc.setNcx(true);
- report.info(toc.getPath(), FeatureEnum.HAS_NCX, "true");
- if (toc.getMimeType() != null
- && !toc.getMimeType().equals(
- "application/x-dtbncx+xml"))
- {
- report.message(MessageId.OPF_050,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
- }
+ report.message(MessageId.OPF_049,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), idref);
+ report.info(null, FeatureEnum.HAS_NCX, "false");
}
}
else
@@ -403,51 +399,24 @@ public class OPFHandler implements XMLHandler
String idref = e.getAttribute("idref");
if (idref != null)
{
- OPFItem item = getItemById(idref);
- if (item != null)
+ if (itemBuilders.containsKey(idref.trim()))
{
- spine.add(item);
- item.setInSpine(true);
- report.info(item.getPath(), FeatureEnum.IS_SPINEITEM, "true");
- String linear = e.getAttribute("linear");
- if (linear != null && "no".equals(linear.trim()))
+ spineIDs.add(idref.trim());
+ OPFItem.Builder item = itemBuilders.get(idref.trim());
+ if (item != null)
{
- item.setSpineLinear(false);
- }
- else
- {
- item.setSpineLinear(true);
- }
- report.info(item.getPath(), FeatureEnum.IS_LINEAR, String.valueOf(item.getSpineLinear()));
-
- boolean isFixed = globalPrePaginated;
- String properties = e.getAttribute("properties");
- if (properties != null && !properties.equals(""))
- {
- properties = properties.replaceAll("[\\s]+", " ");
- String propertyArray[] = properties.split(" ");
- for (String prop : propertyArray)
+ item.inSpine();
+ String linear = e.getAttribute("linear");
+ if (linear != null && "no".equals(linear.trim()))
{
- if (prop.equals("rendition:layout-pre-paginated"))
- {
- isFixed = true;
- }
- else if (prop.equals("rendition:layout-reflowable"))
- {
- isFixed = false;
- }
+ item.nonlinear();
}
}
- if (isFixed)
- {
- report.info(item.getPath(), FeatureEnum.HAS_FIXED_LAYOUT, String.valueOf(true));
- }
}
else
{
report.message(MessageId.OPF_049,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- idref);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), idref);
}
}
}
@@ -456,8 +425,7 @@ public class OPFHandler implements XMLHandler
if (!opf12PackageFile)
{
report.message(MessageId.OPF_049,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- name);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), name);
}
}
}
@@ -473,8 +441,7 @@ public class OPFHandler implements XMLHandler
if (name.equals("identifier"))
{
String idAttr = e.getAttribute("id");
- if (idAttr != null && !idAttr.equals("")
- && idAttr.equals(uniqueIdent))
+ if (idAttr != null && !idAttr.equals("") && idAttr.equals(uniqueIdent))
{
uniqueIdentExists = true;
}
@@ -485,7 +452,7 @@ public class OPFHandler implements XMLHandler
if (role != null && !role.equals("") && !isValidRole(role))
{
report.message(MessageId.OPF_052,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), role);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), role);
}
}
}
@@ -500,7 +467,10 @@ public class OPFHandler implements XMLHandler
{
XMLElement e = parser.getCurrentElement();
- if ("http://www.idpf.org/2007/opf".equals(e.getNamespace()))
+ String ns = e.getNamespace();
+ if (ns == null || ns.equals("")
+ || ns.equals("http://openebook.org/namespaces/oeb-package/1.0/")
+ || ns.equals("http://www.idpf.org/2007/opf"))
{
String name = e.getName();
// <meta property="dcterms:modified">2012-02-27T16:38:35Z</meta>
@@ -511,37 +481,15 @@ public class OPFHandler implements XMLHandler
if ("dcterms:modified".equals(attr))
{
String val = (String) e.getPrivateData();
- report.info(null, FeatureEnum.MODIFIED_DATE, val);
- }
- else if ("rendition:layout".equals(attr))
- {
- String val = (String) e.getPrivateData();
- if ("pre-paginated".equals(val))
- {
- report.info(null, FeatureEnum.HAS_FIXED_LAYOUT,
- "pre-paginated");
- globalPrePaginated = true;
- }
- }
- else
- {
- String attr1 = e.getAttribute("name");
- if ("fixed-layout".equals(attr1)
- && "true".equals(e.getAttribute("content")))
- {
- report.info(null, FeatureEnum.HAS_FIXED_LAYOUT,
- "fixed-layout");
- }
+ report.info(null, FeatureEnum.MODIFIED_DATE, val);
}
}
else if ("package".equals(name))
{
- if(pageMapId != null)
+ buildItems();
+ if (pageMapId != null && !getItemById(pageMapId).isPresent())
{
- if (null == itemMapById.get(pageMapId))
- {
- report.message(MessageId.OPF_063, pageMapReferenceLocation, pageMapId);
- }
+ report.message(MessageId.OPF_063, pageMapReferenceLocation, pageMapId);
}
}
}
@@ -551,16 +499,14 @@ public class OPFHandler implements XMLHandler
if (name.equals("identifier"))
{
String idAttr = e.getAttribute("id");
- if (idAttr != null && !idAttr.equals("")
- && idAttr.equals(uniqueIdent))
+ if (idAttr != null && !idAttr.equals("") && idAttr.trim().equals(uniqueIdent))
{
String idval = (String) e.getPrivateData();
// if (idval != null && ocf != null)
// ocf.setUniqueIdentifier(idval);
if (idval != null)
{
- report.info(null, FeatureEnum.UNIQUE_IDENT,
- idval.trim());
+ report.info(null, FeatureEnum.UNIQUE_IDENT, idval.trim());
}
}
}
@@ -582,18 +528,16 @@ public class OPFHandler implements XMLHandler
{
Date date = dateParser.parse(dateval.trim());
/*
- * mg: DateParser does not enforce four-digit years,
- * which http://www.w3.org/TR/NOTE-datetime seems to
- * want
- */
+ * mg: DateParser does not enforce four-digit years, which
+ * http://www.w3.org/TR/NOTE-datetime seems to want
+ */
String year = new SimpleDateFormat("yyyy").format(date);
if (year.length() > 4)
{
throw new InvalidDateException(year);
}
report.info(null, FeatureEnum.DC_DATE, dateval);
- }
- catch (InvalidDateException d)
+ } catch (InvalidDateException d)
{
valid = false;
detail = d.getMessage();
@@ -602,19 +546,17 @@ public class OPFHandler implements XMLHandler
if (!valid)
{
- if (this.version == EPUBVersion.VERSION_3)
+ if (context.version == EPUBVersion.VERSION_3)
{
report.message(MessageId.OPF_053,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- (dateval == null ? "" : dateval),
- detail);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()),
+ (dateval == null ? "" : dateval), detail);
}
else
{
report.message(MessageId.OPF_054,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- (dateval == null ? "" : dateval),
- detail);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()),
+ (dateval == null ? "" : dateval), detail);
}
}
}
@@ -642,63 +584,57 @@ public class OPFHandler implements XMLHandler
report.info(null, FeatureEnum.DC_TITLE, value.trim());
}
}
- if (version == EPUBVersion.VERSION_2)
+ if (context.version == EPUBVersion.VERSION_2)
{
String value = (String) e.getPrivateData();
if (value == null || value.trim().length() < 1)
{
report.message(MessageId.OPF_055,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
- name);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), name);
}
}
}
- else if (name.equals("creator"))
- {
- String value = (String) e.getPrivateData();
- if (value != null)
- {
- report.info(null, FeatureEnum.DC_CREATOR, value.trim());
- }
- }
- else if (name.equals("contributor"))
- {
- String value = (String) e.getPrivateData();
- if (value != null)
- {
- report.info(null, FeatureEnum.DC_CONTRIBUTOR, value.trim());
- }
- }
- else if (name.equals("publisher"))
- {
- String value = (String) e.getPrivateData();
- if (value != null)
- {
- report.info(null, FeatureEnum.DC_PUBLISHER, value.trim());
- }
- }
- else if (name.equals("rights"))
- {
- String value = (String) e.getPrivateData();
- if (value != null)
- {
- report.info(null, FeatureEnum.DC_RIGHTS, value.trim());
- }
- }
- else if (name.equals("subject"))
+ else
{
- String value = (String) e.getPrivateData();
- if (value != null)
+
+ Optional<String> value = Optional.fromNullable(Strings.emptyToNull(Strings.nullToEmpty(
+ (String) e.getPrivateData()).trim()));
+
+ // Check for empty metadta (USAGE) in EPUB 2
+ // Empty metadata is forbidden and checked with schema in EPUB 3
+ if (context.version == EPUBVersion.VERSION_2 && !value.isPresent())
{
- report.info(null, FeatureEnum.DC_SUBJECT, value.trim());
+ report.message(MessageId.OPF_072,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), "dc:"
+ + name);
}
- }
- else if (name.equals("description"))
- {
- String value = (String) e.getPrivateData();
- if (value != null)
+ // Report metadata
+ else if (value.isPresent())
{
- report.info(null, FeatureEnum.DC_DESCRIPTION, value.trim());
+ if (name.equals("creator"))
+ {
+ report.info(null, FeatureEnum.DC_CREATOR, value.get());
+ }
+ else if (name.equals("contributor"))
+ {
+ report.info(null, FeatureEnum.DC_CONTRIBUTOR, value.get());
+ }
+ else if (name.equals("publisher"))
+ {
+ report.info(null, FeatureEnum.DC_PUBLISHER, value.get());
+ }
+ else if (name.equals("rights"))
+ {
+ report.info(null, FeatureEnum.DC_RIGHTS, value.get());
+ }
+ else if (name.equals("subject"))
+ {
+ report.info(null, FeatureEnum.DC_SUBJECT, value.get());
+ }
+ else if (name.equals("description"))
+ {
+ report.info(null, FeatureEnum.DC_DESCRIPTION, value.get());
+ }
}
}
}
@@ -735,4 +671,41 @@ public class OPFHandler implements XMLHandler
public void processingInstruction(String arg0, String arg1)
{
}
+
+ // Build the final items from the item builders
+ private void buildItems()
+ {
+ Preconditions.checkState(items == null);
+ items = OPFItems.build(itemBuilders.values(), spineIDs);
+
+ for (OPFItem item : items.getItems())
+ {
+ reportItem(item);
+ }
+ }
+
+ /**
+ * Report features or messages for a given item.
+ *
+ * @param item
+ * the item to report.
+ */
+ protected void reportItem(OPFItem item)
+ {
+ if (item.isInSpine())
+ {
+ report.info(item.getPath(), FeatureEnum.IS_SPINEITEM, "true");
+ report.info(item.getPath(), FeatureEnum.IS_LINEAR, String.valueOf(item.isLinear()));
+ }
+ if (item.isNcx())
+ {
+ report.info(item.getPath(), FeatureEnum.HAS_NCX, "true");
+ if (!item.getMimeType().equals("application/x-dtbncx+xml"))
+ {
+ report.message(MessageId.OPF_050,
+ EPUBLocation.create(path, item.getLineNumber(), item.getColumnNumber()));
+ }
+ }
+
+ }
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFHandler30.java b/src/main/java/com/adobe/epubcheck/opf/OPFHandler30.java
index 2c27ff4..40f78e5 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFHandler30.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFHandler30.java
@@ -25,27 +25,40 @@ package com.adobe.epubcheck.opf;
import static com.adobe.epubcheck.vocab.ForeignVocabs.*;
import static com.adobe.epubcheck.vocab.PackageVocabs.*;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Deque;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.QuietReport;
-import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.opf.ResourceCollection.Roles;
+import com.adobe.epubcheck.opf.XRefChecker.Type;
+import com.adobe.epubcheck.util.EpubConstants;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.PathUtil;
+import com.adobe.epubcheck.vocab.DCMESVocab;
import com.adobe.epubcheck.vocab.EnumVocab;
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
import com.adobe.epubcheck.vocab.MediaOverlaysVocab;
import com.adobe.epubcheck.vocab.PackageVocabs.ITEM_PROPERTIES;
import com.adobe.epubcheck.vocab.Property;
import com.adobe.epubcheck.vocab.RenditionVocabs;
+import com.adobe.epubcheck.vocab.ScriptedCompVocab;
import com.adobe.epubcheck.vocab.Vocab;
import com.adobe.epubcheck.vocab.VocabUtil;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLParser;
+import com.google.common.base.Optional;
+import com.google.common.base.Splitter;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
public class OPFHandler30 extends OPFHandler
{
@@ -55,7 +68,8 @@ public class OPFHandler30 extends OPFHandler
.put(SCHEMA_PREFIX, SCHEMA_VOCAB).put(XSD_PREFIX, XSD_VOCAB).build();
private static final Map<String, Vocab> RESERVED_META_VOCABS = new ImmutableMap.Builder<String, Vocab>()
.put("", META_VOCAB).put(MediaOverlaysVocab.PREFIX, MediaOverlaysVocab.VOCAB)
- .put(RenditionVocabs.PREFIX, RenditionVocabs.META_VOCAB).putAll(RESERVED_VOCABS).build();
+ .put(RenditionVocabs.PREFIX, RenditionVocabs.META_VOCAB)
+ .put(ScriptedCompVocab.PREFIX, ScriptedCompVocab.VOCAB).putAll(RESERVED_VOCABS).build();
private static final Map<String, Vocab> RESERVED_ITEM_VOCABS = new ImmutableMap.Builder<String, Vocab>()
.put("", ITEM_VOCAB).put(MediaOverlaysVocab.PREFIX, VocabUtil.EMPTY_VOCAB)
.put(RenditionVocabs.PREFIX, VocabUtil.EMPTY_VOCAB).putAll(RESERVED_VOCABS).build();
@@ -85,17 +99,26 @@ public class OPFHandler30 extends OPFHandler
private static final Set<String> DEFAULT_VOCAB_URIS = ImmutableSet.of(PACKAGE_VOCAB_URI,
LINKREL_VOCAB_URI);
+ private static final Splitter TOKENIZER = Splitter.onPattern("\\s+");
+
private Map<String, Vocab> itemrefVocabs;
private Map<String, Vocab> itemVocabs;
private Map<String, Vocab> metaVocabs;
private Map<String, Vocab> linkrelVocabs;
-
- OPFHandler30(String path, Report report, XRefChecker xrefChecker, XMLParser parser,
- EPUBVersion version)
+ private final Deque<MetadataSet.Builder> metadataBuilders = Lists.newLinkedList();
+ private MetadataSet metadata = null;
+ private final Deque<LinkedResources.Builder> linkedResourcesBuilders = Lists.newLinkedList();
+ private LinkedResources linkedResources = null;
+ private final Deque<ResourceCollection.Builder> collectionBuilders = Lists.newLinkedList();
+ private final ResourceCollections.Builder collectionsBuilder = ResourceCollections.builder();
+ private ResourceCollections collections = null;
+
+ OPFHandler30(ValidationContext context, XMLParser parser)
{
- super(path, report, xrefChecker, parser, version);
+ super(context, parser);
}
+ @Override
public void startElement()
{
super.startElement();
@@ -103,47 +126,197 @@ public class OPFHandler30 extends OPFHandler
XMLElement e = parser.getCurrentElement();
String name = e.getName();
- if (name.equals("package"))
- {
- // Note: the #parsePrefixDeclaration is called once for each "class" of
- // properties (meta+scheme, itemref, item, and link) so that default and
- // reserved vocabs can be set appropriately (e.g. the default vocab or
- // rendition vocab for 'meta' properties is not the same as for the 'item'
- // properties)
- // Messages are reported only on the first invocation; a quiet reporter is
- // used for subsequent invocations.
- String prefixDecl = e.getAttribute("prefix");
- MessageLocation loc = new MessageLocation(path, parser.getLineNumber(),
- parser.getColumnNumber());
- metaVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_META_VOCABS,
- KNOWN_META_VOCAB_URIS, DEFAULT_VOCAB_URIS, report, loc);
- itemVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_ITEM_VOCABS,
- KNOWN_ITEM_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
- itemrefVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_ITEMREF_VOCABS,
- KNOWN_ITEMREF_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
- linkrelVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_LINKREL_VOCABS,
- KNOWN_LINKREL_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
- }
- else if (name.equals("meta"))
- {
- processMeta(e);
- }
- else if (name.equals("link"))
+ if (EpubConstants.OpfNamespaceUri.equals(e.getNamespace()))
{
- processLink(e);
- }
- else if (name.equals("item"))
- {
- processItemProperties(e.getAttribute("properties"), e.getAttribute("media-type"));
+ if (name.equals("package"))
+ {
+ // Note: the #parsePrefixDeclaration is called once for each "class" of
+ // properties (meta+scheme, itemref, item, and link) so that default and
+ // reserved vocabs can be set appropriately (e.g. the default vocab or
+ // rendition vocab for 'meta' properties is not the same as for the
+ // 'item'
+ // properties)
+ // Messages are reported only on the first invocation; a quiet reporter
+ // is
+ // used for subsequent invocations.
+ String prefixDecl = e.getAttribute("prefix");
+ EPUBLocation loc = EPUBLocation.create(path, parser.getLineNumber(),
+ parser.getColumnNumber());
+ metaVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_META_VOCABS,
+ KNOWN_META_VOCAB_URIS, DEFAULT_VOCAB_URIS, report, loc);
+ itemVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_ITEM_VOCABS,
+ KNOWN_ITEM_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
+ itemrefVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_ITEMREF_VOCABS,
+ KNOWN_ITEMREF_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
+ linkrelVocabs = VocabUtil.parsePrefixDeclaration(prefixDecl, RESERVED_LINKREL_VOCABS,
+ KNOWN_LINKREL_VOCAB_URIS, DEFAULT_VOCAB_URIS, QuietReport.INSTANCE, loc);
+ }
+ else if (name.equals("metadata"))
+ {
+ metadataBuilders.addFirst(MetadataSet.builder());
+ linkedResourcesBuilders.addFirst(LinkedResources.builder());
+ }
+ else if (name.equals("link"))
+ {
+ processLink(e);
+ }
+ else if (name.equals("item"))
+ {
+ String id = e.getAttribute("id");
+ OPFItem.Builder itemBuilder = itemBuilders.get(id);
+ if (itemBuilder != null)
+ {
+ processItemProperties(itemBuilder, e.getAttribute("properties"),
+ e.getAttribute("media-type"));
+ }
+ }
+ else if (name.equals("itemref"))
+ {
+ String idref = e.getAttribute("idref");
+
+ OPFItem.Builder itemBuilder = itemBuilders.get(idref);
+ if (itemBuilder != null)
+ {
+ processItemrefProperties(itemBuilder, e.getAttribute("properties"));
+ }
+ }
+ else if (name.equals("mediaType"))
+ {
+ processBinding(e);
+ }
+ else if (name.equals("collection"))
+ {
+ collectionBuilders.addFirst(
+ ResourceCollection.builder().roles(processCollectionRole(e.getAttribute("role"))));
+ linkedResourcesBuilders.addFirst(LinkedResources.builder());
+ }
}
- else if (name.equals("itemref"))
+ }
+
+ @Override
+ public void endElement()
+ {
+
+ XMLElement e = parser.getCurrentElement();
+ String name = e.getName();
+ if (EpubConstants.OpfNamespaceUri.equals(e.getNamespace()))
{
- processItemrefProperties(e.getAttribute("properties"));
+ if (name.equals("package"))
+ {
+ collections = collectionsBuilder.build();
+ for (ResourceCollection collection : getCollections().getByRole(Roles.INDEX))
+ {
+ processItemsInIndexCollection(collection);
+ }
+ }
+ else if (name.equals("meta"))
+ {
+ processMeta(e);
+ }
+ else if (name.equals("metadata"))
+ {
+
+ // else peek collection builder and add it
+
+ // Build metadata declared in this metadata element
+ MetadataSet metadata = null;
+ try
+ {
+ if (!metadataBuilders.isEmpty()) metadata = metadataBuilders.removeFirst().build();
+ } catch (IllegalStateException ex)
+ {
+ report.message(MessageId.OPF_065,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
+ }
+ // Build linked resources declared in this metadata element
+ LinkedResources linkedResources = (linkedResourcesBuilders.isEmpty()) ? null
+ : linkedResourcesBuilders.removeFirst().build();
+
+ // if we're not building a collection, assign to package-level objects
+ if (collectionBuilders.isEmpty())
+ {
+ this.metadata = metadata;
+ this.linkedResources = linkedResources;
+ reportMetadata();
+ }
+ // else assign to the collection being built
+ else
+ {
+ collectionBuilders.peekFirst().metadata(metadata).metadataLinks(linkedResources);
+ }
+
+ }
+ else if (name.equals("collection"))
+ {
+ if (!collectionBuilders.isEmpty())
+ {
+ // Build linked resources declared in this collection
+ if (!linkedResourcesBuilders.isEmpty())
+ {
+ collectionBuilders.peekFirst().resources(linkedResourcesBuilders.removeFirst().build());
+ }
+ // build this collection
+ ResourceCollection collection = collectionBuilders.removeFirst().build();
+ // if it's a top-level collection (no remaining parent collection)
+ // assign to the set of Package collections
+ if (collectionBuilders.isEmpty())
+ {
+ collectionsBuilder.add(collection);
+ }
+ // else add as a sub-collection of the collection being built
+ else
+ {
+ collectionBuilders.peekFirst().collection(collection);
+ }
+ }
+ }
+
}
- else if (name.equals("mediaType"))
+ else if (EpubConstants.DCElements.equals(e.getNamespace()))
{
- processBinding(e);
+ processDCElem(e);
}
+
+ super.endElement();
+ }
+
+ /**
+ * Returns the metadata for the Rendition represented by the current Package
+ * Document. Must be called after the parsing.
+ *
+ * @return the metadata for the Rendition represented by the current Package
+ * Document
+ */
+ public MetadataSet getMetadata()
+ {
+ return (metadata == null) ? new MetadataSet.Builder().build() : metadata;
+ }
+
+ /**
+ * Returns the list of linked resources (i.e. resources referenced from
+ * <code>link</code> elements) declared in the current Package Document at the
+ * package level (i.e. in the package <code>metadata</code> element). Must be
+ * called after the parsing.
+ *
+ * @return the linked resources for the Rendition represented by the current
+ * Package Document
+ */
+ public LinkedResources getLinkedResources()
+ {
+ return (linkedResources == null) ? LinkedResources.builder().build() : linkedResources;
+ }
+
+ /**
+ * Returns the list of collections (as defined in <code>collection</code>
+ * elements) declared in the current Package Document. Must be called after
+ * the parsing.
+ *
+ * @return the linked resources for the Rendition represented by the current
+ * Package Document
+ */
+ public ResourceCollections getCollections()
+ {
+ return (collections == null) ? ResourceCollections.builder().build() : collections;
}
private void processBinding(XMLElement e)
@@ -156,32 +329,70 @@ public class OPFHandler30 extends OPFHandler
if (OPFChecker30.isCoreMediaType(mimeType))
{
report.message(MessageId.OPF_008,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), mimeType);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), mimeType);
return;
}
- if (xrefChecker != null && xrefChecker.getBindingHandlerSrc(mimeType) != null)
+ if (context.xrefChecker.isPresent()
+ && context.xrefChecker.get().getBindingHandlerId(mimeType) != null)
{
report.message(MessageId.OPF_009,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), mimeType,
- xrefChecker.getBindingHandlerSrc(mimeType));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), mimeType,
+ context.xrefChecker.get().getBindingHandlerId(mimeType));
return;
}
- OPFItem handler = itemMapById.get(handlerId);
- if (handler != null && xrefChecker != null)
+ if (itemBuilders.containsKey(handlerId) && context.xrefChecker.isPresent())
+ {
+ context.xrefChecker.get().registerBinding(mimeType, handlerId);
+ }
+ }
+ }
+
+ private List<String> processCollectionRole(String roleAtt)
+ {
+ ImmutableList.Builder<String> rolesBuilder = ImmutableList.builder();
+ for (String role : TOKENIZER.split(Strings.nullToEmpty(roleAtt)))
+ {
+ if (role.matches("^[^:/?#]+://.*"))
+ {
+ // Role is an absolute IRI
+ // check that the host component doesn't contain 'idpf.org'
+ try
+ {
+ URI uri = new URI(role);
+ if (uri.getHost() != null && uri.getHost().contains("idpf.org"))
+ {
+ report.message(MessageId.OPF_069, parser.getLocation(), role);
+ }
+ else
+ {
+ rolesBuilder.add(role);
+ }
+ } catch (URISyntaxException e)
+ {
+ report.message(MessageId.OPF_070, parser.getLocation(), role);
+ }
+ }
+ else
{
- xrefChecker.registerBinding(mimeType, handler.path);
+ // Role is a NMTOKEN
+ // Check that it's in the reserved role list
+ if (ResourceCollection.Roles.fromString(role).isPresent())
+ {
+ rolesBuilder.add(role);
+ }
+ else
+ {
+ report.message(MessageId.OPF_068, parser.getLocation(), role);
+ }
}
}
+ return rolesBuilder.build();
}
private void processLink(XMLElement e)
{
- processLinkRel(e.getAttribute("rel"));
- // needs refactor: its problematic to register
- // link resources as items
- String id = e.getAttribute("id");
String href = e.getAttribute("href");
if (href != null && !href.matches("^[^:/?#]+://.*"))
{
@@ -191,7 +402,7 @@ public class OPFHandler30 extends OPFHandler
} catch (IllegalArgumentException ex)
{
report.message(MessageId.OPF_010,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href),
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href),
ex.getMessage());
href = null;
}
@@ -201,37 +412,38 @@ public class OPFHandler30 extends OPFHandler
report.info(path, FeatureEnum.REFERENCE, href);
}
- String mimeType = e.getAttribute("media-type");
- if ("metadata".equals(e.getParent().getName()))
+ if (context.xrefChecker.isPresent())
{
- OPFItem item = new OPFItem(id, href, mimeType, null, null, "", null, parser.getLineNumber(),
- parser.getColumnNumber());
- if (id != null)
- {
- itemMapById.put(id, item);
- }
-
- // if (href != null) {
- // mgy: awaiting proper refactor, only add these if local
- if (href != null && !href.matches("^[^:/?#]+://.*"))
- {
- itemMapByPath.put(href, item);
- items.add(item);
- }
+ context.xrefChecker.get().registerReference(path, parser.getLineNumber(),
+ parser.getColumnNumber(), href, Type.LINK);
}
+ if (!linkedResourcesBuilders.isEmpty())
+ {
+ LinkedResource resource = new LinkedResource.Builder(href).id(e.getAttribute("id"))
+ .rel(processLinkRel(e.getAttribute("rel"))).mimetype(e.getAttribute("media-type"))
+ .refines(e.getAttribute("refines")).build();
+ linkedResourcesBuilders.peekFirst().add(resource);
+ }
}
- private void processItemrefProperties(String property)
+ private void processItemrefProperties(OPFItem.Builder builder, String property)
{
- if (property == null)
+ Set<Property> properties = VocabUtil.parsePropertyList(property, itemrefVocabs, report,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
+ builder.properties(properties);
+ if (properties
+ .contains(RenditionVocabs.ITEMREF_VOCAB
+ .get(RenditionVocabs.ITEMREF_PROPERTIES.LAYOUT_PRE_PAGINATED))
+ || !properties.contains(
+ RenditionVocabs.ITEMREF_VOCAB.get(RenditionVocabs.ITEMREF_PROPERTIES.LAYOUT_REFLOWABLE))
+ && getMetadata().containsPrimary(
+ RenditionVocabs.META_VOCAB.get(RenditionVocabs.META_PROPERTIES.LAYOUT),
+ "pre-paginated"))
{
- return;
+ builder.fixedLayout();
}
- /* Set<Property> properties = */VocabUtil.parsePropertyList(property, itemrefVocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
-
// NOTE:
// Checked with Schematron, although the code below is more prefix-safe
@@ -241,12 +453,12 @@ public class OPFHandler30 extends OPFHandler
// && propSet.contains(ITEMREF_PROPERTIES.PAGE_SPREAD_RIGHT))
// {
// report.message(MessageId.OPF_011,
- // new MessageLocation(path, parser.getLineNumber(),
+ // new EPUBLocation(path, parser.getLineNumber(),
// parser.getColumnNumber()));
// }
}
- private void processItemProperties(String property, String mimeType)
+ private void processItemProperties(OPFItem.Builder builder, String property, String mimeType)
{
if (property == null)
{
@@ -254,7 +466,7 @@ public class OPFHandler30 extends OPFHandler
}
Set<Property> properties = VocabUtil.parsePropertyList(property, itemVocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
Set<ITEM_PROPERTIES> itemProps = Property.filter(properties, ITEM_PROPERTIES.class);
mimeType = mimeType.trim();
@@ -263,34 +475,95 @@ public class OPFHandler30 extends OPFHandler
if (!itemProp.allowedOnTypes().contains(mimeType))
{
report.message(MessageId.OPF_012,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()),
EnumVocab.ENUM_TO_NAME.apply(itemProp), mimeType);
}
}
+ builder.properties(properties);
}
- private void processLinkRel(String rel)
+ private Set<Property> processLinkRel(String rel)
{
- VocabUtil.parsePropertyList(rel, linkrelVocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ return VocabUtil.parsePropertyList(rel, linkrelVocabs, report,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
private void processMeta(XMLElement e)
{
- processMetaProperty(e.getAttribute("property"));
- processMetaScheme(e.getAttribute("scheme"));
+ // get the property
+ Optional<Property> prop = VocabUtil.parseProperty(e.getAttribute("property"), metaVocabs,
+ report, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
+
+ if (prop.isPresent() && !metadataBuilders.isEmpty())
+ {
+ metadataBuilders.peekFirst().meta(e.getAttribute("id"), prop.get(),
+ (String) e.getPrivateData(), e.getAttribute("refines"));
+ }
+
+ // just parse the scheme for vocab errors
+ VocabUtil.parseProperty(e.getAttribute("scheme"), metaVocabs, report,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
- private void processMetaScheme(String scheme)
+ private void processDCElem(XMLElement e)
{
+ // get the property
+ Optional<Property> prop = DCMESVocab.VOCAB.lookup(e.getName());
+ if (prop.isPresent() && !metadataBuilders.isEmpty())
+ {
+ metadataBuilders.peekFirst().meta(e.getAttribute("id"), prop.get(),
+ (String) e.getPrivateData(), null);
+ }
+ }
- VocabUtil.parseProperty(scheme, metaVocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ private void processItemsInIndexCollection(ResourceCollection collection)
+ {
+ if (collection.hasRole(Roles.INDEX) || collection.hasRole(Roles.INDEX_GROUP))
+ {
+ for (LinkedResource resource : collection.getResources().asList())
+ {
+ OPFItem.Builder itemBuilder = itemBuildersByPath.get(resource.getPath());
+ if (itemBuilder != null)
+ {
+ itemBuilder.properties(ImmutableSet
+ .of(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.IN_INDEX_COLLECTION)));
+ }
+ }
+ for (ResourceCollection childCollection : collection.getCollections().asList())
+ {
+ processItemsInIndexCollection(childCollection);
+ }
+ }
}
- private void processMetaProperty(String property)
+ protected void reportMetadata()
{
- VocabUtil.parseProperty(property, metaVocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ if (getMetadata().containsPrimary(
+ RenditionVocabs.META_VOCAB.get(RenditionVocabs.META_PROPERTIES.LAYOUT), "pre-paginated"))
+ {
+ report.info(null, FeatureEnum.HAS_FIXED_LAYOUT, "pre-paginated");
+ }
+ }
+
+ @Override
+ protected void reportItem(OPFItem item)
+ {
+ super.reportItem(item);
+ boolean isFixed = getMetadata().containsPrimary(
+ RenditionVocabs.META_VOCAB.get(RenditionVocabs.META_PROPERTIES.LAYOUT), "pre-paginated");
+ if (item.getProperties().contains(
+ RenditionVocabs.ITEMREF_VOCAB.get(RenditionVocabs.ITEMREF_PROPERTIES.LAYOUT_PRE_PAGINATED)))
+ {
+ isFixed = true;
+ }
+ else if (item.getProperties().contains(
+ RenditionVocabs.ITEMREF_VOCAB.get(RenditionVocabs.ITEMREF_PROPERTIES.LAYOUT_REFLOWABLE)))
+ {
+ isFixed = false;
+ }
+ if (isFixed)
+ {
+ report.info(item.getPath(), FeatureEnum.HAS_FIXED_LAYOUT, String.valueOf(true));
+ }
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFItem.java b/src/main/java/com/adobe/epubcheck/opf/OPFItem.java
index 8e2a8b8..5e24660 100755
--- a/src/main/java/com/adobe/epubcheck/opf/OPFItem.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFItem.java
@@ -22,142 +22,359 @@
package com.adobe.epubcheck.opf;
+import java.util.Set;
+
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
+import com.adobe.epubcheck.vocab.PackageVocabs;
+import com.adobe.epubcheck.vocab.Property;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Immutable representation of an item in a Package Document (OPF). Can
+ * represent a <code>item</code> element or <code>link</code> elements pointing
+ * to a container resource.
+ */
public class OPFItem
{
private final String id;
- final String path;
- final String mimeType;
- private final String fallback;
- private final String fallbackStyle;
- private final String namespace;
- final int lineNumber;
- final int columnNumber;
- private boolean ncx;
- private boolean inSpine;
- private boolean nav;
- private boolean scripted;
- private final String properties;
- private boolean linear = true;
-
- OPFItem(String id, String path, String mimeType, String fallback,
- String fallbackStyle, String namespace, String properties,
- int lineNumber, int columnNumber)
+ private final String path;
+ private final String mimetype;
+ private final int lineNumber;
+ private final int columnNumber;
+ private final Optional<String> fallback;
+ private final Optional<String> fallbackStyle;
+ private final Set<Property> properties;
+ private final boolean ncx;
+ private final boolean inSpine;
+ private final boolean nav;
+ private final boolean scripted;
+ private final boolean linear;
+ private final boolean fixedLayout;
+
+ private OPFItem(String id, String path, String mimetype, int lineNumber, int columnNumber,
+ Optional<String> fallback, Optional<String> fallbackStyle, Set<Property> properties,
+ boolean ncx, boolean inSpine, boolean nav, boolean scripted, boolean linear, boolean fxl)
{
- this.fallback = fallback;
- this.fallbackStyle = fallbackStyle;
this.id = id;
+ this.path = path;
+ this.mimetype = mimetype;
this.lineNumber = lineNumber;
this.columnNumber = columnNumber;
- this.mimeType = mimeType;
- this.namespace = namespace;
- this.path = path;
+ this.fallback = fallback;
+ this.fallbackStyle = fallbackStyle;
this.properties = properties;
+ this.ncx = ncx;
+ this.inSpine = inSpine;
+ this.nav = nav;
+ this.scripted = scripted;
+ this.linear = linear;
+ this.fixedLayout = fxl;
}
- public String getFallback()
- {
- return fallback;
- }
-
- public String getFallbackStyle()
- {
- return fallbackStyle;
- }
-
+ /**
+ * Returns the ID of this item.
+ *
+ * @return the ID of this item, guaranteed non-null.
+ */
public String getId()
{
return id;
}
- public String getMimeType()
- {
- return mimeType;
- }
-
+ /**
+ * The path of this item (cannot be <code>null</code>).
+ *
+ * @return the path of this item, relative to the container.
+ */
public String getPath()
{
return path;
}
- public String getProperties()
- {
- return properties;
- }
-
- public String getNamespace()
+ /**
+ * Returns the media type of this item.
+ *
+ * @return the media type of this item, guaranteed non-null.
+ */
+ public String getMimeType()
{
- return namespace;
+ return mimetype;
}
+ /**
+ * The line where this item is declared in the OPF.
+ *
+ * @return
+ */
public int getLineNumber()
{
return lineNumber;
}
+ /**
+ * The column where this item is declared in the OPF.
+ *
+ * @return
+ */
public int getColumnNumber()
{
return columnNumber;
}
- public boolean isNcx()
+ /**
+ * Returns an {@link Optional} containing the ID of the fallback item for this
+ * item, if it has one.
+ *
+ * @return An optional containing the ID of the fallback item for this item if
+ * it has one, or {@link Optional#absent()} otherwise.
+ */
+ public Optional<String> getFallback()
{
- return ncx;
+ return fallback;
}
- public void setNcx(boolean ncx)
+ /**
+ * Returns An {@link Optional} containing the ID of the fallback stylesheet
+ * for this item, if it has one.
+ *
+ * @return An optional containing the ID of the fallback stylesheet for this
+ * item if it has one, or {@link Optional#absent()} otherwise.
+ */
+ public Optional<String> getFallbackStyle()
{
- this.ncx = ncx;
+ return fallbackStyle;
}
- public boolean isScripted()
+ /**
+ * Returns the set of {@link Property} declared on this item or any
+ * <code>itemref</code> pointing to this item.
+ *
+ * @return the properties of this item, or an empty set if none is declared.
+ */
+ public Set<Property> getProperties()
{
- return scripted;
+ return properties;
}
- public void setScripted(boolean scripted)
+ /**
+ * Returns <code>true</code> iff this item is an NCX document.
+ *
+ * @return <code>true</code> iff this item is an NCX document.
+ */
+ public boolean isNcx()
{
- this.scripted = scripted;
+ return ncx;
}
- public boolean isNav()
+ /**
+ * Returns <code>true</code> iff this item is a scripted document.
+ *
+ * @return <code>true</code> iff this item is a scripted document.
+ */
+ public boolean isScripted()
{
- return nav;
+ return scripted;
}
- public void setNav(boolean nav)
+ /**
+ * Returns <code>true</code> iff this item is a Navigation Document.
+ *
+ * @return <code>true</code> iff this item is an Navigation Document.
+ */
+ public boolean isNav()
{
- this.nav = nav;
+ return nav;
}
+ /**
+ * Returns <code>true</code> iff this item is in the spine.
+ *
+ * @return <code>true</code> iff this item is in the spine.
+ */
public boolean isInSpine()
{
return inSpine;
}
- public void setInSpine(boolean inSpine)
+ /**
+ * Returns <code>true</code> iff this item is a spine item part of the linear
+ * reading order, as declared by the <code>itemref/@linear</code> attribute.
+ *
+ * @return <code>true</code> iff this item is in the spine and is linear.
+ * @throws IllegalStateException
+ * if this item is not in the spine.
+ */
+ public boolean isLinear()
{
- this.inSpine = inSpine;
+ if (!inSpine)
+ {
+ throw new IllegalStateException("linear");
+ }
+ return linear;
}
/**
- * Reflects the value of spine/itemref/@linear. Only applies to manifest items
- * that appear in the spine.
+ * Returns <code>true</code> iff this item is a Fixed-Layout Document.
+ *
+ * @return <code>true</code> iff this item is a Fixed-Layout Document.
*/
- public void setSpineLinear(boolean linear)
+ public boolean isFixedLayout()
{
- this.linear = linear;
+ return fixedLayout;
+ }
+
+ @Override
+ public String toString()
+ {
+ return path + "[" + id + "]";
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((id == null) ? 0 : id.hashCode());
+ result = prime * result + ((path == null) ? 0 : path.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ OPFItem other = (OPFItem) obj;
+ if (id == null)
+ {
+ if (other.id != null) return false;
+ }
+ else if (!id.equals(other.id)) return false;
+ if (path == null)
+ {
+ if (other.path != null) return false;
+ }
+ else if (!path.equals(other.path)) return false;
+ return true;
}
/**
- * Reflects the value of spine/itemref/@linear. Only applies to manifest items
- * that appear in the spine.
+ * A builder for {@link OPFItem}
*/
- public boolean getSpineLinear()
+ public static final class Builder
{
- if (!inSpine)
+
+ private String id;
+ private String path;
+ private String mimeType;
+ private int lineNumber;
+ private int columnNumber;
+ private String fallback = null;
+ private String fallbackStyle = null;
+ private boolean ncx = false;
+ private boolean linear = true;
+ private boolean inSpine = false;
+ private boolean fxl = false;
+ private ImmutableSet.Builder<Property> propertiesBuilder = new ImmutableSet.Builder<Property>();
+
+ /**
+ * Creates a new builder
+ *
+ * @param id
+ * the item ID, can be <code>null</code>
+ * @param path
+ * the item path,, cannot be <code>null</code>
+ * @param mimeType
+ * the item media type, can be <code>null</code>
+ * @param lineNumber
+ * the line number of the corresponding <code>item</code> or
+ * <code>link</code> element
+ * @param columnNumber
+ * the column number of the corresponding <code>item</code> or
+ * <code>link</code> element
+ */
+ public Builder(String id, String path, String mimeType, int lineNumber, int columnNumber)
{
- throw new IllegalStateException("linear");
+ this.id = Preconditions.checkNotNull(id).trim();
+ this.path = Preconditions.checkNotNull(path).trim();
+ this.mimeType = Optional.fromNullable(mimeType).or("undefined").trim();
+ this.lineNumber = lineNumber;
+ this.columnNumber = columnNumber;
+ }
+
+ public Builder fallback(String fallback)
+ {
+ this.fallback = fallback;
+ return this;
+ }
+
+ public Builder fallbackStyle(String fallbackStyle)
+ {
+ this.fallbackStyle = fallbackStyle;
+ return this;
+ }
+
+ public Builder fixedLayout()
+ {
+ this.fxl = true;
+ return this;
+
+ }
+
+ public Builder ncx()
+ {
+ this.ncx = true;
+ return this;
+ }
+
+ public Builder nonlinear()
+ {
+ this.linear = false;
+ return this;
+ }
+
+ public Builder inSpine()
+ {
+ this.inSpine = true;
+ return this;
+ }
+
+ public Builder properties(Set<Property> properties)
+ {
+ if (properties != null)
+ {
+ this.propertiesBuilder.addAll(properties);
+ }
+ return this;
+ }
+
+ /**
+ * Builds a new immutable {@link OPFItem} from this builder.
+ */
+ public OPFItem build()
+ {
+ if (!inSpine || !linear)
+ {
+ this.propertiesBuilder.add(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.NON_LINEAR));
+ }
+ if (fxl)
+ {
+ this.propertiesBuilder
+ .add(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.FIXED_LAYOUT));
+ }
+ Set<Property> properties = propertiesBuilder.build();
+
+ return new OPFItem(id, path, mimeType, lineNumber, columnNumber,
+ Optional.fromNullable(Strings.emptyToNull(Strings.nullToEmpty(fallback).trim())),
+ Optional.fromNullable(Strings.emptyToNull(Strings.nullToEmpty(fallbackStyle).trim())),
+ properties, ncx, inSpine,
+ properties.contains(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.NAV)),
+ properties.contains(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.SCRIPTED)),
+ linear, fxl);
}
- return linear;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFItems.java b/src/main/java/com/adobe/epubcheck/opf/OPFItems.java
new file mode 100644
index 0000000..0b73b60
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFItems.java
@@ -0,0 +1,123 @@
+package com.adobe.epubcheck.opf;
+
+import java.util.List;
+import java.util.Map;
+
+import com.adobe.epubcheck.opf.OPFItem.Builder;
+import com.google.common.base.Function;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicates;
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Maps;
+
+/**
+ * Represents the set of Publication Resources in a Package Document (OPF).
+ *
+ */
+public final class OPFItems
+{
+
+ private final List<OPFItem> items;
+ private final List<OPFItem> spine;
+ private final Map<String, OPFItem> itemsById;
+ private final Map<String, OPFItem> itemsByPath;
+
+ /**
+ * Search the item with the given ID.
+ *
+ * @param id
+ * the ID of the item to search, can be <code>null</code>.
+ * @return An {@link Optional} containing the item if found, or
+ * {@link Optional#absent()} if not found.
+ */
+ public Optional<OPFItem> getItemById(String id)
+ {
+ return Optional.fromNullable(itemsById.get(id));
+ }
+
+ /**
+ * Search the item with the given path.
+ *
+ * @param id
+ * the path of the item to search, can be <code>null</code>.
+ * @return An {@link Optional} containing the item if found, or
+ * {@link Optional#absent()} if not found.
+ */
+ public Optional<OPFItem> getItemByPath(String path)
+ {
+ return Optional.fromNullable(itemsByPath.get(path));
+ }
+
+ /**
+ * Returns the list of items in the spine. A single {@link OPFItem} instance
+ * can appear multiple times in the list.
+ *
+ * @return the list of items in the spine.
+ */
+ public List<OPFItem> getSpineItems()
+ {
+ return spine;
+ }
+
+ /**
+ * Returns the list of items in this set, in document order.
+ *
+ * @return the list of items in this set.
+ */
+ public List<OPFItem> getItems()
+ {
+ return items;
+ }
+
+ private OPFItems(Iterable<OPFItem> items, Iterable<String> spineIDs)
+ {
+ this.items = ImmutableList.copyOf(Preconditions.checkNotNull(items));
+ // Build the by-ID and by-Paths maps
+ // We use temporary HashMaps to ignore potential duplicate keys
+ Map<String, OPFItem> itemsById = Maps.newHashMap();
+ Map<String, OPFItem> itemsByPath = Maps.newHashMap();
+ for (OPFItem item : this.items)
+ {
+ itemsById.put(item.getId(), item);
+ itemsByPath.put(item.getPath(), item);
+ }
+ this.itemsById = ImmutableMap.copyOf(itemsById);
+ this.itemsByPath = ImmutableMap.copyOf(itemsByPath);
+ // Build the spine view
+ this.spine = FluentIterable.from(spineIDs).transform(new Function<String, OPFItem>()
+ {
+ @Override
+ public OPFItem apply(final String id)
+ {
+ return OPFItems.this.itemsById.get(id.trim());
+ }
+ }).filter(Predicates.notNull()).toList();
+ }
+
+ /**
+ * Creates a consolidated set of {@link OPFItem} from item builders and a list
+ * of spine item IDs.
+ *
+ * @param itemBuilders
+ * the builders of the {@link OPFItem} in the set.
+ * @param spineIDs
+ * the IDs of the items in the spine.
+ * @return a consolidated set of {@link OPFItem}s.
+ */
+ public static OPFItems build(Iterable<Builder> itemBuilders, Iterable<String> spineIDs)
+ {
+ return new OPFItems(Iterables.transform(Preconditions.checkNotNull(itemBuilders),
+ new Function<OPFItem.Builder, OPFItem>()
+ {
+ @Override
+ public OPFItem apply(Builder builder)
+ {
+ return builder.build();
+ }
+ }), Preconditions.checkNotNull(spineIDs));
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/OPFPeeker.java b/src/main/java/com/adobe/epubcheck/opf/OPFPeeker.java
index 5dcf723..6745d57 100644
--- a/src/main/java/com/adobe/epubcheck/opf/OPFPeeker.java
+++ b/src/main/java/com/adobe/epubcheck/opf/OPFPeeker.java
@@ -35,9 +35,9 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.DefaultHandler;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFData.OPFDataBuilder;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.EpubConstants;
@@ -107,7 +107,7 @@ public final class OPFPeeker
parser.getXMLReader().parse(new InputSource(inputStream));
} catch (ParserConfigurationException e)
{
- report.message(MessageId.RSC_005, new MessageLocation(path, -1, -1),
+ report.message(MessageId.RSC_005, EPUBLocation.create(path),
e.getMessage());
} catch (InvalidVersionException e)
{
@@ -120,13 +120,13 @@ public final class OPFPeeker
return data;
} else
{
- report.message(MessageId.RSC_005, new MessageLocation(path, -1, -1),
+ report.message(MessageId.RSC_005, EPUBLocation.create(path),
e.getMessage());
}
} catch (IOException e)
{
report
- .message(MessageId.PKG_008, new MessageLocation(path, -1, -1), path);
+ .message(MessageId.PKG_008, EPUBLocation.create(path), path);
}
throw new InvalidVersionException(InvalidVersionException.VERSION_NOT_FOUND);
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/ResourceCollection.java b/src/main/java/com/adobe/epubcheck/opf/ResourceCollection.java
new file mode 100644
index 0000000..74ac02d
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/ResourceCollection.java
@@ -0,0 +1,240 @@
+package com.adobe.epubcheck.opf;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Iterables;
+
+/**
+ * Represent a collection of resources as defined by the <code>collection</code>
+ * element in Package Documents.
+ */
+public final class ResourceCollection
+{
+
+ /**
+ * The collection roles reserved by IDPF. See <a
+ * href="http://www.idpf.org/epub/vocab/package/roles/"
+ * >http://www.idpf.org/epub/vocab/package/roles/</a>
+ *
+ */
+ public static enum Roles
+ {
+ DICTIONARY,
+ DISTRIBUTABLE_OBJECT,
+ INDEX,
+ INDEX_GROUP,
+ MANIFEST,
+ PREVIEW,
+ SCRIPTABLE_COMPONENT;
+
+ /**
+ * Returns the role name as defined by IDPF.
+ */
+ @Override
+ public String toString()
+ {
+ return name().toLowerCase().replace('_', '-');
+ }
+
+ /**
+ * Returns an {@link Optional} containing the enum constant for the given
+ * role name or {@link Optional#absent()} if none is found.
+ */
+ public static Optional<Roles> fromString(String role)
+ {
+ try
+ {
+ return Optional
+ .of(Roles.valueOf(Strings.nullToEmpty(role).toUpperCase().replace('-', '_')));
+ } catch (IllegalArgumentException e)
+ {
+ return Optional.absent();
+ }
+ }
+
+ }
+
+ private final Set<String> roles;
+ private final MetadataSet metadata;
+ private final LinkedResources metadataLinks;
+ private final ResourceCollections collections;
+ private final LinkedResources resources;
+
+ private ResourceCollection(Set<String> roles, MetadataSet metadata,
+ LinkedResources metadataLinks, ResourceCollections collections, LinkedResources resources)
+ {
+ this.roles = roles;
+ this.metadata = metadata;
+ this.metadataLinks = metadataLinks;
+ this.collections = collections;
+ this.resources = resources;
+ }
+
+ /**
+ * Returns the roles of this collection.
+ */
+ public Set<String> getRoles()
+ {
+ return roles;
+ }
+
+ /**
+ * Returns <code>true</code> if this collection has the given role.
+ */
+ public boolean hasRole(String role)
+ {
+ return role != null && roles.contains(role);
+ }
+
+ /**
+ * Returns <code>true</code> if this collection has the given IDPF-reserved
+ * role.
+ */
+ public boolean hasRole(Roles role)
+ {
+ return role != null && roles.contains(role.toString());
+ }
+
+ /**
+ * Returns the metadata of this collection. Guaranteed non-null (can be
+ * empty).
+ */
+ public MetadataSet getMetadata()
+ {
+ return metadata;
+ }
+
+ /**
+ * Returns the linked resources defined as metadata in this collection.
+ * Guaranteed non-null (can be empty).
+ */
+ public LinkedResources getMetadataLinks()
+ {
+ return metadataLinks;
+ }
+
+ /**
+ * Returns the set of this collection's sub collections. Guaranteed non-null
+ * (can be empty).
+ */
+ public ResourceCollections getCollections()
+ {
+ return collections;
+ }
+
+ /**
+ * Returns the set of this collection's resources. Guaranteed non-null (can be
+ * empty).
+ */
+ public LinkedResources getResources()
+ {
+ return resources;
+ }
+
+ /**
+ * Creates a new builder. Calling this method is identical to calling the
+ * empty {@link Builder} constructor.
+ *
+ * @return a newly created builder.
+ */
+ public static final Builder builder()
+ {
+ return new Builder();
+ }
+
+ /**
+ * A builder for {@link ResourceCollection}.
+ *
+ */
+ public static final class Builder
+ {
+ private final Set<String> roles = new HashSet<String>();
+ private MetadataSet metadata = null;
+ private LinkedResources metadataLinks = null;
+ private final ResourceCollections.Builder collections = ResourceCollections.builder();
+ private LinkedResources resources = null;
+
+ /**
+ * Add the given roles to the collection to build.
+ *
+ * @param iterable
+ * a set of roles.
+ * @return this builder.
+ */
+ public Builder roles(Iterable<String> roles)
+ {
+ Iterables.addAll(this.roles, roles);
+ return this;
+ }
+
+ /**
+ * Add the given metadata set to the collection to build.
+ *
+ * @param metadata
+ * a set of EPUB metadata.
+ * @return this builder.
+ */
+ public Builder metadata(MetadataSet metadata)
+ {
+ this.metadata = metadata;
+ return this;
+ }
+
+ /**
+ * Add the given linked resources as metadata links to the collection to
+ * build.
+ *
+ * @param resources
+ * the resources to add.
+ * @return this builder.
+ */
+ public Builder metadataLinks(LinkedResources metadataLinks)
+ {
+ this.metadataLinks = metadataLinks;
+ return this;
+ }
+
+ /**
+ * Add the given collection as a sub-collection of the collection to build.
+ *
+ * @param collection
+ * a collection.
+ * @return this builder.
+ */
+ public Builder collection(ResourceCollection collection)
+ {
+ this.collections.add(collection);
+ return this;
+ }
+
+ /**
+ * Add the given resources to the collection to build.
+ *
+ * @param resources
+ * the resources to add.
+ * @return this builder.
+ */
+ public Builder resources(LinkedResources resources)
+ {
+ this.resources = resources;
+ return this;
+ }
+
+ /**
+ * Returns a newly created collection.
+ */
+ public ResourceCollection build()
+ {
+ Preconditions.checkState(roles != null);
+ return new ResourceCollection(ImmutableSet.copyOf(roles), metadata != null ? metadata
+ : MetadataSet.builder().build(), metadataLinks != null ? metadataLinks : LinkedResources
+ .builder().build(), collections.build(), resources != null ? resources : LinkedResources
+ .builder().build());
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/com/adobe/epubcheck/opf/ResourceCollections.java b/src/main/java/com/adobe/epubcheck/opf/ResourceCollections.java
new file mode 100644
index 0000000..0043014
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/ResourceCollections.java
@@ -0,0 +1,125 @@
+package com.adobe.epubcheck.opf;
+
+import java.util.LinkedHashSet;
+import java.util.List;
+
+import com.adobe.epubcheck.opf.ResourceCollection.Roles;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableListMultimap;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Sets;
+
+/**
+ * Represents a set of collections (as defined by <code>collection</code>
+ * elements in a Package Document), with predictable iteration order.
+ */
+public final class ResourceCollections
+{
+
+ private final List<ResourceCollection> collections;
+ private final ListMultimap<String, ResourceCollection> collectionsByRole;
+
+ private ResourceCollections(Iterable<ResourceCollection> collections)
+ {
+ ImmutableList.Builder<ResourceCollection> listBuilder = ImmutableList.builder();
+ ImmutableListMultimap.Builder<String, ResourceCollection> byRoleBuilder = ImmutableListMultimap
+ .builder();
+ for (ResourceCollection collection : collections)
+ {
+ listBuilder.add(collection);
+ for (String role : collection.getRoles())
+ {
+ byRoleBuilder.put(role, collection);
+ }
+ }
+ this.collections = listBuilder.build();
+ this.collectionsByRole = byRoleBuilder.build();
+ }
+
+ /**
+ * Returns the list of all collections in this set.
+ */
+ public List<ResourceCollection> asList()
+ {
+ return collections;
+ }
+
+ /**
+ * Returns the list of collections in this set with the given role.
+ */
+ public List<ResourceCollection> getByRole(String role)
+ {
+ return collectionsByRole.get(role);
+ }
+
+ /**
+ * Returns the list of collections in this set with the given IDPF-reserved
+ * role.
+ */
+ public List<ResourceCollection> getByRole(Roles role)
+ {
+ return role == null ? ImmutableList.<ResourceCollection> of() : getByRole(role.toString());
+ }
+
+ /**
+ * Returns <code>true</code> if this set contains one or more collections with
+ * the given role.
+ */
+ public boolean hasRole(String role)
+ {
+ return !collectionsByRole.get(role).isEmpty();
+ }
+
+ /**
+ * Returns <code>true</code> if this set contains one or more collections with
+ * the given IDPF-reserved role.
+ */
+ public boolean hasRole(Roles role)
+ {
+ return role != null && hasRole(role.toString());
+ }
+
+ /**
+ * Creates a new builder. Calling this method is identical to calling the
+ * empty {@link Builder} constructor.
+ *
+ * @return a newly created builder.
+ */
+ public static final Builder builder()
+ {
+ return new Builder();
+ }
+
+ /**
+ * A builder for {@link ResourceCollections}.
+ *
+ * @author Romain Deltour
+ *
+ */
+ public static final class Builder
+ {
+ private final LinkedHashSet<ResourceCollection> collections = Sets.newLinkedHashSet();
+
+ /**
+ * Add the given collection to the list of collections to build.
+ *
+ * @param collection
+ * the collection to add.
+ * @return this builder.
+ */
+ public Builder add(ResourceCollection collection)
+ {
+ if (collection != null) collections.add(collection);
+ return this;
+
+ }
+
+ /**
+ * Returns a newly created list of collections.
+ */
+ public ResourceCollections build()
+ {
+ return new ResourceCollections(collections);
+ }
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java b/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java
new file mode 100644
index 0000000..abffea6
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java
@@ -0,0 +1,341 @@
+package com.adobe.epubcheck.opf;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.Set;
+
+import com.adobe.epubcheck.api.EPUBProfile;
+import com.adobe.epubcheck.api.FeatureReport;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.ocf.OCFPackage;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.vocab.Property;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Predicate;
+import com.google.common.base.Strings;
+import com.google.common.collect.ImmutableSet;
+
+/**
+ * Holds various contextual objects used during validation. This validation
+ * context is used by both {@link ContentChecker} and {@link DocumentValidator}
+ * instances.
+ *
+ */
+public final class ValidationContext
+{
+ /**
+ * The path to the validated resource. Guaranteed non-null.
+ */
+ public final String path;
+ /**
+ * The media type of the validated resource. Guaranteed non-null.
+ */
+ public final String mimeType;
+ /**
+ * The EPUB version being used for validation. Guaranteed non-null.
+ */
+ public final EPUBVersion version;
+ /**
+ * The validation profile in use (e.g. DEFAULT, EDUPUB, etc.). Guaranteed
+ * non-null.
+ */
+ public final EPUBProfile profile;
+ /**
+ * The report object used to log validation messages. Guaranteed non-null.
+ */
+ public final Report report;
+ /**
+ * Used to report some features of the validated resource, without logging.
+ * Guaranteed non-null.
+ */
+ public final FeatureReport featureReport;
+
+ /**
+ * Used to open resource streams. Guaranteed non-null.
+ */
+ public final GenericResourceProvider resourceProvider;
+ /**
+ * The OCF Package the resource being validated belongs to. Is absent for
+ * single-file validations.
+ */
+ public final Optional<OCFPackage> ocf;
+ /**
+ * The cross-reference checker, absent for single-file validation.
+ */
+ public final Optional<XRefChecker> xrefChecker;
+ /**
+ * The set of 'dc:type' values declared at the OPF level. Guaranteed non-null,
+ * can be empty.
+ */
+ public final Set<String> pubTypes;
+ /**
+ * The set of properties associated to the resource being validated.
+ */
+ public final Set<Property> properties;
+
+ private ValidationContext(String path, String mimeType, EPUBVersion version, EPUBProfile profile,
+ Report report, FeatureReport featureReport, GenericResourceProvider resourceProvider,
+ Optional<OCFPackage> ocf, Optional<XRefChecker> xrefChecker, Set<String> pubTypes,
+ Set<Property> properties)
+ {
+ super();
+ this.path = path;
+ this.mimeType = mimeType;
+ this.version = version;
+ this.profile = profile;
+ this.report = report;
+ this.featureReport = featureReport;
+ this.resourceProvider = resourceProvider;
+ this.ocf = ocf;
+ this.xrefChecker = xrefChecker;
+ this.pubTypes = pubTypes;
+ this.properties = properties;
+ }
+
+ /**
+ * Builds a new {@link ValidationContext} from various member objects or by
+ * copying a parent context.
+ *
+ */
+ public static final class ValidationContextBuilder
+ {
+ private String path = null;
+ private String mimeType = null;
+ private EPUBVersion version = null;
+ private EPUBProfile profile = null;
+ private Report report = null;
+ private FeatureReport featureReport = null;
+
+ private GenericResourceProvider resourceProvider = null;
+ private OCFPackage ocf = null;
+ private XRefChecker xrefChecker = null;
+ private Set<String> pubTypes = null;
+ private ImmutableSet.Builder<Property> properties = ImmutableSet.<Property> builder();
+
+ public ValidationContextBuilder()
+ {
+ }
+
+ public ValidationContextBuilder(ValidationContext context)
+ {
+ copy(context);
+ }
+
+ public ValidationContextBuilder copy(ValidationContext context)
+ {
+ path = context.path;
+ mimeType = context.mimeType;
+ version = context.version;
+ profile = context.profile;
+ report = context.report;
+ featureReport = context.featureReport;
+ resourceProvider = context.resourceProvider;
+ ocf = context.ocf.orNull();
+ xrefChecker = context.xrefChecker.orNull();
+ pubTypes = context.pubTypes;
+ properties = ImmutableSet.<Property> builder().addAll(context.properties);
+ return this;
+ }
+
+ public ValidationContextBuilder path(String path)
+ {
+ this.path = path;
+ return this;
+ }
+
+ public ValidationContextBuilder mimetype(String mimetype)
+ {
+ this.mimeType = mimetype;
+ return this;
+ }
+
+ public ValidationContextBuilder version(EPUBVersion version)
+ {
+ this.version = version;
+ return this;
+ }
+
+ public ValidationContextBuilder profile(EPUBProfile profile)
+ {
+ this.profile = profile;
+ return this;
+ }
+
+ public ValidationContextBuilder report(Report report)
+ {
+ this.report = report;
+ return this;
+ }
+
+ public ValidationContextBuilder featureReport(FeatureReport featureReport)
+ {
+ this.featureReport = featureReport;
+ return this;
+ }
+
+ public ValidationContextBuilder resourceProvider(GenericResourceProvider resourceProvider)
+ {
+ this.resourceProvider = resourceProvider;
+ return this;
+ }
+
+ public ValidationContextBuilder ocf(OCFPackage ocf)
+ {
+ this.ocf = ocf;
+ return this;
+ }
+
+ public ValidationContextBuilder xrefChecker(XRefChecker xrefChecker)
+ {
+ this.xrefChecker = xrefChecker;
+ return this;
+ }
+
+ public ValidationContextBuilder pubTypes(Set<String> pubTypes)
+ {
+ this.pubTypes = pubTypes;
+ return this;
+ }
+
+ public ValidationContextBuilder properties(Set<Property> properties)
+ {
+ this.properties = ImmutableSet.builder();
+ if (properties != null)
+ {
+ this.properties.addAll(properties);
+ }
+ return this;
+ }
+
+ public ValidationContextBuilder addProperty(Property property)
+ {
+ properties.add(Preconditions.checkNotNull(property));
+ return this;
+ }
+
+ public ValidationContext build()
+ {
+ resourceProvider = (resourceProvider == null && ocf != null) ? ocf : resourceProvider;
+ checkNotNull(resourceProvider);
+ checkNotNull(report);
+ return new ValidationContext(Strings.nullToEmpty(path), Strings.nullToEmpty(mimeType),
+ version != null ? version : EPUBVersion.Unknown, profile != null ? profile
+ : EPUBProfile.DEFAULT, report, featureReport != null ? featureReport
+ : new FeatureReport(), resourceProvider, Optional.fromNullable(ocf),
+ Optional.fromNullable(xrefChecker), pubTypes != null ? ImmutableSet.copyOf(pubTypes)
+ : ImmutableSet.<String> of(), properties.build());
+ }
+ }
+
+ /**
+ * Utility to create {@link Predicate}s applying to {@link ValidationContext}
+ * instances.
+ *
+ */
+ public static final class ValidationContextPredicates
+ {
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the given
+ * property is declared in the context being tested.
+ */
+ public static Predicate<ValidationContext> hasProp(final Property property)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.properties.contains(property);
+ }
+ };
+ }
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the given
+ * publication <code>dc:type</code> is declared in the context being tested.
+ */
+ public static Predicate<ValidationContext> hasPubType(final String type)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.pubTypes.contains(type);
+ }
+ };
+ }
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the context
+ * being tested has the given media type.
+ */
+ public static Predicate<ValidationContext> mimetype(final String mimetype)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.mimeType.equals(mimetype);
+ }
+ };
+ }
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the context
+ * being tested has the given path.
+ */
+ public static Predicate<ValidationContext> path(final String path)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.path.equals(path);
+ }
+ };
+ }
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the context
+ * being tested declares the given validation profile.
+ */
+ public static Predicate<ValidationContext> profile(final EPUBProfile profile)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.profile.equals(profile);
+ }
+ };
+ }
+
+ /**
+ * Returns a predicate that evaluates to <code>true</code> if the context
+ * being tested declares the given EPUB version.
+ */
+ public static Predicate<ValidationContext> version(final EPUBVersion version)
+ {
+ return new Predicate<ValidationContext>()
+ {
+ @Override
+ public boolean apply(ValidationContext input)
+ {
+ return input.version.equals(version);
+ }
+ };
+ }
+
+ private ValidationContextPredicates()
+ {
+ }
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/opf/VersionRetriever.java b/src/main/java/com/adobe/epubcheck/opf/VersionRetriever.java
index 7744cc5..e2367a2 100644
--- a/src/main/java/com/adobe/epubcheck/opf/VersionRetriever.java
+++ b/src/main/java/com/adobe/epubcheck/opf/VersionRetriever.java
@@ -22,18 +22,20 @@
package com.adobe.epubcheck.opf;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.InvalidVersionException;
+
import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
+
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
@@ -77,7 +79,7 @@ public class VersionRetriever implements EntityResolver, ErrorHandler
}
catch (ParserConfigurationException e)
{
- report.message(MessageId.RSC_005, new MessageLocation(path, -1, -1), e.getMessage());
+ report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());
}
catch (SAXException e)
{
@@ -105,12 +107,12 @@ public class VersionRetriever implements EntityResolver, ErrorHandler
}
else
{
- report.message(MessageId.RSC_005, new MessageLocation(path, -1, -1), e.getMessage());
+ report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());
}
}
catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(path, -1, -1), path);
+ report.message(MessageId.PKG_008, EPUBLocation.create(path), path);
}
throw new InvalidVersionException(InvalidVersionException.VERSION_NOT_FOUND);
}
diff --git a/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java b/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java
index e3bac68..e8582bc 100755
--- a/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java
+++ b/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java
@@ -22,55 +22,53 @@
package com.adobe.epubcheck.opf;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+import java.util.Vector;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FeatureEnum;
-
-import java.util.*;
+import com.adobe.epubcheck.vocab.PackageVocabs;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
public class XRefChecker
{
- public static final int RT_GENERIC = 0;
-
- public static final int RT_HYPERLINK = 1;
-
- public static final int RT_IMAGE = 2;
-
- public static final int RT_OBJECT = 3;
-
- public static final int RT_STYLESHEET = 4;
-
- public static final int RT_AUDIO = 5;
-
- public static final int RT_VIDEO = 6;
-
- public static final int RT_SVG_PAINT = 0x10;
-
- public static final int RT_SVG_CLIP_PATH = 0x11;
-
- public static final int RT_SVG_SYMBOL = 0x12;
-
- private class Reference
+ public static enum Type
{
- final String resource;
-
- final int lineNumber;
-
- final int columnNumber;
-
- final String refResource;
-
- final String fragment;
-
- final int type;
+ GENERIC,
+ HYPERLINK,
+ LINK,
+ IMAGE,
+ OBJECT,
+ STYLESHEET,
+ AUDIO,
+ VIDEO,
+ SVG_PAINT,
+ SVG_CLIP_PATH,
+ SVG_SYMBOL,
+ REGION_BASED_NAV,
+ SEARCH_KEY;
+ }
- public Reference(String srcResource, int srcLineNumber,
- int srcColumnNumber, String refResource, String fragment,
- int type)
+ private static class Reference
+ {
+ public final String resource;
+ public final int lineNumber;
+ public final int columnNumber;
+ public final String refResource;
+ public final String fragment;
+ public final Type type;
+
+ public Reference(String srcResource, int srcLineNumber, int srcColumnNumber, String refResource,
+ String fragment, Type type)
{
this.fragment = fragment;
this.lineNumber = srcLineNumber;
@@ -82,18 +80,15 @@ public class XRefChecker
}
- private class Anchor
+ private static class Anchor
{
- final String id;
-
- final int lineNumber;
+ public final String id;
+ public final int lineNumber;
+ public final int columnNumber;
+ public final Type type;
- final int columnNumber;
-
- final int type;
-
- public Anchor(String id, int lineNumber, int columnNumber, int type)
+ public Anchor(String id, int lineNumber, int columnNumber, Type type)
{
this.id = id;
this.lineNumber = lineNumber;
@@ -103,27 +98,17 @@ public class XRefChecker
}
- private class Resource
+ private static class Resource
{
- final String resource;
-
- final String mimeType;
-
- final Hashtable<String, Anchor> anchors;
-
- final boolean inSpine;
-
- final boolean hasValidItemFallback;
+ public final OPFItem item;
+ public final Hashtable<String, Anchor> anchors;
+ public final boolean hasValidItemFallback;
+ public final boolean hasValidImageFallback;
- final boolean hasValidImageFallback;
-
- Resource(String resource, String type, boolean inSpine,
- boolean hasValidItemFallback, boolean hasValidImageFallback)
+ Resource(OPFItem item, boolean hasValidItemFallback, boolean hasValidImageFallback)
{
- this.mimeType = type;
- this.resource = resource;
- this.inSpine = inSpine;
+ this.item = item;
this.hasValidItemFallback = hasValidItemFallback;
this.hasValidImageFallback = hasValidImageFallback;
this.anchors = new Hashtable<String, Anchor>();
@@ -154,8 +139,19 @@ public class XRefChecker
public String getMimeType(String path)
{
- return resources.get(path) != null ? resources.get(path).mimeType
- : null;
+ return resources.get(path) != null ? resources.get(path).item.getMimeType() : null;
+ }
+
+ /**
+ * Returns an {@link Optional} containing a boolean indicating whether the
+ * resource at the given path has a valid item fallback, or
+ * {@link Optional#absent()} if no resource has been registered for the given
+ * path.
+ */
+ public Optional<Boolean> hasValidFallback(String path)
+ {
+ return resources.get(path) != null ? Optional.of(resources.get(path).hasValidItemFallback)
+ : Optional.<Boolean> absent();
}
public Set<String> getBindingsMimeTypes()
@@ -163,69 +159,49 @@ public class XRefChecker
return bindings.keySet();
}
- public String getBindingHandlerSrc(String mimeType)
+ public String getBindingHandlerId(String mimeType)
{
return bindings.get(mimeType);
}
- public void registerBinding(String mimeType, String handlerSrc)
+ public void registerBinding(String mimeType, String handlerId)
{
- bindings.put(mimeType, handlerSrc);
+ bindings.put(mimeType, handlerId);
}
- public void registerResource(String resource, String mimeType,
- boolean inSpine, boolean hasValidItemFallback,
+ public void registerResource(OPFItem item, boolean hasValidItemFallback,
boolean hasValidImageFallback)
{
- if (resources.get(resource) != null)
+ // Note: Duplicate manifest items are already checked in OPFChecker.
+ if (!resources.contains(item.getPath()))
{
- throw new IllegalArgumentException("duplicate resource: "
- + resource);
+ resources.put(item.getPath(),
+ new Resource(item, hasValidItemFallback, hasValidImageFallback));
}
- resources.put(resource, new Resource(resource, mimeType, inSpine,
- hasValidItemFallback, hasValidImageFallback));
}
- public void registerAnchor(String resource, int lineNumber,
- int columnNumber, String id, int type)
+ public void registerAnchor(String path, int lineNumber, int columnNumber, String id, Type type)
{
- Resource res = resources.get(resource);
- if (res == null)
- {
- throw new IllegalArgumentException("unregistered resource: "
- + resource);
- }
- if (res.anchors.get(id) != null)
+ Resource res = Preconditions.checkNotNull(resources.get(path));
+ // Note: duplicate IDs are checked in schematron
+ if (!res.anchors.contains(id))
{
- throw new IllegalArgumentException("duplicate id: " + id);
- }
- res.anchors.put(id, new Anchor(id, lineNumber, columnNumber, type));
- }
-
- void registerReference(String srcResource, int srcLineNumber,
- int srcColumnNumber, String refResource, String refFragment,
- int type)
- {
- if (refResource.startsWith("data:"))
- {
- return;
+ res.anchors.put(id, new Anchor(id, lineNumber, columnNumber, type));
}
- report.info(srcResource, FeatureEnum.RESOURCE, refResource);
- references.add(new Reference(srcResource, srcLineNumber,
- srcColumnNumber, refResource, refFragment, type));
}
- public void registerReference(String srcResource, int srcLineNumber,
- int srcColumnNumber, String ref, int type)
+ public void registerReference(String srcResource, int srcLineNumber, int srcColumnNumber,
+ String ref, Type type)
{
if (ref.startsWith("data:"))
{
return;
}
- // see http://code.google.com/p/epubcheck/issues/detail?id=190
- // see http://code.google.com/p/epubcheck/issues/detail?id=261
+ // see http://code.google.com/p/epubcheck/issues/detail?id=190
+ // see http://code.google.com/p/epubcheck/issues/detail?id=261
int query = ref.indexOf('?');
- if (query >= 0 && !ref.matches("^[^:/?#]+://.*")) {
+ if (query >= 0 && !ref.matches("^[^:/?#]+://.*"))
+ {
ref = ref.substring(0, query).trim();
}
@@ -242,9 +218,10 @@ public class XRefChecker
refResource = ref;
refFragment = null;
}
+ report.info(srcResource, FeatureEnum.RESOURCE, refResource);
+ references.add(
+ new Reference(srcResource, srcLineNumber, srcColumnNumber, refResource, refFragment, type));
- registerReference(srcResource, srcLineNumber, srcColumnNumber,
- refResource, refFragment, type);
}
public void checkReferences()
@@ -261,153 +238,180 @@ public class XRefChecker
private void checkReference(Reference ref)
{
Resource res = resources.get(ref.refResource);
+ Resource host = resources.get(ref.resource);
+
+ // Check undeclared resources
if (res == null)
- {
- if(ref.refResource.matches("^[^:/?#]+://.*")
- && !(version == EPUBVersion.VERSION_3 && (ref.type == RT_AUDIO || ref.type == RT_VIDEO)))
+ {
+ if (version == EPUBVersion.VERSION_3 && ref.type == Type.LINK)
+ {
+ if (ref.refResource.matches("^[^:/?#]+://.*") || ocf.hasEntry(ref.refResource))
+ {
+ return;
+ }
+ else
+ {
+ report.message(MessageId.RSC_007w,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
+ }
+ }
+ else if (ref.refResource.matches("^[^:/?#]+://.*") && !(version == EPUBVersion.VERSION_3
+ && (ref.type == Type.AUDIO || ref.type == Type.VIDEO)))
{
report.message(MessageId.RSC_006,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
}
else if (!ocf.hasEntry(ref.refResource) && !ref.refResource.matches("^[^:/?#]+://.*"))
{
report.message(MessageId.RSC_007,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
}
else if (!undeclared.contains(ref.refResource))
{
undeclared.add(ref.refResource);
report.message(MessageId.RSC_008,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
}
return;
}
- if (ref.fragment == null)
+ // Type-specific checks
+ switch (ref.type)
{
- switch (ref.type)
+ case HYPERLINK:
+ // if mimeType is null, we should have reported an error already
+ if (!OPFChecker.isBlessedItemType(res.item.getMimeType(), version)
+ && !OPFChecker.isDeprecatedBlessedItemType(res.item.getMimeType())
+ && !res.hasValidItemFallback)
{
- case RT_SVG_PAINT:
- case RT_SVG_CLIP_PATH:
- case RT_SVG_SYMBOL:
- report.message(MessageId.RSC_015,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
- break;
- case RT_HYPERLINK:
- // if mimeType is null, we should have reported an error already
- if (res.mimeType != null
- && !OPFChecker.isBlessedItemType(res.mimeType, version)
- && !OPFChecker
- .isDeprecatedBlessedItemType(res.mimeType)
- && !res.hasValidItemFallback)
- {
- report.message(MessageId.RSC_010,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
- }
- if (/* !res.mimeType.equals("font/opentype") && */!res.inSpine)
- {
- report.message(MessageId.RSC_011,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
- }
- break;
- case RT_IMAGE:
- // if mimeType is null, we should have reported an error already
- if (res.mimeType != null
- && !OPFChecker.isBlessedImageType(res.mimeType)
- && !res.hasValidImageFallback)
- {
- report.message(MessageId.MED_003,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber),
- res.mimeType);
- }
- break;
- case RT_STYLESHEET:
- // if mimeType is null, we should have reported an error already
-
- // Implementations are allowed to process any stylesheet
- // language they desire; so this is an
- // error only if no fallback is available.
- // See also:
- // https://code.google.com/p/epubcheck/issues/detail?id=244
-
- if (res.mimeType != null
- && !OPFChecker.isBlessedStyleType(res.mimeType)
- && !OPFChecker
- .isDeprecatedBlessedStyleType(res.mimeType)
- && !res.hasValidItemFallback)
- {
- report.message(MessageId.CSS_010,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber),
- res.mimeType);
- }
- break;
+ report.message(MessageId.RSC_010,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber,
+ ref.refResource + ((ref.fragment != null) ? '#' + ref.fragment : "")));
}
- }
- else
- { //if (ref.fragment == null) {
- if (ref.fragment.startsWith("epubcfi("))
+ if (/* !res.mimeType.equals("font/opentype") && */!res.item.isInSpine())
{
- //Issue 150
+ report.message(MessageId.RSC_011,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber,
+ ref.refResource + ((ref.fragment != null) ? '#' + ref.fragment : "")));
+ }
+ break;
+ case IMAGE:
+ if (ref.fragment != null)
+ {
+ report.message(MessageId.RSC_009, EPUBLocation.create(ref.resource, ref.lineNumber,
+ ref.columnNumber, ref.refResource + "#" + ref.fragment));
return;
}
+ // if mimeType is null, we should have reported an error already
+ if (!OPFChecker.isBlessedImageType(res.item.getMimeType()) && !res.hasValidImageFallback)
+ {
+ report.message(MessageId.MED_003,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber),
+ res.item.getMimeType());
+ }
+ break;
+ case REGION_BASED_NAV:
+ if (!res.item.isFixedLayout())
+ {
+ report.message(MessageId.NAV_009,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber));
+ }
+ return;
+ case SEARCH_KEY:
+ // TODO update when we support EPUB CFI
+ if ((ref.fragment == null || !ref.fragment.startsWith("epubcfi(")) && !res.item.isInSpine())
+ {
+ report.message(MessageId.RSC_021,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber), ref.refResource);
+ }
+ break;
+ case STYLESHEET:
+ if (ref.fragment != null)
+ {
+ report.message(MessageId.RSC_013, EPUBLocation.create(ref.resource, ref.lineNumber,
+ ref.columnNumber, ref.refResource + "#" + ref.fragment));
+ return;
+ }
+ // if mimeType is null, we should have reported an error already
+
+ // Implementations are allowed to process any stylesheet
+ // language they desire; so this is an
+ // error only if no fallback is available.
+
+ // Since the presence of a 'text/css' stylesheet link can be considered
+ // a valid "built-in" fallback for a non-standard stylesheet (e.g.
+ // XPGT), the fallback chain test is performed in OPSHandler instead.
+
+ // See also:
+ // https://github.com/IDPF/epubcheck/issues/244
+ // https://github.com/IDPF/epubcheck/issues/271
+ // https://github.com/IDPF/epubcheck/issues/541
+ break;
+ case SVG_CLIP_PATH:
+ case SVG_PAINT:
+ case SVG_SYMBOL:
+ if (ref.fragment == null)
+ {
+ report.message(MessageId.RSC_015,
+ EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource));
+ return;
+ }
+ break;
+ default:
+ break;
+ }
- switch (ref.type)
+ // Fragment integrity checks
+ if (ref.fragment != null)
+ {
+ // EPUB CFI
+ if (ref.fragment.startsWith("epubcfi("))
{
- case RT_HYPERLINK:
- // if mimeType is null, we should have reported an error already
- if (res.mimeType != null
- && !OPFChecker.isBlessedItemType(res.mimeType, version)
- && !OPFChecker
- .isDeprecatedBlessedItemType(res.mimeType)
- && !res.hasValidItemFallback)
- {
- report.message(MessageId.RSC_010,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- }
- if (!res.inSpine)
- {
- report.message(MessageId.RSC_011,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- }
- break;
- case RT_IMAGE:
- report.message(MessageId.RSC_009,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- break;
- case RT_STYLESHEET:
- report.message(MessageId.RSC_013,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- break;
+ // FIXME epubcfi currently not supported (see issue 150).
+ return;
}
- Anchor anchor = res.anchors.get(ref.fragment);
- if (anchor == null)
+ // Media fragments in Data Navigation Documents
+ else if (ref.fragment.contains("=") && host != null && host.item.getProperties()
+ .contains(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.DATA_NAV)))
{
- report.message(MessageId.RSC_012,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
+ // Ignore,
+ return;
}
+ // Fragment Identifier (by default)
else
{
+ Anchor anchor = res.anchors.get(ref.fragment);
+ if (anchor == null)
+ {
+ report.message(MessageId.RSC_012, EPUBLocation.create(ref.resource, ref.lineNumber,
+ ref.columnNumber, ref.refResource + "#" + ref.fragment));
+ return;
+ }
switch (ref.type)
{
- case RT_SVG_PAINT:
- case RT_SVG_CLIP_PATH:
- if (anchor.type != ref.type)
- {
- report.message(MessageId.RSC_014,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- }
- break;
- case RT_SVG_SYMBOL:
- case RT_HYPERLINK:
- if (anchor.type != ref.type && anchor.type != RT_GENERIC)
- {
- report.message(MessageId.RSC_014,
- new MessageLocation(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment));
- }
- break;
+ case SVG_PAINT:
+ case SVG_CLIP_PATH:
+ if (anchor.type != ref.type)
+ {
+ report.message(MessageId.RSC_014, EPUBLocation.create(ref.resource, ref.lineNumber,
+ ref.columnNumber, ref.refResource + "#" + ref.fragment));
+ }
+ break;
+ case SVG_SYMBOL:
+ case HYPERLINK:
+ if (anchor.type != ref.type && anchor.type != Type.GENERIC)
+ {
+ report.message(MessageId.RSC_014, EPUBLocation.create(ref.resource, ref.lineNumber,
+ ref.columnNumber, ref.refResource + "#" + ref.fragment));
+ }
+ break;
+ default:
+ break;
}
}
+
}
+
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java b/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
index 8dec4ce..451ae80 100755
--- a/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSChecker.java
@@ -22,112 +22,85 @@
package com.adobe.epubcheck.ops;
+import static com.adobe.epubcheck.opf.ValidationContext.ValidationContextPredicates.*;
+import static com.google.common.base.Predicates.*;
+
import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collections;
import java.util.List;
-import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.opf.OPFData;
-import com.adobe.epubcheck.opf.XRefChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
-import com.adobe.epubcheck.util.OPSType;
+import com.adobe.epubcheck.util.ValidatorMap;
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
+import com.adobe.epubcheck.vocab.PackageVocabs;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidator;
import com.adobe.epubcheck.xml.XMLValidators;
-import com.google.common.collect.ImmutableListMultimap;
-import com.google.common.collect.ListMultimap;
+import com.google.common.base.Predicates;
public class OPSChecker implements ContentChecker, DocumentValidator
{
- private OCFPackage ocf;
-
+ @SuppressWarnings("unchecked")
+ private final static ValidatorMap validatorMap = ValidatorMap.builder()
+ .putAll(Predicates.and(mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_2)),
+ XMLValidators.XHTML_20_NVDL, XMLValidators.XHTML_20_SCH, XMLValidators.IDUNIQUE_20_SCH)
+ .putAll(Predicates.and(mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_30_RNC, XMLValidators.XHTML_30_SCH)
+ .putAll(Predicates.and(mimetype("image/svg+xml"), version(EPUBVersion.VERSION_2)),
+ XMLValidators.SVG_20_RNG, XMLValidators.IDUNIQUE_20_SCH)
+ .putAll(Predicates.and(mimetype("image/svg+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.SVG_30_RNC, XMLValidators.SVG_30_SCH)
+ .putAll(
+ and(or(profile(EPUBProfile.DICT), hasPubType(OPFData.DC_TYPE_DICT)),
+ mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_DICT_SCH)
+ .putAll(
+ and(or(profile(EPUBProfile.EDUPUB), hasPubType(OPFData.DC_TYPE_EDUPUB)),
+ not(hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.FIXED_LAYOUT))),
+ not(hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.NON_LINEAR))),
+ mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_EDUPUB_STRUCTURE_SCH, XMLValidators.XHTML_EDUPUB_SEMANTICS_SCH,
+ XMLValidators.XHTML_IDX_SCH)
+ .putAll(
+ and(or(profile(EPUBProfile.IDX), hasPubType(OPFData.DC_TYPE_INDEX),
+ hasProp(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.INDEX)),
+ hasProp(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.IN_INDEX_COLLECTION))),
+ mimetype("application/xhtml+xml"), version(EPUBVersion.VERSION_3)),
+ XMLValidators.XHTML_IDX_SCH, XMLValidators.XHTML_IDX_INDEX_SCH)
+ .put(hasProp(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.DATA_NAV)),
+ XMLValidators.XHTML_DATANAV_SCH)
+ .build();
+
+ private final ValidationContext context;
private final Report report;
-
private final String path;
- private final String mimeType;
-
- private XRefChecker xrefChecker;
-
- private final EPUBVersion version;
-
- private final GenericResourceProvider resourceProvider;
-
- private final String properties;
-
- private final Set<String> pubTypes;
-
- private static final OPSType XHTML_20 = new OPSType("application/xhtml+xml", EPUBVersion.VERSION_2);
- private static final OPSType XHTML_30 = new OPSType("application/xhtml+xml", EPUBVersion.VERSION_3);
- private static final OPSType SVG_20 = new OPSType("image/svg+xml", EPUBVersion.VERSION_2);
- private static final OPSType SVG_30 = new OPSType("image/svg+xml", EPUBVersion.VERSION_3);
-
-
- private ListMultimap<OPSType, XMLValidator> validatorMap;
-
- private void initEpubValidatorMap()
+ public OPSChecker(ValidationContext context)
{
- ImmutableListMultimap.Builder<OPSType, XMLValidator> builder = ImmutableListMultimap.builder();
- builder.putAll(XHTML_20, XMLValidators.XHTML_20_NVDL.get(), XMLValidators.IDUNIQUE_20_SCH.get())
- .putAll(XHTML_30, XMLValidators.XHTML_30_RNC.get(), XMLValidators.XHTML_30_SCH.get())
- .putAll(SVG_20, XMLValidators.SVG_20_RNG.get(), XMLValidators.IDUNIQUE_20_SCH.get())
- .putAll(SVG_30, XMLValidators.SVG_30_RNC.get(), XMLValidators.SVG_30_SCH.get());
- if (pubTypes.contains(OPFData.DC_TYPE_EDUPUB))
- {
- builder.put(XHTML_30, XMLValidators.XHTML_EDUPUB_HEADINGS_SCH.get());
- builder.put(XHTML_30, XMLValidators.XHTML_EDUPUB_SEMANTICS_SCH.get());
- }
- validatorMap = builder.build();
- }
-
- public OPSChecker(OCFPackage ocf, Report report, String path,
- String mimeType, String properties, XRefChecker xrefChecker,
- EPUBVersion version, Set<String> pubTypes)
- {
- this.ocf = ocf;
- this.resourceProvider = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.mimeType = mimeType;
- this.version = version;
- this.properties = properties;
- this.pubTypes = pubTypes;
- initEpubValidatorMap();
- }
-
- public OPSChecker(String path, String mimeType,
- GenericResourceProvider resourceProvider, Report report,
- EPUBVersion version)
- {
- this.resourceProvider = resourceProvider;
- this.mimeType = mimeType;
- this.report = report;
- this.path = path;
- this.version = version;
- this.properties = "singleFileValidation";
- this.pubTypes = Collections.emptySet();
- initEpubValidatorMap();
+ this.context = context;
+ this.path = context.path;
+ this.report = context.report;
}
public void runChecks()
{
+ OCFPackage ocf = context.ocf.get();
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
}
else
{
@@ -140,67 +113,41 @@ public class OPSChecker implements ContentChecker, DocumentValidator
int fatalErrorsSoFar = report.getFatalErrorCount();
int errorsSoFar = report.getErrorCount();
int warningsSoFar = report.getWarningCount();
- OPSType type = new OPSType(mimeType, version);
- List<XMLValidator> validators = validatorMap
- .get(type);
+ List<XMLValidator> validators = validatorMap.getValidators(context);
try
{
validate(validators);
- }
- catch (IOException e)
+ } catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(path, 0, 0), path);
+ report.message(MessageId.PKG_008, EPUBLocation.create(path), path);
}
- return fatalErrorsSoFar == report.getFatalErrorCount()
- && errorsSoFar == report.getErrorCount()
+ return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
&& warningsSoFar == report.getWarningCount();
}
- void validate(List<XMLValidator> validators) throws
- IOException
+ void validate(List<XMLValidator> validators)
+ throws IOException
{
- InputStream in = null;
OPSHandler opsHandler;
- try
+ XMLParser opsParser = new XMLParser(context);
+
+ if (context.version == EPUBVersion.VERSION_2)
{
- in = resourceProvider.getInputStream(path);
- XMLParser opsParser = new XMLParser( ocf,
- in, path, mimeType, report,
- version);
-
- if (version == EPUBVersion.VERSION_2)
- {
- opsHandler = new OPSHandler(ocf, path, xrefChecker, opsParser, report, version);
- }
- else
- {
- opsHandler = new OPSHandler30(ocf, path, mimeType, properties,
- xrefChecker, opsParser, report, version, pubTypes);
- }
-
- opsParser.addXMLHandler(opsHandler);
-
- for (XMLValidator validator : validators)
- {
- opsParser.addValidator(validator);
- }
-
- opsParser.process();
+ opsHandler = new OPSHandler(context, opsParser);
}
- finally
+ else
+ {
+ opsHandler = new OPSHandler30(context, opsParser);
+ }
+
+ opsParser.addXMLHandler(opsHandler);
+
+ for (XMLValidator validator : validators)
{
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (Exception ignored)
- {
-
- }
+ opsParser.addValidator(validator);
}
+ opsParser.process();
+
}
}
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java b/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java
index 0656e0d..cddfcf6 100755
--- a/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSCheckerFactory.java
@@ -22,28 +22,16 @@
package com.adobe.epubcheck.ops;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.opf.ValidationContext;
-public class OPSCheckerFactory implements ContentCheckerFactory,
- DocumentValidatorFactory
+public class OPSCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
{
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> pubTypes)
+ public OPSChecker newInstance(ValidationContext context)
{
- return new OPSChecker(ocf, report, path, mimeType, properties,
- xrefChecker, version, pubTypes);
+ return new OPSChecker(context);
}
static private final OPSCheckerFactory instance = new OPSCheckerFactory();
@@ -53,12 +41,4 @@ public class OPSCheckerFactory implements ContentCheckerFactory,
return instance;
}
- public DocumentValidator newInstance(Report report, String path,
- GenericResourceProvider resourceProvider, String mimeType,
- EPUBVersion version)
- {
-
- return new OPSChecker(path, mimeType, resourceProvider, report, version);
- }
-
}
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java b/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
index 0516bd4..3cbda74 100755
--- a/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java
@@ -22,23 +22,30 @@
package com.adobe.epubcheck.ops;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Stack;
+
+import javax.xml.XMLConstants;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.css.CSSCheckerFactory;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
+import com.adobe.epubcheck.opf.OPFChecker;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.*;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.EpubConstants;
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.adobe.epubcheck.util.HandlerUtil;
+import com.adobe.epubcheck.util.PathUtil;
+import com.adobe.epubcheck.util.URISchemes;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLHandler;
import com.adobe.epubcheck.xml.XMLParser;
-
-import javax.xml.XMLConstants;
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashSet;
-import java.util.Stack;
+import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
public class OPSHandler implements XMLHandler
{
@@ -63,192 +70,210 @@ public class OPSHandler implements XMLHandler
{
return columnNumber;
}
- }
-
- final String path;
+ }
/**
* null unless head/base or xml:base is given
*/
- String base;
-
- final XRefChecker xrefChecker;
-
- static final HashSet<String> regURISchemes = fillRegURISchemes();
-
- final XMLParser parser;
- final OCFPackage ocf;
- final Report report;
- final EPUBVersion version;
-
- long openElements;
- long charsCount;
- int tableDepth = 0;
- boolean hasTh = false;
- boolean hasThead = false;
- boolean hasCaption = false;
- boolean epubTypeInUse = false;
- boolean checkedUnsupportedXMLVersion = false;
- StringBuilder textNode;
- Stack<ElementLocation> elementLocationStack = new Stack<ElementLocation>();
-
- public OPSHandler(OCFPackage ocf, String path, XRefChecker xrefChecker, XMLParser parser,
- Report report, EPUBVersion version)
+ protected URI base;
+
+ protected final ValidationContext context;
+ protected final XMLParser parser;
+ protected final String path;
+ protected final Report report;
+ protected final Optional<XRefChecker> xrefChecker;
+ protected long openElements;
+ protected long charsCount;
+ protected int tableDepth = 0;
+ protected boolean hasTh = false;
+ protected boolean hasThead = false;
+ protected boolean hasCaption = false;
+ protected Optional<EPUBLocation> nonStandardStylesheetLink = Optional.absent();
+ protected boolean hasCss = false;
+ protected boolean epubTypeInUse = false;
+ protected boolean checkedUnsupportedXMLVersion = false;
+ protected StringBuilder textNode;
+ protected Stack<ElementLocation> elementLocationStack = new Stack<ElementLocation>();
+
+ public OPSHandler(ValidationContext context, XMLParser parser)
{
- this.ocf = ocf;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.report = report;
+ this.context = context;
+ this.path = context.path;
+ this.xrefChecker = context.xrefChecker;
+ this.report = context.report;
this.parser = parser;
- this.version = version;
}
- void checkPaint(XMLElement e, String attr)
+ protected void checkPaint(XMLElement e, String attr)
{
String paint = e.getAttribute(attr);
- if (xrefChecker != null && paint != null && paint.startsWith("url(")
- && paint.endsWith(")"))
+ if (xrefChecker.isPresent() && paint != null && paint.startsWith("url(") && paint.endsWith(")"))
{
String href = paint.substring(4, paint.length() - 1);
- href = PathUtil.resolveRelativeReference(path, href, base);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href, XRefChecker.RT_SVG_PAINT);
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.SVG_PAINT);
}
}
- void checkImage(XMLElement e, String attrNS, String attr)
+ protected void checkImage(XMLElement e, String attrNS, String attr)
{
String href = e.getAttributeNS(attrNS, attr);
- if (xrefChecker != null && href != null)
+ if (xrefChecker.isPresent() && href != null)
{
- href = PathUtil.resolveRelativeReference(path, href, base);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href, XRefChecker.RT_IMAGE);
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.IMAGE);
}
}
- void checkObject(XMLElement e, String attrNS, String attr)
+ protected void checkObject(XMLElement e, String attrNS, String attr)
{
String href = e.getAttributeNS(attrNS, attr);
- if (xrefChecker != null && href != null)
+ if (xrefChecker.isPresent() && href != null)
{
- href = PathUtil.resolveRelativeReference(path, href, base);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href, XRefChecker.RT_OBJECT);
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.OBJECT);
}
}
- void checkLink(XMLElement e, String attrNS, String attr)
+ protected void checkLink(XMLElement e, String attrNS, String attr)
{
String href = e.getAttributeNS(attrNS, attr);
String rel = e.getAttributeNS(attrNS, "rel");
- if (xrefChecker != null && href != null && rel != null && rel.contains("stylesheet")
- && rel.toLowerCase().indexOf("stylesheet") >= 0)
+ if (xrefChecker.isPresent() && href != null && rel != null
+ && rel.toLowerCase().contains("stylesheet"))
{
- href = PathUtil.resolveRelativeReference(path, href, base);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href, XRefChecker.RT_STYLESHEET);
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.STYLESHEET);
+
+ // Check the mimetype to record possible non-standard stylesheets
+ // with no fallback
+ String mimetype = xrefChecker.get().getMimeType(href);
+ if (mimetype != null)
+ {
+ if (OPFChecker.isBlessedStyleType(mimetype)
+ || OPFChecker.isDeprecatedBlessedStyleType(mimetype))
+ {
+ hasCss = true;
+ }
+ else
+ {
+ nonStandardStylesheetLink = Optional.of(
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href));
+ }
+ }
}
}
- void checkSymbol(XMLElement e, String attrNS, String attr)
+ protected void checkStylesheetFallback()
{
- String href = e.getAttributeNS(attrNS, attr);
- if (xrefChecker != null && href != null)
+ // stylesheet is considered as having "built-in" fallback if
+ // at least one is found with a blessed CMT (i.e. text/css).
+ // Implem note: xrefChecker is necessarily present if
+ // nonStandardStylesheetLink is present.
+ if (nonStandardStylesheetLink.isPresent() && !hasCss && !xrefChecker.get()
+ .hasValidFallback(nonStandardStylesheetLink.get().getContext().get()).or(false))
{
- href = PathUtil.resolveRelativeReference(path, href, base);
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href, XRefChecker.RT_SVG_SYMBOL);
+ report.message(MessageId.CSS_010, nonStandardStylesheetLink.get());
}
}
- void checkHRef(XMLElement e, String attrNS, String attr)
+ // end head: if no-css stylesheet found AND no css present, report CSS_010
+
+ protected void checkSymbol(XMLElement e, String attrNS, String attr)
{
String href = e.getAttributeNS(attrNS, attr);
- //outWriter.println("HREF: '" + href +"'");
- if (href == null)
+ if (xrefChecker.isPresent() && href != null)
{
- return;
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.SVG_SYMBOL);
}
+ }
- if (href.contains("#epubcfi"))
+ protected void checkHRef(XMLElement e, String attrNS, String attr)
+ {
+ String href = e.getAttributeNS(attrNS, attr);
+ if (href == null)
{
- return; //temp until cfi implemented
+ return;
}
-
href = href.trim();
-
- if (href.length() < 1)
+ if (href.isEmpty())
{
- //if href="" then selfreference which is valid,
- //but as per issue 225, issue a hint
+ // if href="" then selfreference which is valid,
+ // but as per issue 225, issue a hint
report.message(MessageId.HTM_045,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href));
return;
}
-
- if (".".equals(href))
+ else if (href.contains("#epubcfi"))
{
- //selfreference, no need to check
+ return; // temp until cfi implemented
+ }
+ else if (".".equals(href))
+ {
+ // selfreference, no need to check
+ return;
}
+ URI uri = checkURI(href);
+ if (uri == null) return;
- if (href.startsWith("http"))
+ if ("http".equals(uri.getScheme()))
{
report.info(path, FeatureEnum.REFERENCE, href);
}
/*
- * mgy 20120417 adding check for base to initial if clause as part
- * of solution to issue 155
- */
- if (isRegisteredSchemeType(href) || (null != base && isRegisteredSchemeType(base)))
+ * mgy 20120417 adding check for base to initial if clause as part of
+ * solution to issue 155
+ */
+ if (URISchemes.contains(uri.getScheme())
+ || (null != base && URISchemes.contains(base.getScheme())))
{
return;
}
-
// This if statement is needed to make sure XML Fragment identifiers
// are not reported as non-registered URI scheme types
- else if (href.indexOf(':') > 0)
+ else if (uri.getScheme() != null)
{
report.message(MessageId.HTM_025,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href));
return;
}
try
{
- href = PathUtil.resolveRelativeReference(path, href, base);
- }
- catch (IllegalArgumentException err)
+ href = PathUtil.resolveRelativeReference(path, href, base == null ? null : base.toString());
+ } catch (IllegalArgumentException err)
{
report.message(MessageId.OPF_010,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), href),
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), href),
err.getMessage());
return;
}
- if (xrefChecker != null)
- {
- xrefChecker.registerReference(path, parser.getLineNumber(),
- parser.getColumnNumber(), href,
- XRefChecker.RT_HYPERLINK);
- }
+ processHyperlink(href);
}
- public static boolean isRegisteredSchemeType(String href)
+ protected void processHyperlink(String href)
{
- int colonIndex = href.indexOf(':');
- return colonIndex >= 0
- && (regURISchemes.contains(href.substring(0, colonIndex + 1)) || href.length() > colonIndex + 2
- && href.substring(colonIndex + 1, colonIndex + 3).equals("//")
- && regURISchemes.contains(href.substring(0, colonIndex + 3)));
+ if (xrefChecker.isPresent())
+ {
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.HYPERLINK);
+ }
}
public void startElement()
{
openElements++;
XMLElement e = parser.getCurrentElement();
- ElementLocation currentLocation = new ElementLocation(parser.getLineNumber(), parser.getColumnNumber());
+ ElementLocation currentLocation = new ElementLocation(parser.getLineNumber(),
+ parser.getColumnNumber());
elementLocationStack.push(currentLocation);
if (!checkedUnsupportedXMLVersion)
@@ -262,7 +287,7 @@ public class OPSHandler implements XMLHandler
String baseTest = e.getAttributeNS(XMLConstants.XML_NS_URI, "base");
if (baseTest != null)
{
- base = baseTest;
+ base = checkURI(baseTest);
}
if (!epubTypeInUse)
@@ -276,24 +301,23 @@ public class OPSHandler implements XMLHandler
String ns = e.getNamespace();
String name = e.getName().toLowerCase();
- int resourceType = XRefChecker.RT_GENERIC;
+ XRefChecker.Type resourceType = XRefChecker.Type.GENERIC;
if (ns != null)
{
if (ns.equals("http://www.w3.org/2000/svg"))
{
- if (name.equals("lineargradient")
- || name.equals("radialgradient")
+ if (name.equals("lineargradient") || name.equals("radialgradient")
|| name.equals("pattern"))
{
- resourceType = XRefChecker.RT_SVG_PAINT;
+ resourceType = XRefChecker.Type.SVG_PAINT;
}
else if (name.equals("clippath"))
{
- resourceType = XRefChecker.RT_SVG_CLIP_PATH;
+ resourceType = XRefChecker.Type.SVG_CLIP_PATH;
}
else if (name.equals("symbol"))
{
- resourceType = XRefChecker.RT_SVG_SYMBOL;
+ resourceType = XRefChecker.Type.SVG_SYMBOL;
}
else if (name.equals("a"))
{
@@ -330,7 +354,7 @@ public class OPSHandler implements XMLHandler
}
else if (name.equals("base"))
{
- base = e.getAttribute("href");
+ base = checkURI(e.getAttribute("href"));
}
else if (name.equals("style"))
{
@@ -361,34 +385,45 @@ public class OPSHandler implements XMLHandler
checkBoldItalics(e);
}
- resourceType = XRefChecker.RT_HYPERLINK;
+ resourceType = XRefChecker.Type.HYPERLINK;
String style = e.getAttribute("style");
if (style != null && style.length() > 0)
{
- CSSCheckerFactory.getInstance().newInstance(
- ocf, report, style, true, path,
- currentLocation.getLineNumber(),
- currentLocation.getColumnNumber(), xrefChecker, version).runChecks();
+ CSSCheckerFactory.getInstance()
+ .newInstance(context, style, currentLocation.getLineNumber(), true).runChecks();
}
}
}
- if (xrefChecker != null && id != null)
+ if (xrefChecker.isPresent() && id != null)
{
- xrefChecker.registerAnchor(path, currentLocation.getLineNumber(),
+ xrefChecker.get().registerAnchor(path, currentLocation.getLineNumber(),
currentLocation.getColumnNumber(), id, resourceType);
}
}
- void checkBoldItalics(XMLElement e)
+ protected void checkBoldItalics(XMLElement e)
{
- report.message(MessageId.HTM_038, new MessageLocation(path, parser.getLineNumber(),
- parser.getColumnNumber(), e.getName()));
+ report.message(MessageId.HTM_038,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), e.getName()));
}
- void checkIFrame(XMLElement e)
+ protected void checkIFrame(XMLElement e)
{
- report.message(MessageId.HTM_036, new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), e.getName()));
+ report.message(MessageId.HTM_036,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), e.getName()));
+ }
+
+ protected URI checkURI(String uri)
+ {
+ try
+ {
+ return new URI(Preconditions.checkNotNull(uri).trim());
+ } catch (URISyntaxException e)
+ {
+ report.message(MessageId.RSC_020, parser.getLocation(), uri);
+ return null;
+ }
}
public void endElement()
@@ -403,9 +438,9 @@ public class OPSHandler implements XMLHandler
report.info(path, FeatureEnum.CHARS_COUNT, Long.toString(charsCount));
if (!epubTypeInUse)
{
- if (version == EPUBVersion.VERSION_3)
+ if (context.version == EPUBVersion.VERSION_3)
{
- report.message(MessageId.ACC_007, new MessageLocation(path, -1, -1));
+ report.message(MessageId.ACC_007, EPUBLocation.create(path));
}
}
else
@@ -416,45 +451,50 @@ public class OPSHandler implements XMLHandler
ElementLocation currentLocation = elementLocationStack.pop();
- boolean inXhtml = EpubConstants.HtmlNamespaceUri.equals(ns);
-
- if (inXhtml && "script".equals(name))
+ if (EpubConstants.HtmlNamespaceUri.equals(ns))
{
- String attr = e.getAttribute("type");
- report.info(path, FeatureEnum.HAS_SCRIPTS, (attr == null) ? "" : attr);
- }
- if (inXhtml && "style".equals(name))
- {
- String style = textNode.toString();
- if (style.length() > 0)
+ if ("script".equals(name))
{
- CSSCheckerFactory.getInstance().newInstance(
- ocf, report, style, false, path,
- currentLocation.getLineNumber(),
- currentLocation.getColumnNumber(), xrefChecker, version).runChecks();
+ String attr = e.getAttribute("type");
+ report.info(path, FeatureEnum.HAS_SCRIPTS, (attr == null) ? "" : attr);
}
- textNode = null;
- }
-
- if (inXhtml && ("table".equals(name)))
- {
- if (tableDepth > 0)
+ else if ("style".equals(name))
+ {
+ String style = textNode.toString();
+ if (style.length() > 0)
+ {
+ CSSCheckerFactory.getInstance()
+ .newInstance(context, style, currentLocation.getLineNumber(), false).runChecks();
+ }
+ textNode = null;
+ }
+ else if ("head".equals(name))
{
- --tableDepth;
- MessageLocation location = new MessageLocation(path, currentLocation.getLineNumber(), currentLocation.getColumnNumber(), "table");
+ checkStylesheetFallback();
+ }
+ else if ("table".equals(name))
+ {
+ if (tableDepth > 0)
+ {
+ --tableDepth;
+ EPUBLocation location = EPUBLocation.create(path, currentLocation.getLineNumber(),
+ currentLocation.getColumnNumber(), "table");
- checkDependentCondition(MessageId.ACC_005, tableDepth == 0, hasTh, location);
- checkDependentCondition(MessageId.ACC_006, tableDepth == 0, hasThead, location);
- checkDependentCondition(MessageId.ACC_012, tableDepth == 0, hasCaption, location);
+ checkDependentCondition(MessageId.ACC_005, tableDepth == 0, hasTh, location);
+ checkDependentCondition(MessageId.ACC_006, tableDepth == 0, hasThead, location);
+ checkDependentCondition(MessageId.ACC_012, tableDepth == 0, hasCaption, location);
- hasTh = hasThead = hasCaption = false;
+ hasTh = hasThead = hasCaption = false;
+ }
}
}
}
- // Report the message id when primary condition1 is true but dependent condition2 is false.
- void checkDependentCondition(MessageId id, boolean condition1, boolean condition2, MessageLocation location)
+ // Report the message id when primary condition1 is true but dependent
+ // condition2 is false.
+ protected void checkDependentCondition(MessageId id, boolean condition1, boolean condition2,
+ EPUBLocation location)
{
if (condition1 && !condition2)
{
@@ -479,44 +519,4 @@ public class OPSHandler implements XMLHandler
{
}
- static HashSet<String> fillRegURISchemes()
- {
- InputStream schemaStream = null;
- BufferedReader schemaReader = null;
- try
- {
- HashSet<String> set = new HashSet<String>();
- schemaStream = OPSHandler.class.getResourceAsStream("registeredSchemas.txt");
- schemaReader = new BufferedReader(new InputStreamReader(schemaStream));
- String schema = schemaReader.readLine();
- while (schema != null)
- {
- set.add(schema);
- schema = schemaReader.readLine();
- }
- return set;
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally
- {
- try
- {
- if (schemaReader != null)
- {
- schemaReader.close();
- }
- if (schemaStream != null)
- {
- schemaStream.close();
- }
- }
- catch (Exception ignored)
- {
- }
- }
- return null;
- }
}
diff --git a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java
index 4164766..bde1079 100644
--- a/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java
+++ b/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java
@@ -5,34 +5,38 @@ import java.util.EnumSet;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
-import com.adobe.epubcheck.api.QuietReport;
-import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.OPFChecker;
import com.adobe.epubcheck.opf.OPFChecker30;
-import com.adobe.epubcheck.opf.OPFData;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.EpubConstants;
+import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.vocab.AggregateVocab;
import com.adobe.epubcheck.vocab.AltStylesheetVocab;
+import com.adobe.epubcheck.vocab.DataNavVocab;
+import com.adobe.epubcheck.vocab.DictVocab;
import com.adobe.epubcheck.vocab.EnumVocab;
+import com.adobe.epubcheck.vocab.EpubCheckVocab;
+import com.adobe.epubcheck.vocab.IndexVocab;
import com.adobe.epubcheck.vocab.PackageVocabs;
import com.adobe.epubcheck.vocab.PackageVocabs.ITEM_PROPERTIES;
import com.adobe.epubcheck.vocab.Property;
import com.adobe.epubcheck.vocab.StagingEdupubVocab;
import com.adobe.epubcheck.vocab.StructureVocab;
+import com.adobe.epubcheck.vocab.StructureVocab.EPUB_TYPES;
import com.adobe.epubcheck.vocab.Vocab;
import com.adobe.epubcheck.vocab.VocabUtil;
import com.adobe.epubcheck.xml.XMLAttribute;
import com.adobe.epubcheck.xml.XMLElement;
import com.adobe.epubcheck.xml.XMLParser;
import com.google.common.base.Joiner;
-import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -41,40 +45,40 @@ import com.google.common.collect.Sets;
public class OPSHandler30 extends OPSHandler
{
- private static Map<String, Vocab> ITEM_VOCABS = ImmutableMap.of("", PackageVocabs.ITEM_VOCAB);
- private static Map<String, Vocab> RESERVED_VOCABS = ImmutableMap.of("", StructureVocab.VOCAB);
- private static Map<String, Vocab> RESERVED_EDUPUB_VOCABS = ImmutableMap.of("",
- AggregateVocab.of(StructureVocab.VOCAB, StagingEdupubVocab.VOCAB));
- private static Map<String, Vocab> ALTCSS_VOCABS = ImmutableMap.of("", AltStylesheetVocab.VOCAB);
+ private static final Pattern DATA_URI_PATTERN = Pattern.compile("^data:([^;]*)[^,]*,.*");
+
+ private static Map<String, Vocab> RESERVED_VOCABS = ImmutableMap.<String, Vocab> of("",
+ AggregateVocab.of(StructureVocab.VOCAB, StagingEdupubVocab.VOCAB, DataNavVocab.VOCAB,
+ DictVocab.VOCAB, IndexVocab.VOCAB));
+ private static Map<String, Vocab> ALTCSS_VOCABS = ImmutableMap.<String, Vocab> of("",
+ AltStylesheetVocab.VOCAB);
private static Map<String, Vocab> KNOWN_VOCAB_URIS = ImmutableMap.of();
private static Set<String> DEFAULT_VOCAB_URIS = ImmutableSet.of(StructureVocab.URI);
- String properties;
-
private Map<String, Vocab> vocabs = RESERVED_VOCABS;
- final Set<ITEM_PROPERTIES> propertiesSet = EnumSet.noneOf(ITEM_PROPERTIES.class);
-
- final String mimeType;
+ private final Set<ITEM_PROPERTIES> requiredProperties = EnumSet.noneOf(ITEM_PROPERTIES.class);
+ private final Set<ITEM_PROPERTIES> allowedProperties = EnumSet.noneOf(ITEM_PROPERTIES.class);
- boolean video = false;
+ private final boolean isLinear;
- boolean audio = false;
+ protected boolean inVideo = false;
+ protected boolean inAudio = false;
+ protected boolean hasValidFallback = false;
- boolean hasValidFallback = false;
+ protected int imbricatedObjects = 0;
+ protected int imbricatedCanvases = 0;
- int imbricatedObjects = 0;
- int imbricatedCanvases = 0;
+ protected boolean anchorNeedsText = false;
+ protected boolean inMathML = false;
+ protected boolean inSvg = false;
+ protected boolean inBody = false;
+ protected boolean inRegionBasedNav = false;
+ protected boolean hasAltorAnnotation = false;
- boolean anchorNeedsText = false;
- boolean inMathML = false;
- boolean inSvg = false;
- boolean hasAltorAnnotation = false;
- private final Set<String> pubTypes;
-
- static final String[] scriptEventsStrings = { "onafterprint", "onbeforeprint", "onbeforeunload",
- "onerror", "onhaschange", "onload", "onmessage", "onoffline", "onpagehide", "onpageshow",
- "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload",
+ static protected final String[] scriptEventsStrings = { "onafterprint", "onbeforeprint",
+ "onbeforeunload", "onerror", "onhaschange", "onload", "onmessage", "onoffline", "onpagehide",
+ "onpageshow", "onpopstate", "onredo", "onresize", "onstorage", "onundo", "onunload",
"onblur", "onchange", "oncontextmenu", "onfocus", "onformchange", "onforminput", "oninput",
"oninvalid", "onreset", "onselect", "onsubmit",
@@ -86,7 +90,7 @@ public class OPSHandler30 extends OPSHandler
"onplaying", "onprogress", "onratechange", "onreadystatechange", "onseeked", "onseeking",
"onstalled", "onsuspend", "ontimeupdate", "onvolumechange", "onwaiting" };
- static HashSet<String> scriptEvents;
+ static protected HashSet<String> scriptEvents;
public static HashSet<String> getScriptEvents()
{
@@ -99,10 +103,11 @@ public class OPSHandler30 extends OPSHandler
return scriptEvents;
}
- static final String[] mouseEventsStrings = { "onclick", "ondblclick", "ondrag", "ondragend",
- "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop", "onmousedown",
- "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel", "onscroll" };
- static HashSet<String> mouseEvents;
+ static protected final String[] mouseEventsStrings = { "onclick", "ondblclick", "ondrag",
+ "ondragend", "ondragenter", "ondragleave", "ondragover", "ondragstart", "ondrop",
+ "onmousedown", "onmousemove", "onmouseout", "onmouseover", "onmouseup", "onmousewheel",
+ "onscroll" };
+ static protected HashSet<String> mouseEvents;
public static HashSet<String> getMouseEvents()
{
@@ -114,30 +119,59 @@ public class OPSHandler30 extends OPSHandler
return mouseEvents;
}
- public OPSHandler30(OCFPackage ocf, String path, String mimeType, String properties,
- XRefChecker xrefChecker, XMLParser parser, Report report, EPUBVersion version,
- Set<String> pubTypes)
+ public OPSHandler30(ValidationContext context, XMLParser parser)
{
- super(ocf, path, xrefChecker, parser, report, version);
- this.mimeType = mimeType;
- this.properties = properties;
+ super(context, parser);
checkedUnsupportedXMLVersion = false;
- this.pubTypes = pubTypes;
+ isLinear = !context.properties
+ .contains(EpubCheckVocab.VOCAB.get(EpubCheckVocab.PROPERTIES.NON_LINEAR));
}
- void checkType(String type)
+ protected void checkType(XMLElement e, String type)
{
if (type == null)
{
return;
}
+ Set<Property> propList = VocabUtil.parsePropertyList(type, vocabs, report,
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
+ checkTypes(Property.filter(propList, StructureVocab.EPUB_TYPES.class));
- VocabUtil.parsePropertyList(type, vocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ // Check the 'region-based' property (Data Navigation Documents)
+ if (propList.contains(DataNavVocab.VOCAB.get(DataNavVocab.EPUB_TYPES.REGION_BASED)))
+ {
+ if (!"nav".equals(e.getName()) || !context.properties
+ .contains(PackageVocabs.ITEM_VOCAB.get(PackageVocabs.ITEM_PROPERTIES.DATA_NAV)))
+ {
+ report.message(MessageId.HTM_052, parser.getLocation());
+ }
+ else
+ {
+ inRegionBasedNav = true;
+ }
+ }
+ // Store whether the doc containt DICT content
+ if (propList.contains(DictVocab.VOCAB.get(DictVocab.EPUB_TYPES.DICTIONARY)))
+ {
+ context.featureReport.report(FeatureEnum.DICTIONARY, parser.getLocation(), null);
+ }
+ }
+
+ protected void checkTypes(Set<EPUB_TYPES> types)
+ {
+ if (types.contains(EPUB_TYPES.PAGEBREAK))
+ {
+ context.featureReport.report(FeatureEnum.PAGE_BREAK, parser.getLocation(), null);
+ }
+ if (types.contains(EPUB_TYPES.INDEX))
+ {
+ allowedProperties.add(ITEM_PROPERTIES.INDEX);
+ context.featureReport.report(FeatureEnum.INDEX, parser.getLocation(), null);
+ }
}
- void checkSSMLPh(String ph)
+ protected void checkSSMLPh(String ph)
{
// issue 139; enhancement is to add real syntax check for IPA and x-SAMPA
if (ph == null)
@@ -147,7 +181,7 @@ public class OPSHandler30 extends OPSHandler
if (ph.trim().length() < 1)
{
report.message(MessageId.HTM_007,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
}
@@ -157,7 +191,7 @@ public class OPSHandler30 extends OPSHandler
super.characters(chars, arg1, arg2);
String str = new String(chars, arg1, arg2);
str = str.trim();
- if (!str.equals("") && (audio || video || imbricatedObjects > 0 || imbricatedCanvases > 0))
+ if (!str.equals("") && (inAudio || inVideo || imbricatedObjects > 0 || imbricatedCanvases > 0))
{
hasValidFallback = true;
}
@@ -174,14 +208,15 @@ public class OPSHandler30 extends OPSHandler
XMLElement e = parser.getCurrentElement();
String name = e.getName();
+ processSemantics(e);
+ processSectioning(e);
+
if (name.equals("html"))
{
- Map<String, Vocab> reserved = (this.pubTypes.contains(OPFData.DC_TYPE_EDUPUB)) ? RESERVED_EDUPUB_VOCABS
- : RESERVED_VOCABS;
vocabs = VocabUtil.parsePrefixDeclaration(
- e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), reserved,
+ e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS,
KNOWN_VOCAB_URIS, DEFAULT_VOCAB_URIS, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
else if (name.equals("link"))
{
@@ -193,22 +228,22 @@ public class OPSHandler30 extends OPSHandler
}
else if (name.equals("math"))
{
- propertiesSet.add(ITEM_PROPERTIES.MATHML);
+ requiredProperties.add(ITEM_PROPERTIES.MATHML);
inMathML = true;
hasAltorAnnotation = (null != e.getAttribute("alttext"));
}
- else if (!mimeType.equals("image/svg+xml") && name.equals("svg"))
+ else if (!context.mimeType.equals("image/svg+xml") && name.equals("svg"))
{
- propertiesSet.add(ITEM_PROPERTIES.SVG);
+ requiredProperties.add(ITEM_PROPERTIES.SVG);
processStartSvg(e);
}
else if (name.equals("script"))
{
- propertiesSet.add(ITEM_PROPERTIES.SCRIPTED);
+ requiredProperties.add(ITEM_PROPERTIES.SCRIPTED);
}
- else if (!mimeType.equals("image/svg+xml") && name.equals("switch"))
+ else if (!context.mimeType.equals("image/svg+xml") && name.equals("switch"))
{
- propertiesSet.add(ITEM_PROPERTIES.SWITCH);
+ requiredProperties.add(ITEM_PROPERTIES.SWITCH);
}
else if (name.equals("audio"))
{
@@ -218,6 +253,14 @@ public class OPSHandler30 extends OPSHandler
{
processVideo(e);
}
+ else if (name.equals("figure"))
+ {
+ processFigure(e);
+ }
+ else if (name.equals("table"))
+ {
+ processTable(e);
+ }
else if (name.equals("canvas"))
{
processCanvas();
@@ -240,12 +283,12 @@ public class OPSHandler30 extends OPSHandler
processSrc(("source".equals(name)) ? e.getParent().getName() : name, e.getAttribute("src"));
- checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type"));
+ checkType(e, e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type"));
checkSSMLPh(e.getAttributeNS("http://www.w3.org/2001/10/synthesis", "ph"));
}
- void processInlineScripts(com.adobe.epubcheck.xml.XMLElement e)
+ protected void processInlineScripts(com.adobe.epubcheck.xml.XMLElement e)
{
HashSet<String> scriptEvents = getScriptEvents();
HashSet<String> mouseEvents = getMouseEvents();
@@ -256,15 +299,14 @@ public class OPSHandler30 extends OPSHandler
String name = attr.getName().toLowerCase();
if (scriptEvents.contains(name) || mouseEvents.contains(name))
{
- propertiesSet.add(ITEM_PROPERTIES.SCRIPTED);
+ requiredProperties.add(ITEM_PROPERTIES.SCRIPTED);
return;
}
}
}
- void processLink(XMLElement e)
+ protected void processLink(XMLElement e)
{
-
String classAttribute = e.getAttribute("class");
if (classAttribute == null)
{
@@ -272,7 +314,7 @@ public class OPSHandler30 extends OPSHandler
}
Set<Property> properties = VocabUtil.parsePropertyList(classAttribute, ALTCSS_VOCABS, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
Set<AltStylesheetVocab.PROPERTIES> altClasses = Property.filter(properties,
AltStylesheetVocab.PROPERTIES.class);
@@ -289,12 +331,12 @@ public class OPSHandler30 extends OPSHandler
if (vertical && horizontal || day && night)
{
report.message(MessageId.CSS_005,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()),
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()),
classAttribute);
}
}
- void processAnchor(XMLElement e)
+ protected void processAnchor(XMLElement e)
{
if (e.getAttribute("href") == null)
{
@@ -305,50 +347,49 @@ public class OPSHandler30 extends OPSHandler
String titleAttribute = e.getAttributeNS(EpubConstants.XLinkNamespaceUri, "title");
if (titleAttribute == null)
{
- report
- .message(
- MessageId.ACC_011,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), e
- .getName()));
+ report.message(MessageId.ACC_011, EPUBLocation.create(path, parser.getLineNumber(),
+ parser.getColumnNumber(), e.getName()));
}
}
}
- void processImg()
+ protected void processImg()
{
- if ((audio || video || imbricatedObjects > 0 || imbricatedCanvases > 0))
+ if ((inAudio || inVideo || imbricatedObjects > 0 || imbricatedCanvases > 0))
{
hasValidFallback = true;
}
}
- void processCanvas()
+ protected void processCanvas()
{
imbricatedCanvases++;
}
- void processAudio()
+ protected void processAudio()
{
- audio = true;
+ inAudio = true;
+ context.featureReport.report(FeatureEnum.AUDIO, parser.getLocation());
}
- void processVideo(XMLElement e)
+ protected void processVideo(XMLElement e)
{
- video = true;
+ inVideo = true;
+ context.featureReport.report(FeatureEnum.VIDEO, parser.getLocation());
String posterSrc = e.getAttribute("poster");
String posterMimeType = null;
- if (xrefChecker != null && posterSrc != null)
+ if (xrefChecker.isPresent() && posterSrc != null)
{
- posterMimeType = xrefChecker.getMimeType(PathUtil.resolveRelativeReference(path, posterSrc,
- base));
+ posterMimeType = xrefChecker.get().getMimeType(PathUtil.resolveRelativeReference(path,
+ posterSrc, base == null ? null : base.toString()));
}
if (posterMimeType != null && !OPFChecker.isBlessedImageType(posterMimeType))
{
report.message(MessageId.MED_001,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
if (posterSrc != null)
@@ -359,7 +400,17 @@ public class OPSHandler30 extends OPSHandler
}
- void processSrc(String name, String src)
+ protected void processHyperlink(String href)
+ {
+ super.processHyperlink(href);
+ if (inRegionBasedNav && xrefChecker.isPresent())
+ {
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ href, XRefChecker.Type.REGION_BASED_NAV);
+ }
+ }
+
+ protected void processSrc(String name, String src)
{
if (src != null)
@@ -368,53 +419,62 @@ public class OPSHandler30 extends OPSHandler
if (src.equals(""))
{
report.message(MessageId.HTM_008,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), name));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), name));
}
}
- if (src == null || xrefChecker == null)
+ if (src == null || !xrefChecker.isPresent())
{
return;
}
- if (src.matches("^[^:/?#]+://.*"))
+ String srcMimeType = null;
+ Matcher matcher = DATA_URI_PATTERN.matcher(src);
+ if (matcher.matches())
{
- propertiesSet.add(ITEM_PROPERTIES.REMOTE_RESOURCES);
+ srcMimeType = matcher.group(1);
}
else
{
- src = PathUtil.resolveRelativeReference(path, src, base);
- }
+ if (src.matches("^[^:/?#]+://.*"))
+ {
+ requiredProperties.add(ITEM_PROPERTIES.REMOTE_RESOURCES);
+ }
+ else
+ {
+ src = PathUtil.resolveRelativeReference(path, src, base == null ? null : base.toString());
+ }
- int refType;
- if ("audio".equals(name))
- {
- refType = XRefChecker.RT_AUDIO;
- }
- else if ("video".equals(name))
- {
- refType = XRefChecker.RT_VIDEO;
- }
- else
- {
- refType = XRefChecker.RT_GENERIC;
- }
- xrefChecker.registerReference(path, parser.getLineNumber(), parser.getColumnNumber(), src,
- refType);
+ XRefChecker.Type refType;
+ if ("audio".equals(name))
+ {
+ refType = XRefChecker.Type.AUDIO;
+ }
+ else if ("video".equals(name))
+ {
+ refType = XRefChecker.Type.VIDEO;
+ }
+ else
+ {
+ refType = XRefChecker.Type.GENERIC;
+ }
+ xrefChecker.get().registerReference(path, parser.getLineNumber(), parser.getColumnNumber(),
+ src, refType);
- String srcMimeType = xrefChecker.getMimeType(src);
+ srcMimeType = xrefChecker.get().getMimeType(src);
+ }
if (srcMimeType == null)
{
return;
}
- if (!mimeType.equals("image/svg+xml") && srcMimeType.equals("image/svg+xml"))
+ if (!context.mimeType.equals("image/svg+xml") && srcMimeType.equals("image/svg+xml"))
{
- propertiesSet.add(ITEM_PROPERTIES.SVG);
+ allowedProperties.add(ITEM_PROPERTIES.SVG);
}
- if ((audio || video || imbricatedObjects > 0 || imbricatedCanvases > 0)
+ if ((inAudio || inVideo || imbricatedObjects > 0 || imbricatedCanvases > 0)
&& OPFChecker30.isCoreMediaType(srcMimeType) && !name.equals("track"))
{
hasValidFallback = true;
@@ -422,7 +482,7 @@ public class OPSHandler30 extends OPSHandler
}
- void processObject(XMLElement e)
+ protected void processObject(XMLElement e)
{
imbricatedObjects++;
@@ -432,11 +492,11 @@ public class OPSHandler30 extends OPSHandler
if (data != null)
{
processSrc(e.getName(), data);
- data = PathUtil.resolveRelativeReference(path, data, base);
+ data = PathUtil.resolveRelativeReference(path, data, base == null ? null : base.toString());
}
- if (type != null && data != null && xrefChecker != null
- && !type.equals(xrefChecker.getMimeType(data)))
+ if (type != null && data != null && xrefChecker.isPresent()
+ && !type.equals(xrefChecker.get().getMimeType(data)))
{
String context = "<object";
for (int i = 0; i < e.getAttributeCount(); i++)
@@ -446,15 +506,15 @@ public class OPSHandler30 extends OPSHandler
}
context += ">";
report.message(MessageId.OPF_013,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), context),
- type, xrefChecker.getMimeType(data));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), context),
+ type, xrefChecker.get().getMimeType(data));
}
if (type != null)
{
- if (!mimeType.equals("image/svg+xml") && type.equals("image/svg+xml"))
+ if (!context.mimeType.equals("image/svg+xml") && type.equals("image/svg+xml"))
{
- propertiesSet.add(ITEM_PROPERTIES.SVG);
+ allowedProperties.add(ITEM_PROPERTIES.SVG);
}
if (OPFChecker30.isCoreMediaType(type))
@@ -468,13 +528,14 @@ public class OPSHandler30 extends OPSHandler
return;
}
// check bindings
- if (xrefChecker != null && type != null && xrefChecker.getBindingHandlerSrc(type) != null)
+ if (xrefChecker.isPresent() && type != null
+ && xrefChecker.get().getBindingHandlerId(type) != null)
{
hasValidFallback = true;
}
}
- void processStartSvg(XMLElement e)
+ protected void processStartSvg(XMLElement e)
{
inSvg = true;
boolean foundXmlLang = false;
@@ -492,7 +553,53 @@ public class OPSHandler30 extends OPSHandler
if (!foundLang || !foundXmlLang)
{
report.message(MessageId.HTM_043,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), e.getName()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), e.getName()));
+ }
+ }
+
+ protected void processTable(XMLElement e)
+ {
+ context.featureReport.report(FeatureEnum.TABLE, parser.getLocation());
+ }
+
+ protected void processFigure(XMLElement e)
+ {
+ context.featureReport.report(FeatureEnum.FIGURE, parser.getLocation());
+ }
+
+ private void processSemantics(XMLElement e)
+ {
+ if (e.getAttribute("itemscope") != null
+ && !context.featureReport.hasFeature(FeatureEnum.HAS_MICRODATA))
+ {
+ context.featureReport.report(FeatureEnum.HAS_MICRODATA, parser.getLocation());
+ }
+ if (e.getAttribute("property") != null
+ && !context.featureReport.hasFeature(FeatureEnum.HAS_RDFA))
+ {
+ context.featureReport.report(FeatureEnum.HAS_RDFA, parser.getLocation());
+ }
+ }
+
+ private void processSectioning(XMLElement e)
+ {
+ if (isLinear && context.profile == EPUBProfile.EDUPUB
+ && EpubConstants.HtmlNamespaceUri.equals(e.getNamespace()))
+ {
+ if ("body".equals(e.getName()))
+ {
+ inBody = true;
+ }
+ else if (inBody && !"section".equals(e.getName()))
+ {
+ context.featureReport.report(FeatureEnum.SECTIONS, parser.getLocation());
+ inBody = false;
+ }
+ else if ("section".equals(e.getName()))
+ {
+ inBody = false;
+ context.featureReport.report(FeatureEnum.SECTIONS, parser.getLocation());
+ }
}
}
@@ -528,7 +635,7 @@ public class OPSHandler30 extends OPSHandler
{
checkFallback("Video");
}
- video = false;
+ inVideo = false;
}
else if (name.equals("audio"))
{
@@ -536,14 +643,14 @@ public class OPSHandler30 extends OPSHandler
{
checkFallback("Audio");
}
- audio = false;
+ inAudio = false;
}
else if (name.equals("a"))
{
if (anchorNeedsText)
{
report.message(MessageId.ACC_004,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), "a"));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), "a"));
anchorNeedsText = false;
}
}
@@ -553,15 +660,19 @@ public class OPSHandler30 extends OPSHandler
if (!hasAltorAnnotation)
{
report.message(MessageId.ACC_009,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber(), "math"));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber(), "math"));
}
}
+ else if (name.equals("nav") && inRegionBasedNav)
+ {
+ inRegionBasedNav = false;
+ }
}
/*
* Checks fallbacks for video, audio and object elements
*/
- void checkFallback(String elementType)
+ protected void checkFallback(String elementType)
{
if (hasValidFallback)
{
@@ -570,52 +681,42 @@ public class OPSHandler30 extends OPSHandler
else
{
report.message(MessageId.MED_002,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), elementType);
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), elementType);
}
}
- void checkProperties()
+ protected void checkProperties()
{
- properties = Strings.nullToEmpty(properties);
-
- if (ImmutableSet.copyOf(properties.split("\\s+")).contains("singleFileValidation"))
+ if (!context.ocf.isPresent()) // single file validation
{
return;
}
- // TODO shouldn't have to reparse the properties here.
- // this.properties should be a Set<Property>
- Set<ITEM_PROPERTIES> itemProps = Sets.newEnumSet(Property.filter(VocabUtil.parsePropertyList(
- properties, ITEM_VOCABS, QuietReport.INSTANCE,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber())),
- ITEM_PROPERTIES.class), ITEM_PROPERTIES.class);
- itemProps.remove(ITEM_PROPERTIES.NAV);
- itemProps.remove(ITEM_PROPERTIES.COVER_IMAGE);
+ Set<ITEM_PROPERTIES> itemProps = Property.filter(context.properties, ITEM_PROPERTIES.class);
- for (ITEM_PROPERTIES propSet : propertiesSet)
+ for (ITEM_PROPERTIES requiredProperty : Sets.difference(requiredProperties, itemProps))
{
- if (itemProps.contains(propSet))
- {
- itemProps.remove(propSet);
- }
- else
- {
- report.message(MessageId.OPF_014, new MessageLocation(path, 0, 0),
- EnumVocab.ENUM_TO_NAME.apply(propSet));
- }
+ report.message(MessageId.OPF_014, EPUBLocation.create(path),
+ EnumVocab.ENUM_TO_NAME.apply(requiredProperty));
}
- if (itemProps.contains(ITEM_PROPERTIES.REMOTE_RESOURCES))
+ Set<ITEM_PROPERTIES> uncheckedProperties = Sets.difference(itemProps, requiredProperties)
+ .copyInto(EnumSet.noneOf(ITEM_PROPERTIES.class));
+ uncheckedProperties.remove(ITEM_PROPERTIES.NAV);
+ uncheckedProperties.remove(ITEM_PROPERTIES.DATA_NAV);
+ uncheckedProperties.remove(ITEM_PROPERTIES.COVER_IMAGE);
+ uncheckedProperties.removeAll(allowedProperties);
+ if (uncheckedProperties.contains(ITEM_PROPERTIES.REMOTE_RESOURCES))
{
- itemProps.remove(ITEM_PROPERTIES.REMOTE_RESOURCES);
+ uncheckedProperties.remove(ITEM_PROPERTIES.REMOTE_RESOURCES);
report.message(MessageId.OPF_018,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
- if (!itemProps.isEmpty())
+ if (!uncheckedProperties.isEmpty())
{
- report.message(MessageId.OPF_015, new MessageLocation(path, 0, 0),
- Joiner.on(", ").join(Collections2.transform(itemProps, EnumVocab.ENUM_TO_NAME)));
+ report.message(MessageId.OPF_015, EPUBLocation.create(path), Joiner.on(", ")
+ .join(Collections2.transform(uncheckedProperties, EnumVocab.ENUM_TO_NAME)));
}
}
}
diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
index 44fc0be..ef4aeca 100644
--- a/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
+++ b/src/main/java/com/adobe/epubcheck/overlay/OverlayChecker.java
@@ -22,65 +22,42 @@
package com.adobe.epubcheck.overlay;
-import java.io.IOException;
-import java.io.InputStream;
-
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.xml.XMLParser;
import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Preconditions;
public class OverlayChecker implements ContentChecker, DocumentValidator
{
- private OCFPackage ocf;
-
+ private final ValidationContext context;
private final Report report;
-
private final String path;
- private XRefChecker xrefChecker = null;
-
- private final GenericResourceProvider resourceProvider;
-
-
- private EPUBVersion version;
-
- public OverlayChecker(OCFPackage ocf, Report report, String path,
- XRefChecker xrefChecker, EPUBVersion version)
+ public OverlayChecker(ValidationContext context)
{
- this.ocf = ocf;
- this.resourceProvider = ocf;
- this.report = report;
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.version = version;
- }
-
- public OverlayChecker(String path,
- GenericResourceProvider resourceProvider, Report report)
- {
- this.resourceProvider = resourceProvider;
- this.report = report;
- this.path = path;
+ Preconditions.checkState("application/smil+xml".equals(context.mimeType));
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
}
public void runChecks()
{
+ OCFPackage ocf = context.ocf.get();
if (!ocf.hasEntry(path))
{
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
+ report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
}
else if (!ocf.canDecrypt(path))
{
- report.message(MessageId.RSC_004, new MessageLocation(this.ocf.getName(), 0, 0), path);
+ report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
}
else
{
@@ -93,41 +70,15 @@ public class OverlayChecker implements ContentChecker, DocumentValidator
int fatalErrorsSoFar = report.getFatalErrorCount();
int errorsSoFar = report.getErrorCount();
int warningsSoFar = report.getWarningCount();
- InputStream in = null;
OverlayHandler overlayHandler;
- try
- {
- in = resourceProvider.getInputStream(path);
- XMLParser overlayParser = new XMLParser( ocf,
- in, path,
- "application/smil+xml", report, version);
- overlayHandler = new OverlayHandler(path, xrefChecker,
- overlayParser, report);
- overlayParser.addValidator(XMLValidators.MO_30_RNC.get());
- overlayParser.addValidator(XMLValidators.MO_30_SCH.get());
- overlayParser.addXMLHandler(overlayHandler);
- overlayParser.process();
- }
- catch (IOException e)
- {
- report.message(MessageId.RSC_001, new MessageLocation(this.ocf.getName(), -1, -1), path);
- }
- finally
- {
- try
- {
- if (in != null)
- {
- in.close();
- }
- }
- catch (Exception ignored)
- {
- }
- }
-
- return fatalErrorsSoFar == report.getFatalErrorCount()
- && errorsSoFar == report.getErrorCount()
+ XMLParser overlayParser = new XMLParser(context);
+ overlayHandler = new OverlayHandler(context, overlayParser);
+ overlayParser.addValidator(XMLValidators.MO_30_RNC.get());
+ overlayParser.addValidator(XMLValidators.MO_30_SCH.get());
+ overlayParser.addXMLHandler(overlayHandler);
+ overlayParser.process();
+
+ return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
&& warningsSoFar == report.getWarningCount();
}
}
diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java
index cb6683c..d1364c0 100644
--- a/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java
+++ b/src/main/java/com/adobe/epubcheck/overlay/OverlayCheckerFactory.java
@@ -22,27 +22,16 @@
package com.adobe.epubcheck.overlay;
-import java.util.Set;
-
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.opf.ContentChecker;
import com.adobe.epubcheck.opf.ContentCheckerFactory;
-import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.opf.DocumentValidatorFactory;
-import com.adobe.epubcheck.opf.XRefChecker;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.opf.ValidationContext;
-public class OverlayCheckerFactory implements ContentCheckerFactory,
- DocumentValidatorFactory
+public class OverlayCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
{
- public ContentChecker newInstance(OCFPackage ocf, Report report,
- String path, String mimeType, String properties,
- XRefChecker xrefChecker, EPUBVersion version, Set<String> types)
+ public OverlayChecker newInstance(ValidationContext context)
{
- return new OverlayChecker(ocf, report, path, xrefChecker, version);
+ return new OverlayChecker(context);
}
static private final OverlayCheckerFactory instance = new OverlayCheckerFactory();
@@ -52,12 +41,4 @@ public class OverlayCheckerFactory implements ContentCheckerFactory,
return instance;
}
- public DocumentValidator newInstance(Report report, String path,
- GenericResourceProvider resourceProvider, String mimeType,
- EPUBVersion version)
- {
-
- return new OverlayChecker(path, resourceProvider, report);
- }
-
}
diff --git a/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java b/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java
index 3727cd1..fe416de 100644
--- a/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java
+++ b/src/main/java/com/adobe/epubcheck/overlay/OverlayHandler.java
@@ -3,10 +3,11 @@ package com.adobe.epubcheck.overlay;
import java.util.Map;
import java.util.Set;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFChecker30;
+import com.adobe.epubcheck.opf.ValidationContext;
import com.adobe.epubcheck.opf.XRefChecker;
import com.adobe.epubcheck.util.EpubConstants;
import com.adobe.epubcheck.util.HandlerUtil;
@@ -23,27 +24,25 @@ import com.google.common.collect.ImmutableSet;
public class OverlayHandler implements XMLHandler
{
- private static Map<String, Vocab> RESERVED_VOCABS = ImmutableMap.of("", StructureVocab.VOCAB);
+ private static Map<String, Vocab> RESERVED_VOCABS = ImmutableMap.<String, Vocab> of("",
+ StructureVocab.VOCAB);
private static Map<String, Vocab> KNOWN_VOCAB_URIS = ImmutableMap.of();
private static Set<String> DEFAULT_VOCAB_URIS = ImmutableSet.of(StructureVocab.URI);
+ private final ValidationContext context;
private final String path;
-
- private final XRefChecker xrefChecker;
-
private final Report report;
-
private final XMLParser parser;
private boolean checkedUnsupportedXMLVersion;
-
- private Map<String,Vocab> vocabs = RESERVED_VOCABS;
- public OverlayHandler(String path, XRefChecker xrefChecker, XMLParser parser, Report report)
+ private Map<String, Vocab> vocabs = RESERVED_VOCABS;
+
+ public OverlayHandler(ValidationContext context, XMLParser parser)
{
- this.path = path;
- this.xrefChecker = xrefChecker;
- this.report = report;
+ this.context = context;
+ this.path = context.path;
+ this.report = context.report;
this.parser = parser;
checkedUnsupportedXMLVersion = false;
}
@@ -61,19 +60,24 @@ public class OverlayHandler implements XMLHandler
if (name.equals("smil"))
{
- vocabs = VocabUtil.parsePrefixDeclaration(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS,
+ vocabs = VocabUtil.parsePrefixDeclaration(
+ e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "prefix"), RESERVED_VOCABS,
KNOWN_VOCAB_URIS, DEFAULT_VOCAB_URIS, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
- } else if (name.equals("seq"))
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
+ }
+ else if (name.equals("seq"))
{
processSeq(e);
- } else if (name.equals("text"))
+ }
+ else if (name.equals("text"))
{
processSrc(e);
- } else if (name.equals("audio"))
+ }
+ else if (name.equals("audio"))
{
- processRef(e.getAttribute("src"), XRefChecker.RT_AUDIO);
- } else if (name.equals("body") || name.equals("par"))
+ processRef(e.getAttribute("src"), XRefChecker.Type.AUDIO);
+ }
+ else if (name.equals("body") || name.equals("par"))
{
checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type"));
}
@@ -82,36 +86,37 @@ public class OverlayHandler implements XMLHandler
private void checkType(String type)
{
VocabUtil.parsePropertyList(type, vocabs, report,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()));
+ EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()));
}
private void processSrc(XMLElement e)
{
- processRef(e.getAttribute("src"), XRefChecker.RT_HYPERLINK);
+ processRef(e.getAttribute("src"), XRefChecker.Type.HYPERLINK);
}
- private void processRef(String ref, int type)
+ private void processRef(String ref, XRefChecker.Type type)
{
- if (ref != null && xrefChecker != null)
+ if (ref != null && context.xrefChecker.isPresent())
{
ref = PathUtil.resolveRelativeReference(path, ref, null);
- if (type == XRefChecker.RT_AUDIO)
+ if (type == XRefChecker.Type.AUDIO)
{
- String mimeType = xrefChecker.getMimeType(ref);
+ String mimeType = context.xrefChecker.get().getMimeType(ref);
if (mimeType != null && !OPFChecker30.isBlessedAudioType(mimeType))
{
- report.message(MessageId.MED_005,
- new MessageLocation(path, parser.getLineNumber(), parser.getColumnNumber()), ref, mimeType);
+ report.message(MessageId.MED_005, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), ref, mimeType);
}
}
- xrefChecker.registerReference(path, parser.getLineNumber(), parser.getColumnNumber(), ref, type);
+ context.xrefChecker.get().registerReference(path, parser.getLineNumber(),
+ parser.getColumnNumber(), ref, type);
}
}
private void processSeq(XMLElement e)
{
- processRef(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "textref"), XRefChecker.RT_HYPERLINK);
+ processRef(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "textref"),
+ XRefChecker.Type.HYPERLINK);
checkType(e.getAttributeNS(EpubConstants.EpubTypeNamespaceUri, "type"));
}
diff --git a/src/main/java/com/adobe/epubcheck/reporting/CheckMessage.java b/src/main/java/com/adobe/epubcheck/reporting/CheckMessage.java
index 77e0354..6e34426 100644
--- a/src/main/java/com/adobe/epubcheck/reporting/CheckMessage.java
+++ b/src/main/java/com/adobe/epubcheck/reporting/CheckMessage.java
@@ -1,14 +1,15 @@
package com.adobe.epubcheck.reporting;
-import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.messages.Severity;
-import org.codehaus.jackson.annotate.JsonProperty;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.messages.Message;
+import com.adobe.epubcheck.messages.Severity;
+
@SuppressWarnings("FieldCanBeLocal")
public class CheckMessage implements Comparable<CheckMessage>
{
@@ -22,11 +23,11 @@ public class CheckMessage implements Comparable<CheckMessage>
@JsonProperty
private int additionalLocations = 0;
@JsonProperty
- private final List<MessageLocation> locations = new ArrayList<MessageLocation>();
+ private final List<EPUBLocation> locations = new ArrayList<EPUBLocation>();
@JsonProperty
private final String suggestion;
- private CheckMessage(Message message, MessageLocation location, Object... args)
+ private CheckMessage(Message message, EPUBLocation location, Object... args)
{
this.ID = message.getID().toString();
this.message = message.getMessage(args);
@@ -35,7 +36,7 @@ public class CheckMessage implements Comparable<CheckMessage>
this.suggestion = ("".equals(message.getSuggestion())) ? null : message.getSuggestion();
}
- public static CheckMessage addCheckMessage(List<CheckMessage> checkMessages, Message message, MessageLocation location, Object... args)
+ public static CheckMessage addCheckMessage(List<CheckMessage> checkMessages, Message message, EPUBLocation location, Object... args)
{
CheckMessage result = findCheckMessage(checkMessages, message.getID().toString(), message.getMessage(args));
if (result == null)
@@ -50,14 +51,14 @@ public class CheckMessage implements Comparable<CheckMessage>
return result;
}
- void addLocation(MessageLocation location)
+ void addLocation(EPUBLocation location)
{
if (this.findLocation(location) == null)
{
if (this.locations.size() == CheckMessage.MAX_LOCATIONS)
{
++additionalLocations;
- this.locations.add(new MessageLocation("There is 1 additional location for this message.", -1, -1));
+ this.locations.add(EPUBLocation.create("There is 1 additional location for this message."));
}
else if (this.locations.size() < CheckMessage.MAX_LOCATIONS)
{
@@ -66,8 +67,9 @@ public class CheckMessage implements Comparable<CheckMessage>
else
{
++additionalLocations;
- MessageLocation infoLocation = this.locations.get(this.locations.size() - 1);
- infoLocation.setFileName(String.format("There are %1$s additional locations for this message.", additionalLocations));
+ EPUBLocation infoLocation = this.locations.remove(this.locations.size() - 1);
+ this.locations.add(EPUBLocation.create(String.format("There are %1$s additional locations for this message.", additionalLocations),
+ infoLocation.getLine(),infoLocation.getLine(),infoLocation.getContext().orNull()));
}
}
}
@@ -92,9 +94,9 @@ public class CheckMessage implements Comparable<CheckMessage>
return this.severity;
}
- private MessageLocation findLocation(MessageLocation location)
+ private EPUBLocation findLocation(EPUBLocation location)
{
- for (MessageLocation l : this.locations)
+ for (EPUBLocation l : this.locations)
{
if (l.equals(location))
{
@@ -106,14 +108,14 @@ public class CheckMessage implements Comparable<CheckMessage>
public String toString()
{
- MessageLocation location = this.locations.get(this.locations.size() - 1);
+ EPUBLocation location = this.locations.get(this.locations.size() - 1);
String lineSeparator = System.getProperty("line.separator");
String text;
text = "ID: " + ID + lineSeparator
+ "SEVERITY: " + (severity != null ? severity : "-UNDEFINED-")
+ lineSeparator
+ lineSeparator
- + "ERRONEOUS FILE NAME: " + location.getFileName()
+ + "ERRONEOUS FILE NAME: " + location.getPath()
+ lineSeparator;
if (location.getLine() > 0
&& location.getColumn() > 0)
@@ -195,7 +197,7 @@ public int getAdditionalLocations() {
return additionalLocations;
}
-public List<MessageLocation> getLocations() {
+public List<EPUBLocation> getLocations() {
return locations;
}
diff --git a/src/main/java/com/adobe/epubcheck/reporting/CheckingReport.java b/src/main/java/com/adobe/epubcheck/reporting/CheckingReport.java
index 4ad72bb..8fd7410 100644
--- a/src/main/java/com/adobe/epubcheck/reporting/CheckingReport.java
+++ b/src/main/java/com/adobe/epubcheck/reporting/CheckingReport.java
@@ -2,17 +2,20 @@ package com.adobe.epubcheck.reporting;
import com.adobe.epubcheck.api.EpubCheck;
import com.adobe.epubcheck.api.MasterReport;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.FeatureEnum;
import com.adobe.epubcheck.util.JsonWriter;
import com.adobe.epubcheck.util.PathUtil;
import com.adobe.epubcheck.util.outWriter;
+
import org.codehaus.jackson.annotate.JsonProperty;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintStream;
import java.util.*;
public class CheckingReport extends MasterReport
@@ -114,10 +117,14 @@ public class CheckingReport extends MasterReport
IOException
{
sortCollections();
- FileOutputStream out = null;
+ OutputStream out = null;
try
{
- out = new FileOutputStream(path);
+ if (path == null) {
+ out = new PrintStream(System.out);
+ } else {
+ out = new FileOutputStream(path);
+ }
JsonWriter jw = JsonWriter.createJsonWriter(true);
jw.writeJson(this, out);
}
@@ -156,7 +163,7 @@ public class CheckingReport extends MasterReport
}
@Override
- public void message(Message message, MessageLocation location, Object... args)
+ public void message(Message message, EPUBLocation location, Object... args)
{
CheckMessage.addCheckMessage(messages, message, location, args);
}
diff --git a/src/main/java/com/adobe/epubcheck/reporting/ItemMetadata.java b/src/main/java/com/adobe/epubcheck/reporting/ItemMetadata.java
index 69620e2..4bd44fc 100644
--- a/src/main/java/com/adobe/epubcheck/reporting/ItemMetadata.java
+++ b/src/main/java/com/adobe/epubcheck/reporting/ItemMetadata.java
@@ -1,10 +1,12 @@
package com.adobe.epubcheck.reporting;
-import com.adobe.epubcheck.util.FeatureEnum;
+import java.util.Map;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
import org.codehaus.jackson.annotate.JsonProperty;
-import java.util.HashSet;
-import java.util.Map;
+import com.adobe.epubcheck.util.FeatureEnum;
@SuppressWarnings("FieldCanBeLocal")
public class ItemMetadata implements Comparable<ItemMetadata>
@@ -51,7 +53,7 @@ public class ItemMetadata implements Comparable<ItemMetadata>
private String renditionSpread;
@SuppressWarnings("MismatchedQueryAndUpdateOfCollection")
@JsonProperty
- private final HashSet<String> referencedItems = new HashSet<String>();
+ private final SortedSet<String> referencedItems = new TreeSet<String>();
public static ItemMetadata getItemByName(Map<String, ItemMetadata> metadata, String fileName)
{
diff --git a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
index f07180a..e49caaf 100644
--- a/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
+++ b/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java
@@ -23,6 +23,15 @@
package com.adobe.epubcheck.tool;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.api.EpubCheck;
import com.adobe.epubcheck.api.EpubCheckFactory;
import com.adobe.epubcheck.api.Report;
@@ -30,23 +39,31 @@ import com.adobe.epubcheck.nav.NavCheckerFactory;
import com.adobe.epubcheck.opf.DocumentValidator;
import com.adobe.epubcheck.opf.DocumentValidatorFactory;
import com.adobe.epubcheck.opf.OPFCheckerFactory;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.ops.OPSCheckerFactory;
import com.adobe.epubcheck.overlay.OverlayCheckerFactory;
import com.adobe.epubcheck.reporting.CheckingReport;
-import com.adobe.epubcheck.util.*;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.util.HashMap;
-import java.util.Map;
+import com.adobe.epubcheck.util.Archive;
+import com.adobe.epubcheck.util.DefaultReportImpl;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.FeatureEnum;
+import com.adobe.epubcheck.util.FileResourceProvider;
+import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.util.InvalidVersionException;
+import com.adobe.epubcheck.util.Messages;
+import com.adobe.epubcheck.util.OPSType;
+import com.adobe.epubcheck.util.ReportingLevel;
+import com.adobe.epubcheck.util.URLResourceProvider;
+import com.adobe.epubcheck.util.XmlReportImpl;
+import com.adobe.epubcheck.util.XmpReportImpl;
+import com.adobe.epubcheck.util.outWriter;
public class EpubChecker
{
String path = null;
String mode = null;
+ EPUBProfile profile = null;
EPUBVersion version = EPUBVersion.VERSION_3;
boolean expanded = false;
boolean keep = false;
@@ -75,7 +92,7 @@ public class EpubChecker
map.put(new OPSType("svg", EPUBVersion.VERSION_3), "image/svg+xml");
map.put(new OPSType("mo", EPUBVersion.VERSION_3), "application/smil+xml");
- map.put(new OPSType("nav", EPUBVersion.VERSION_3), "nav");
+ map.put(new OPSType("nav", EPUBVersion.VERSION_3), "application/xhtml+xml");
modeMimeTypeMap = map;
}
@@ -99,7 +116,7 @@ public class EpubChecker
documentValidatorFactoryMap = map;
}
- int validateFile(String path, EPUBVersion version, Report report)
+ int validateFile(String path, EPUBVersion version, Report report, EPUBProfile profile)
{
GenericResourceProvider resourceProvider;
@@ -128,18 +145,19 @@ public class EpubChecker
if (factory == null)
{
outWriter.println(Messages.get("display_help"));
- System.err.println(String.format(
- Messages.get("mode_version_not_supported"), mode, version));
+ System.err.println(String.format(Messages.get("mode_version_not_supported"), mode, version));
- throw new RuntimeException(String.format(Messages.get("mode_version_not_supported"), mode, version));
+ throw new RuntimeException(String.format(Messages.get("mode_version_not_supported"), mode,
+ version));
}
- DocumentValidator check = factory.newInstance(report, path,
- resourceProvider, modeMimeTypeMap.get(opsType),
- version);
+ DocumentValidator check = factory.newInstance(new ValidationContextBuilder().path(path)
+ .report(report).resourceProvider(resourceProvider).mimetype(modeMimeTypeMap.get(opsType))
+ .version(version).profile(profile).build());
+
if (check.getClass() == EpubCheck.class)
{
- int validationResult = ((EpubCheck)check).doValidate();
+ int validationResult = ((EpubCheck) check).doValidate();
if (validationResult == 0)
{
outWriter.println(Messages.get("no_errors__or_warnings"));
@@ -165,7 +183,6 @@ public class EpubChecker
return 1;
}
-
int validateEpubFile(String path, EPUBVersion version, Report report)
{
GenericResourceProvider resourceProvider;
@@ -195,15 +212,16 @@ public class EpubChecker
if (factory == null)
{
outWriter.println(Messages.get("display_help"));
- System.err.println(String.format(
- Messages.get("mode_version_not_supported"), mode, version));
+ System.err.println(String.format(Messages.get("mode_version_not_supported"), mode, version));
- throw new RuntimeException(String.format(Messages.get("mode_version_not_supported"), mode, version));
+ throw new RuntimeException(String.format(Messages.get("mode_version_not_supported"), mode,
+ version));
}
- DocumentValidator check = factory.newInstance(report, path,
- resourceProvider, modeMimeTypeMap.get(opsType),
- version);
+ DocumentValidator check = factory.newInstance(
+ new ValidationContextBuilder().path(path)
+ .report(report).resourceProvider(resourceProvider).mimetype(modeMimeTypeMap.get(opsType))
+ .version(version).profile(profile).build());
if (check.validate())
{
@@ -215,7 +233,6 @@ public class EpubChecker
return 1;
}
-
public int run(String[] args)
{
int returnValue = 1;
@@ -241,12 +258,10 @@ public class EpubChecker
returnValue = returnValue2;
}
}
- }
- catch (Exception ignored)
+ } catch (Exception ignored)
{
returnValue = 1;
- }
- finally
+ } finally
{
outWriter.println(Messages.get("epubcheck_completed"));
outWriter.setQuiet(false);
@@ -254,8 +269,8 @@ public class EpubChecker
return returnValue;
}
- private void dumpMessageDictionary(Report report) throws
- IOException
+ private void dumpMessageDictionary(Report report)
+ throws IOException
{
OutputStreamWriter fw = null;
try
@@ -269,32 +284,30 @@ public class EpubChecker
fw = new OutputStreamWriter(System.out);
}
report.getDictionary().dumpMessages(fw);
- }
- catch (Exception e)
+ } catch (Exception e)
{
if (listChecksOut != null)
{
- System.err.println(String.format(Messages.get("error_creating_config_file"), listChecksOut.getAbsoluteFile()));
+ System.err.println(String.format(Messages.get("error_creating_config_file"),
+ listChecksOut.getAbsoluteFile()));
}
System.err.println(e.getMessage());
- }
- finally
+ } finally
{
if (fw != null)
{
try
{
fw.close();
- }
- catch (IOException ignored)
+ } catch (IOException ignored)
{
}
}
}
}
- private Report createReport() throws
- IOException
+ private Report createReport()
+ throws IOException
{
Report report;
if (listChecks)
@@ -303,15 +316,33 @@ public class EpubChecker
}
else if (jsonOutput)
{
- report = new CheckingReport(path, fileOut.getPath());
+ report = new CheckingReport(path, (fileOut == null) ? null : fileOut.getPath());
}
else if (xmlOutput)
{
- report = new XmlReportImpl(fileOut, path, EpubCheck.version());
+ PrintWriter pw = null;
+ if (fileOut == null)
+ {
+ pw = new PrintWriter(System.out, true);
+ }
+ else
+ {
+ pw = new PrintWriter(fileOut, "UTF-8");
+ }
+ report = new XmlReportImpl(pw, path, EpubCheck.version());
}
else if (xmpOutput)
{
- report = new XmpReportImpl(fileOut, path, EpubCheck.version());
+ PrintWriter pw = null;
+ if (fileOut == null)
+ {
+ pw = new PrintWriter(System.out, true);
+ }
+ else
+ {
+ pw = new PrintWriter(fileOut, "UTF-8");
+ }
+ report = new XmpReportImpl(pw, path, EpubCheck.version());
}
else
{
@@ -351,12 +382,10 @@ public class EpubChecker
returnValue = returnValue2;
}
}
- }
- catch (Exception ignored)
+ } catch (Exception ignored)
{
returnValue = 1;
- }
- finally
+ } finally
{
outWriter.println(Messages.get("epubcheck_completed"));
outWriter.setQuiet(false);
@@ -377,9 +406,10 @@ public class EpubChecker
{
if (mode != null)
{
- report.info(null, FeatureEnum.EXEC_MODE, String.format(Messages.get("single_file"), mode, version.toString()));
+ report.info(null, FeatureEnum.EXEC_MODE,
+ String.format(Messages.get("single_file"), mode, version.toString(), profile));
}
- result = validateFile(path, version, report);
+ result = validateFile(path, version, report, profile);
}
else
{
@@ -388,13 +418,11 @@ public class EpubChecker
}
return result;
- }
- catch (Throwable e)
+ } catch (Throwable e)
{
e.printStackTrace();
return 1;
- }
- finally
+ } finally
{
report.close();
}
@@ -416,8 +444,7 @@ public class EpubChecker
try
{
epub = new Archive(path, true);
- }
- catch (RuntimeException ex)
+ } catch (RuntimeException ex)
{
System.err.println(Messages.get("there_were_errors"));
return 1;
@@ -425,7 +452,7 @@ public class EpubChecker
epub.createArchive();
report.setEpubFileName(epub.getEpubFile().getAbsolutePath());
- EpubCheck check = new EpubCheck(epub.getEpubFile(), report);
+ EpubCheck check = new EpubCheck(epub.getEpubFile(), report, profile);
int validationResult = check.doValidate();
if (validationResult == 0)
{
@@ -447,7 +474,7 @@ public class EpubChecker
{
if ((report.getErrorCount() > 0) || (report.getFatalErrorCount() > 0))
{
- //keep if valid or only warnings
+ // keep if valid or only warnings
System.err.println(Messages.get("deleting_archive"));
epub.deleteEpubFile();
}
@@ -461,19 +488,18 @@ public class EpubChecker
{
if (mode != null)
{
- report.info(null, FeatureEnum.EXEC_MODE, String.format(Messages.get("single_file"), mode, version.toString()));
+ report.info(null, FeatureEnum.EXEC_MODE,
+ String.format(Messages.get("single_file"), mode, version.toString(), profile));
}
- result = validateFile(path, version, report);
+ result = validateFile(path, version, report, profile);
}
return result;
- }
- catch (Throwable e)
+ } catch (Throwable e)
{
e.printStackTrace();
return 1;
- }
- finally
+ } finally
{
report.close();
}
@@ -488,7 +514,8 @@ public class EpubChecker
* -? or -help = display usage instructions <br>
* -v or -version = display tool version number
*
- * @param args String[] containing arguments passed to main
+ * @param args
+ * String[] containing arguments passed to main
* @return the name of the file to check
*/
private boolean processArguments(String[] args)
@@ -542,22 +569,48 @@ public class EpubChecker
throw new RuntimeException(Messages.get("mode_argument_expected"));
}
}
+ else if (args[i].equals("--profile") || args[i].equals("-profile") || args[i].equals("-p"))
+ {
+ if (i + 1 < args.length)
+ {
+ String profileStr = args[++i];
+ try
+ {
+ profile = EPUBProfile.valueOf(profileStr.toUpperCase());
+ } catch (IllegalArgumentException e)
+ {
+ System.err.println(Messages.get("mode_version_ignored", profileStr));
+ profile = EPUBProfile.DEFAULT;
+ }
+ }
+ else
+ {
+ outWriter.println(Messages.get("display_help"));
+ throw new RuntimeException(Messages.get("profile_argument_expected"));
+ }
+ }
else if (args[i].equals("--save") || args[i].equals("-save") || args[i].equals("-s"))
{
keep = true;
}
else if (args[i].equals("--out") || args[i].equals("-out") || args[i].equals("-o"))
{
- if ((args.length > (i + 1)) && !(args[i+1].startsWith("-")))
+ if ((args.length > (i + 1)) && !(args[i + 1].startsWith("-")))
{
fileOut = new File(args[++i]);
}
+ else if ((args.length > (i + 1)) && (args[i + 1].equalsIgnoreCase("-")))
+ {
+ fileOut = null;
+ i++;
+ }
else
{
File pathFile = new File(path);
if (pathFile.isDirectory())
{
- fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName() + "check.xml");
+ fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName()
+ + "check.xml");
}
else
{
@@ -568,16 +621,22 @@ public class EpubChecker
}
else if (args[i].equals("--json") || args[i].equals("-json") || args[i].equals("-j"))
{
- if ((args.length > (i + 1)) && !(args[i+1].startsWith("-")))
+ if ((args.length > (i + 1)) && !(args[i + 1].startsWith("-")))
{
fileOut = new File(args[++i]);
}
+ else if ((args.length > (i + 1)) && (args[i + 1].equalsIgnoreCase("-")))
+ {
+ fileOut = null;
+ i++;
+ }
else
{
File pathFile = new File(path);
if (pathFile.isDirectory())
{
- fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName() + "check.json");
+ fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName()
+ + "check.json");
}
else
{
@@ -588,16 +647,22 @@ public class EpubChecker
}
else if (args[i].equals("--xmp") || args[i].equals("-xmp") || args[i].equals("-x"))
{
- if ((args.length > (i + 1)) && !(args[i+1].startsWith("-")))
+ if ((args.length > (i + 1)) && !(args[i + 1].startsWith("-")))
{
fileOut = new File(args[++i]);
}
+ else if ((args.length > (i + 1)) && (args[i + 1].equalsIgnoreCase("-")))
+ {
+ fileOut = null;
+ i++;
+ }
else
{
File pathFile = new File(path);
if (pathFile.isDirectory())
{
- fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName() + "check.xmp");
+ fileOut = new File(pathFile.getAbsoluteFile().getParentFile(), pathFile.getName()
+ + "check.xmp");
}
else
{
@@ -646,7 +711,7 @@ public class EpubChecker
{
if (i + 1 < args.length)
{
- String fileName = args[i+1];
+ String fileName = args[i + 1];
if ("none".compareTo(fileName.toLowerCase()) == 0)
{
customMessageFile = null;
@@ -671,7 +736,7 @@ public class EpubChecker
{
if (i + 1 < args.length)
{
- if (!args[i+1].startsWith("-"))
+ if (!args[i + 1].startsWith("-"))
{
listChecksOut = new File(args[++i]);
}
@@ -682,7 +747,8 @@ public class EpubChecker
}
listChecks = true;
}
- else if (args[i].equals("--help") || args[i].equals("-help") || args[i].equals("-h") || args[i].equals("-?"))
+ else if (args[i].equals("--help") || args[i].equals("-help") || args[i].equals("-h")
+ || args[i].equals("-?"))
{
displayHelp(); // display help message
}
@@ -694,7 +760,7 @@ public class EpubChecker
}
else
{
- System.err.println(String.format(Messages.get("unrecognized_argument"),args[i]));
+ System.err.println(String.format(Messages.get("unrecognized_argument"), args[i]));
displayHelp();
return false;
}
diff --git a/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java b/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java
index fb2f36e..08bcd8c 100644
--- a/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java
+++ b/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java
@@ -22,8 +22,8 @@
package com.adobe.epubcheck.util;
import com.adobe.epubcheck.api.MasterReport;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.messages.Severity;
public class DefaultReportImpl extends MasterReport
@@ -71,7 +71,7 @@ public class DefaultReportImpl extends MasterReport
}
@Override
- public void message(Message message, MessageLocation location, Object... args)
+ public void message(Message message, EPUBLocation location, Object... args)
{
Severity severity = message.getSeverity();
String text = formatMessage(message, location, args);
@@ -87,9 +87,9 @@ public class DefaultReportImpl extends MasterReport
}
}
- String formatMessage(Message message, MessageLocation location, Object... args)
+ String formatMessage(Message message, EPUBLocation location, Object... args)
{
- String fileName = (location.getFileName() == null ? "" : "/" + location.getFileName());
+ String fileName = (location.getPath() == null ? "" : "/" + location.getPath());
fileName = PathUtil.removeWorkingDirectory(fileName);
return String.format("%1$s(%2$s): %3$s%4$s(%5$s,%6$s): %7$s",
message.getSeverity(),
diff --git a/src/main/java/com/adobe/epubcheck/util/EPUBVersion.java b/src/main/java/com/adobe/epubcheck/util/EPUBVersion.java
index b5c6780..72ddc60 100644
--- a/src/main/java/com/adobe/epubcheck/util/EPUBVersion.java
+++ b/src/main/java/com/adobe/epubcheck/util/EPUBVersion.java
@@ -24,17 +24,17 @@ package com.adobe.epubcheck.util;
public enum EPUBVersion
{
- Unknown(0f), VERSION_2(2f), VERSION_3(3f);
+ Unknown("unknown"), VERSION_2("2.0.1"), VERSION_3("3.0.1");
- private final Float version;
+ private final String version;
- EPUBVersion(float version)
+ EPUBVersion(String version)
{
this.version = version;
}
public String toString()
{
- return version.toString();
+ return version;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/util/FeatureEnum.java b/src/main/java/com/adobe/epubcheck/util/FeatureEnum.java
index f8abf4f..656af3c 100644
--- a/src/main/java/com/adobe/epubcheck/util/FeatureEnum.java
+++ b/src/main/java/com/adobe/epubcheck/util/FeatureEnum.java
@@ -24,54 +24,68 @@ package com.adobe.epubcheck.util;
public enum FeatureEnum
{
- TOOL_NAME("tool name"),
- TOOL_VERSION("tool version"),
- TOOL_DATE("tool date"),
- EXEC_MODE("execution mode"),
- FORMAT_NAME("format name"),
- FORMAT_VERSION("format version"),
- CREATION_DATE("creation date"),
- MODIFIED_DATE("modification date"),
- EPUB_RENDITIONS_COUNT("EPUB renditions count"),
+ AUDIO("audio element"),
CHARS_COUNT("characters count"),
- PAGES_COUNT("pages count"),
- SECTIONS_COUNT("sections count"),
- ITEMS_COUNT("items count"),
- DECLARED_MIMETYPE("declared mimetype"),
- FONT_EMBEDDED("font embedded"),
- FONT_REFERENCE("font reference"),
- REFERENCE("reference"),
- DC_LANGUAGE("language"),
- DC_TITLE("title"),
- DC_CREATOR("creator"),
+ COMPRESSED_SIZE("compressed size"),
+ COMPRESSION_METHOD("compression method"),
+ CREATION_DATE("creation date"),
DC_CONTRIBUTOR("contributor"),
- DC_PUBLISHER("publisher"),
+ DC_CREATOR("creator"),
DC_DATE("date"),
+ DC_DESCRIPTION("description"),
+ DC_LANGUAGE("language"),
+ DC_PUBLISHER("publisher"),
DC_RIGHTS("rights"),
DC_SUBJECT("subject"),
- DC_DESCRIPTION("description"),
- UNIQUE_IDENT("unique identifier"),
+ DC_TITLE("title"),
+ DECLARED_MIMETYPE("declared mimetype"),
+ DICTIONARY("dictiobary"),
+ EPUB_RENDITIONS_COUNT("EPUB renditions count"),
+ EXEC_MODE("execution mode"),
+ FIGURE("figure element"),
+ FONT_EMBEDDED("font embedded"),
+ FONT_REFERENCE("font reference"),
+ FORMAT_NAME("format name"),
+ FORMAT_VERSION("format version"),
+ HAS_ENCRYPTION("hasEncryption"),
HAS_FIXED_LAYOUT("hasFixedLayout"),
+ HAS_HTML4("html 4"),
+ HAS_HTML5("html 5"),
+ HAS_MICRODATA("microdata"),
+ HAS_NCX("Has ncx file"),
+ HAS_RDFA("RDFa"),
HAS_SCRIPTS("hasScripts"),
HAS_SIGNATURES("hasSignatures"),
- HAS_ENCRYPTION("hasEncryption"),
- IS_SPINEITEM("is spine item"),
- HAS_NCX("Has ncx file"),
+ INDEX("index"),
IS_LINEAR("linear"),
- RESOURCE("resource"),
- SIZE("size"),
- COMPRESSED_SIZE("compressed size"),
- COMPRESSION_METHOD("compression method"),
- HAS_HTML4("html 4"),
- HAS_HTML5("html 5"),
- SCRIPT("script"),
- SHA_256("SHA-256"),
+ IS_SPINEITEM("is spine item"),
+ ITEMS_COUNT("items count"),
+ LOA("list of audios"),
+ LOI("list of illustrations"),
+ LOT("list of tables"),
+ LOV("list of videos"),
+ MODIFIED_DATE("modification date"),
+ NAVIGATION_ORDER("navigation order"),
+ PAGE_BREAK("epub:page-break"),
+ PAGE_LIST("epub:page-list"),
+ PAGES_COUNT("pages count"),
+ REFERENCE("reference"),
RENDITION_LAYOUT("rendition:layout"),
RENDITION_ORIENTATION("rendition:orientation"),
RENDITION_SPREAD("rendition:spread"),
- NAVIGATION_ORDER("navigation order"),
- SPINE_INDEX("spine index");
-
+ RESOURCE("resource"),
+ SCRIPT("script"),
+ SECTIONS("sections"),
+ SHA_256("SHA-256"),
+ SIZE("size"),
+ SPINE_INDEX("spine index"),
+ TABLE("table element"),
+ TOC_LINKS("ToC links"),
+ TOOL_DATE("tool date"),
+ TOOL_NAME("tool name"),
+ TOOL_VERSION("tool version"),
+ UNIQUE_IDENT("unique identifier"),
+ VIDEO("video element");
private final String feature;
diff --git a/src/main/java/com/adobe/epubcheck/util/HandlerUtil.java b/src/main/java/com/adobe/epubcheck/util/HandlerUtil.java
index 6bf61c3..6f40c76 100644
--- a/src/main/java/com/adobe/epubcheck/util/HandlerUtil.java
+++ b/src/main/java/com/adobe/epubcheck/util/HandlerUtil.java
@@ -2,8 +2,8 @@ package com.adobe.epubcheck.util;
import org.w3c.dom.Element;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.xml.XMLParser;
public class HandlerUtil
@@ -16,13 +16,11 @@ public class HandlerUtil
//I don't think it is possible for this to be null. A null version would cause a SAX parser error.
if (version == null)
{
- parser.getReport().message(MessageId.HTM_002, new MessageLocation(parser.getResourceName(),
- parser.getLineNumber(), parser.getColumnNumber()));
+ parser.getReport().message(MessageId.HTM_002, EPUBLocation.create(parser.getResourceName(), parser.getLineNumber(), parser.getColumnNumber()));
}
else if (!"1.0".equals(version))
{
- parser.getReport().message(MessageId.HTM_001, new MessageLocation(parser.getResourceName(),
- parser.getLineNumber(), parser.getColumnNumber()), version);
+ parser.getReport().message(MessageId.HTM_001, EPUBLocation.create(parser.getResourceName(), parser.getLineNumber(), parser.getColumnNumber()), version);
}
}
diff --git a/src/main/java/com/adobe/epubcheck/util/JsonWriter.java b/src/main/java/com/adobe/epubcheck/util/JsonWriter.java
index 9c8e1c1..0196ace 100644
--- a/src/main/java/com/adobe/epubcheck/util/JsonWriter.java
+++ b/src/main/java/com/adobe/epubcheck/util/JsonWriter.java
@@ -1,18 +1,39 @@
package com.adobe.epubcheck.util;
+import java.io.IOException;
+import java.io.OutputStream;
+
import org.codehaus.jackson.JsonFactory;
import org.codehaus.jackson.JsonGenerator;
+import org.codehaus.jackson.JsonProcessingException;
+import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
+import org.codehaus.jackson.map.SerializerProvider;
-import java.io.IOException;
-import java.io.OutputStream;
+import com.google.common.base.Optional;
/**
* This is used to create json output
*/
public class JsonWriter
{
+ public static class OptionalJsonSerializer extends JsonSerializer<Optional<? extends String>> {
+
+ @Override
+ public void serialize(Optional<? extends String> value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException,
+ JsonProcessingException
+ {
+// jgen.writeStartObject();
+ jgen.writeString(value.orNull());
+// jgen.writeEndObject();
+
+ }
+
+
+ }
+
private ObjectMapper objectMapper;
private JsonWriter(ObjectMapper objectMapper)
diff --git a/src/main/java/com/adobe/epubcheck/util/KeyValue.java b/src/main/java/com/adobe/epubcheck/util/KeyValue.java
new file mode 100644
index 0000000..bf2b717
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/util/KeyValue.java
@@ -0,0 +1,26 @@
+package com.adobe.epubcheck.util;
+
+public final class KeyValue<A,B> {
+
+ private final A key;
+ private final B value;
+
+
+ public static <A,B> KeyValue<A,B> with(final A key, final B value) {
+ return new KeyValue<A,B>(key,value);
+ }
+
+ public KeyValue(final A key, final B value) {
+ this.key = key;
+ this.value = value;
+ }
+
+ public A getKey() {
+ return this.key;
+ }
+
+ public B getValue() {
+ return this.value;
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/util/NamespaceHelper.java b/src/main/java/com/adobe/epubcheck/util/NamespaceHelper.java
index 5c03963..e7c18ec 100644
--- a/src/main/java/com/adobe/epubcheck/util/NamespaceHelper.java
+++ b/src/main/java/com/adobe/epubcheck/util/NamespaceHelper.java
@@ -1,8 +1,9 @@
package com.adobe.epubcheck.util;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
+
import org.xml.sax.Attributes;
import org.xml.sax.Locator;
@@ -57,11 +58,11 @@ public class NamespaceHelper
private long id;
private String prefix;
private String uri;
- private MessageLocation location;
+ private EPUBLocation location;
private boolean inUse;
private Pattern prefixPattern;
- public NamespaceInstance(long id, String prefix, String uri, MessageLocation location)
+ public NamespaceInstance(long id, String prefix, String uri, EPUBLocation location)
{
setId(id);
setPrefix(prefix);
@@ -101,12 +102,12 @@ public class NamespaceHelper
this.uri = uri;
}
- public MessageLocation getLocation()
+ public EPUBLocation getLocation()
{
return location;
}
- public void setLocation(MessageLocation location)
+ public void setLocation(EPUBLocation location)
{
this.location = location;
}
@@ -285,7 +286,7 @@ public class NamespaceHelper
}
}
- public void declareNamespace(String prefix, String uri, MessageLocation location, Report report)
+ public void declareNamespace(String prefix, String uri, EPUBLocation location, Report report)
{
NamespaceContext currentContext = contexts.peek();
if (id != currentContext.getId())
@@ -315,7 +316,7 @@ public class NamespaceHelper
if (m.matches())
{
// the group holds the prefix, the value holds the uri
- declareNamespace(m.group(1), attributes.getValue(i), new MessageLocation(fileName, locator.getLineNumber(), locator.getColumnNumber(), aqName), report);
+ declareNamespace(m.group(1), attributes.getValue(i), EPUBLocation.create(fileName, locator.getLineNumber(), locator.getColumnNumber(), aqName), report);
}
else
{
diff --git a/src/main/java/com/adobe/epubcheck/util/URISchemes.java b/src/main/java/com/adobe/epubcheck/util/URISchemes.java
new file mode 100644
index 0000000..f24448b
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/util/URISchemes.java
@@ -0,0 +1,91 @@
+package com.adobe.epubcheck.util;
+
+import com.google.common.base.Enums;
+import com.google.common.base.Strings;
+
+public enum URISchemes
+{
+
+ AAA,
+ AAAS,
+ ACAP,
+ CAP,
+ CID,
+ CRID,
+ DATA,
+ DAV,
+ DICT,
+ DNS,
+ FAX,
+ FILE,
+ FTP,
+ GO,
+ GOPHER,
+ H323,
+ HTTP,
+ HTTPS,
+ ICAP,
+ IM,
+ IMAP,
+ INFO,
+ IPP,
+ IRC,
+ IRIS,
+ IRIS_BEEP,
+ IRIS_XPC,
+ IRIS_XPCS,
+ IRIS_LWZ,
+ JAVASCRIPT,
+ LDAP,
+ MAILTO,
+ MID,
+ MODEM,
+ MSRP,
+ MSRPS,
+ MTQP,
+ MUPDATE,
+ NEWS,
+ NFS,
+ NNTP,
+ OPAQUELOCKTOKEN,
+ POP,
+ PRES,
+ RTSP,
+ SERVICE,
+ SHTTP,
+ SIP,
+ SIPS,
+ SNMP,
+ SOAP_BEEP,
+ SOAP_BEEPS,
+ TAG,
+ TEL,
+ TELNET,
+ TFTP,
+ THISMESSAGE,
+ TIP,
+ TV,
+ URN,
+ VEMMI,
+ XMLRPC_BEEP,
+ XMLRPC_BEEPS,
+ XMPP,
+ Z39_50R,
+ Z39_50S,
+ AFS,
+ DTN,
+ IAX,
+ MAILSERVER,
+ PACK,
+ TN3270,
+ PROSPERO,
+ SNEWS,
+ VIDEOTEX,
+ WAIS;
+
+ public static boolean contains(String scheme)
+ {
+ return Enums.getIfPresent(URISchemes.class,
+ Strings.nullToEmpty(scheme).toUpperCase().replace('.', '_')).isPresent();
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/util/ValidatorMap.java b/src/main/java/com/adobe/epubcheck/util/ValidatorMap.java
new file mode 100644
index 0000000..02f3f01
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/util/ValidatorMap.java
@@ -0,0 +1,148 @@
+package com.adobe.epubcheck.util;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.xml.XMLValidator;
+import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
+import com.google.common.collect.FluentIterable;
+import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.LinkedListMultimap;
+import com.google.common.collect.Maps;
+
+/**
+ * A utility to store {@link XMLValidator} references and return a list of
+ * validators applicable to a given {@link ValidationContext}.
+ */
+public final class ValidatorMap
+{
+
+ /**
+ * Returns a new builder.
+ */
+ public static Builder builder()
+ {
+ return new Builder();
+ }
+
+ // internal immutable map of validators to predicates
+ private Map<XMLValidators, Predicate<? super ValidationContext>> validators;
+
+ private ValidatorMap(Map<XMLValidators, Predicate<? super ValidationContext>> validators)
+ {
+ this.validators = validators;
+ }
+
+ /**
+ * Returns a list of {@link XMLValidator}s applicable to the given
+ * {@link ValidationContext}, as determined by the {@link Predicate} used to
+ * build this map. The validators are returned in the order in which they have
+ * been added to the builder.
+ * <p>
+ * <code>XMLValidator</code> instances are built dynamically, only when the
+ * context satisfies the underlying predicate.
+ * </p>
+ *
+ * @param context
+ * a validation context
+ * @return the list of validators applicable to <code>context</code>
+ */
+ public List<XMLValidator> getValidators(final ValidationContext context)
+ {
+ return FluentIterable
+ .from(validators.entrySet())
+ .transform(
+ new Function<Entry<XMLValidators, Predicate<? super ValidationContext>>, XMLValidator>()
+ {
+
+ @Override
+ public XMLValidator apply(
+ Entry<XMLValidators, Predicate<? super ValidationContext>> entry)
+ {
+ return entry.getValue().apply(context) ? entry.getKey().get() : null;
+ }
+ }).filter(Predicates.notNull()).toList();
+ }
+
+ /**
+ * A builder for the {@link ValidatorMap}
+ */
+ public static final class Builder
+ {
+ // we use an ordered multimap internally
+ // so that client code can add the same validator more than once
+ // (e.g. with different predicates)
+ private LinkedListMultimap<XMLValidators, Predicate<? super ValidationContext>> validatorsBuilder = LinkedListMultimap
+ .create();
+
+ /**
+ * Puts the given validator in this map and determines its applicability to
+ * a validation context by the given predicate.
+ */
+ public Builder put(Predicate<? super ValidationContext> predicate, XMLValidators validator)
+ {
+ validatorsBuilder.put(validator, predicate);
+ return this;
+ }
+
+ /**
+ * Puts all the given validators in this map and determines their
+ * applicability to a validation context by the given predicate.
+ */
+ public Builder putAll(Predicate<? super ValidationContext> predicate,
+ XMLValidators... validators)
+ {
+ for (XMLValidators validator : validators)
+ {
+ put(predicate, validator);
+ }
+ return this;
+ }
+
+ /**
+ * Puts the given validator in this map, applicable to any validation
+ * context.
+ */
+ public Builder put(XMLValidators validator)
+ {
+ return put(Predicates.<ValidationContext> alwaysTrue(), validator);
+ }
+
+ /**
+ * Puts all the given validators in this map, applicable to any validation
+ * context.
+ */
+ public Builder putAll(XMLValidators... validators)
+ {
+ return putAll(Predicates.<ValidationContext> alwaysTrue(), validators);
+ }
+
+ /**
+ * Returns a newly created {@link ValidatorMap} from the validators added to
+ * this builder.
+ */
+ public ValidatorMap build()
+ {
+ // builds the final immutable map of validators
+ // if a validator is mapped to multiple predicates,
+ // they are combined with an 'or' operation
+ return new ValidatorMap(
+ ImmutableMap.copyOf(Maps.transformValues(
+ validatorsBuilder.asMap(),
+ new Function<Iterable<Predicate<? super ValidationContext>>, Predicate<? super ValidationContext>>()
+ {
+ @Override
+ public Predicate<? super ValidationContext> apply(
+ Iterable<Predicate<? super ValidationContext>> predicates)
+ {
+ return Predicates.<ValidationContext> or(predicates);
+ }
+ })));
+ }
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java b/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java
index 323ee6d..ce7c2d2 100644
--- a/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java
+++ b/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java
@@ -22,8 +22,8 @@
package com.adobe.epubcheck.util;
import com.adobe.epubcheck.api.MasterReport;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.messages.Severity;
import java.io.PrintWriter;
@@ -58,19 +58,19 @@ public class WriterReportImpl extends MasterReport
}
@Override
- public void message(Message message, MessageLocation location, Object... args)
+ public void message(Message message, EPUBLocation location, Object... args)
{
if (message.getSeverity().equals(Severity.ERROR))
{
- error(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args));
+ error(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args));
}
else if (message.getSeverity().equals(Severity.WARNING))
{
- warning(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args));
+ warning(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args));
}
else if (message.getSeverity().equals(Severity.FATAL))
{
- fatalError(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args));
+ fatalError(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args));
}
}
diff --git a/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java b/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java
index 9404274..301bc38 100644
--- a/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java
+++ b/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java
@@ -1,319 +1,340 @@
package com.adobe.epubcheck.util;
+import java.io.PrintWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
import com.adobe.epubcheck.api.MasterReport;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.Message;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.messages.Severity;
import com.adobe.epubcheck.reporting.CheckMessage;
-import java.io.*;
-import java.text.SimpleDateFormat;
-import java.util.*;
+public abstract class XmlReportAbstract extends MasterReport {
+ protected PrintWriter out;
-import org.javatuples.KeyValue;
+ protected String epubCheckName = "epubcheck";
+ protected String epubCheckVersion;
+ protected String epubCheckDate = "2012-10-31"; // default date to be
+ // overiden by the property
+ protected String generationDate;
+ protected String creationDate;
+ protected String lastModifiedDate;
+ protected String identifier;
+ protected Set<String> titles = new LinkedHashSet<String>();
+ protected final Set<String> creators = new LinkedHashSet<String>();
+ protected final Set<String> contributors = new LinkedHashSet<String>();
+ protected final Set<String> subjects = new LinkedHashSet<String>();
+ protected String publisher;
+ protected final Set<String> rights = new LinkedHashSet<String>();
+ protected String date;
-public abstract class XmlReportAbstract extends MasterReport
-{
- protected final File outputFile;
- protected PrintWriter out;
+ protected String formatName;
+ protected String formatVersion;
+ protected long pagesCount;
+ protected long charsCount;
+ protected String language;
+ protected final Set<String> embeddedFonts = new LinkedHashSet<String>();
+ protected final Set<String> refFonts = new LinkedHashSet<String>();
+ protected final Set<String> references = new LinkedHashSet<String>();
+ protected boolean hasEncryption;
+ protected boolean hasSignatures;
+ protected boolean hasAudio;
+ protected boolean hasVideo;
+ protected boolean hasFixedLayout;
+ protected boolean hasScripts;
- protected String epubCheckName = "epubcheck";
- protected String epubCheckVersion;
- protected String epubCheckDate = "2012-10-31"; // default date to be overiden by the property
- protected String generationDate;
+ protected final List<CheckMessage> warns = new ArrayList<CheckMessage>();
+ protected final List<CheckMessage> errors = new ArrayList<CheckMessage>();
+ protected final List<CheckMessage> fatalErrors = new ArrayList<CheckMessage>();
+ protected final List<CheckMessage> hints = new ArrayList<CheckMessage>();
- protected String creationDate;
- protected String lastModifiedDate;
- protected String identifier;
- protected Set<String> titles = new LinkedHashSet<String>();
- protected final Set<String> creators = new LinkedHashSet<String>();
- protected final Set<String> contributors = new LinkedHashSet<String>();
- protected final Set<String> subjects = new LinkedHashSet<String>();
- protected String publisher;
- protected final Set<String> rights = new LinkedHashSet<String>();
- protected String date;
+ public XmlReportAbstract(PrintWriter out, String ePubName, String versionEpubCheck) {
+ this.out = out;
+ this.setEpubFileName(PathUtil.removeWorkingDirectory(ePubName));
+ this.epubCheckVersion = versionEpubCheck;
+ }
- protected String formatName;
- protected String formatVersion;
- protected long pagesCount;
- protected long charsCount;
- protected String language;
- protected final Set<String> embeddedFonts = new LinkedHashSet<String>();
- protected final Set<String> refFonts = new LinkedHashSet<String>();
- protected final Set<String> references = new LinkedHashSet<String>();
- protected boolean hasEncryption;
- protected boolean hasSignatures;
- protected boolean hasAudio;
- protected boolean hasVideo;
- protected boolean hasFixedLayout;
- protected boolean hasScripts;
+ public void initialize() {
+ }
+
+ @Override
+ public void close() {
+ }
+
+ @Override
+ public void message(Message message, EPUBLocation location, Object... args) {
+ Severity s = message.getSeverity();
+ switch (s) {
+ case FATAL:
+ CheckMessage.addCheckMessage(fatalErrors, message, location, args);
+ break;
+ case ERROR:
+ CheckMessage.addCheckMessage(errors, message, location, args);
+ break;
+ case WARNING:
+ CheckMessage.addCheckMessage(warns, message, location, args);
+ break;
+ case USAGE:
+ CheckMessage.addCheckMessage(hints, message, location, args);
+ break;
+ }
+ }
+
+ @Override
+ public void info(String resource, FeatureEnum feature, String value) {
+ switch (feature) {
+ case TOOL_DATE:
+ if (value != null && !value.startsWith("$")) {
+ this.epubCheckDate = value;
+ }
+ break;
+ case TOOL_NAME:
+ this.epubCheckName = value;
+ break;
+ case TOOL_VERSION:
+ this.epubCheckVersion = value;
+ break;
+ case FORMAT_NAME:
+ this.formatName = value;
+ break;
+ case FORMAT_VERSION:
+ this.formatVersion = value;
+ break;
+ case CREATION_DATE:
+ this.creationDate = value;
+ break;
+ case MODIFIED_DATE:
+ this.lastModifiedDate = value;
+ break;
+ case PAGES_COUNT:
+ this.pagesCount = Long.parseLong(value);
+ break;
+ case CHARS_COUNT:
+ this.charsCount += Long.parseLong(value);
+ break;
+ case DECLARED_MIMETYPE:
+ if (value != null && value.startsWith("audio/")) {
+ this.hasAudio = true;
+ } else if (value != null && value.startsWith("video/")) {
+ this.hasVideo = true;
+ }
+ break;
+ case FONT_EMBEDDED:
+ this.embeddedFonts.add(value);
+ break;
+ case FONT_REFERENCE:
+ this.refFonts.add(value);
+ break;
+ case REFERENCE:
+ this.references.add(value);
+ break;
+ case DC_LANGUAGE:
+ this.language = value;
+ break;
+ case DC_TITLE:
+ this.titles.add(value);
+ break;
+ case DC_CREATOR:
+ this.creators.add(value);
+ break;
+ case DC_CONTRIBUTOR:
+ this.contributors.add(value);
+ break;
+ case DC_PUBLISHER:
+ this.publisher = value;
+ break;
+ case DC_SUBJECT:
+ this.subjects.add(value);
+ break;
+ case DC_RIGHTS:
+ this.rights.add(value);
+ break;
+ case DC_DATE:
+ this.date = value;
+ break;
+ case UNIQUE_IDENT:
+ if (resource == null) {
+ this.identifier = value;
+ }
+ break;
+ case HAS_SIGNATURES:
+ this.hasSignatures = true;
+ break;
+ case HAS_ENCRYPTION:
+ this.hasEncryption = true;
+ break;
+ case HAS_FIXED_LAYOUT:
+ this.hasFixedLayout = true;
+ break;
+ case HAS_SCRIPTS:
+ this.hasScripts = true;
+ break;
+ default:
+ break;
+ }
+ }
+
+ protected String getNameFromPath(String path) {
+ if (path == null || path.length() == 0) {
+ return null;
+ }
+ int lastSlash = path.lastIndexOf('/');
+ if (lastSlash == -1) {
+ return path;
+ } else {
+ return path.substring(lastSlash + 1);
+ }
+ }
- protected final List<CheckMessage> warns = new ArrayList<CheckMessage>();
- protected final List<CheckMessage> errors = new ArrayList<CheckMessage>();
- protected final List<CheckMessage> fatalErrors = new ArrayList<CheckMessage>();
- protected final List<CheckMessage> hints = new ArrayList<CheckMessage>();
+ public abstract int generateReport();
- public XmlReportAbstract(File out, String ePubName, String versionEpubCheck)
- {
- this.outputFile = out;
- this.setEpubFileName(PathUtil.removeWorkingDirectory(ePubName));
- this.epubCheckVersion = versionEpubCheck;
- }
+ public int generate() {
+ int returnCode = 1;
+ try {
+ returnCode = generateReport();
+ } finally {
+ if (out != null) {
+ out.flush();
+ out.close();
+ }
+ }
+ return returnCode;
+ }
- public void initialize()
- {
- }
+ protected void output(int ident, String value) {
+ if (ident != 0) {
+ char[] spaces = new char[ident];
+ Arrays.fill(spaces, ' ');
+ out.print(spaces);
+ }
+ out.println(value);
+ }
- @Override
- public void close()
- {
- }
+ protected String capitalize(String in) {
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < in.length(); i++) {
+ char c = in.charAt(i);
+ if (i == 0)
+ sb.append(Character.toUpperCase(c));
+ else
+ sb.append(c);
+ }
+ return sb.toString();
+ }
- @Override
- public void message(Message message, MessageLocation location, Object... args)
- {
- Severity s = message.getSeverity();
- switch (s) {
- case FATAL:
- CheckMessage.addCheckMessage(fatalErrors, message, location, args);
- break;
- case ERROR:
- CheckMessage.addCheckMessage(errors, message, location, args);
- break;
- case WARNING:
- CheckMessage.addCheckMessage(warns, message, location, args);
- break;
- case USAGE:
- CheckMessage.addCheckMessage(hints, message, location, args);
- break;
+ protected void startElement(int ident, String name, List<KeyValue<String, String>> attrs) {
+ if (name == null || name.trim().length() == 0) {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append('<').append(name);
+ if (attrs != null && attrs.size() != 0) {
+ for (KeyValue<String, String> attr : attrs) {
+ sb.append(' ').append(attr.getKey()).append("=\"");
+ sb.append(encodeContent(attr.getValue())).append('"');
+ }
+ }
+ sb.append('>');
+ output(ident, sb.toString());
}
- }
- @Override
- public void info(String resource, FeatureEnum feature, String value)
- {
- switch (feature)
- {
- case TOOL_DATE:
- if (value != null && !value.startsWith("$")) {
- this.epubCheckDate = value;
- }
- break;
- case TOOL_NAME:
- this.epubCheckName = value;
- break;
- case TOOL_VERSION:
- this.epubCheckVersion = value;
- break;
- case FORMAT_NAME:
- this.formatName = value;
- break;
- case FORMAT_VERSION:
- this.formatVersion = value;
- break;
- case CREATION_DATE:
- this.creationDate = value;
- break;
- case MODIFIED_DATE:
- this.lastModifiedDate = value;
- break;
- case PAGES_COUNT:
- this.pagesCount = Long.parseLong(value);
- break;
- case CHARS_COUNT:
- this.charsCount += Long.parseLong(value);
- break;
- case DECLARED_MIMETYPE:
- if (value != null && value.startsWith("audio/")) {
- this.hasAudio = true;
- } else if (value != null && value.startsWith("video/")) {
- this.hasVideo = true;
- }
- break;
- case FONT_EMBEDDED:
- this.embeddedFonts.add(value);
- break;
- case FONT_REFERENCE:
- this.refFonts.add(value);
- break;
- case REFERENCE:
- this.references.add(value);
- break;
- case DC_LANGUAGE:
- this.language = value;
- break;
- case DC_TITLE:
- this.titles.add(value);
- break;
- case DC_CREATOR:
- this.creators.add(value);
- break;
- case DC_CONTRIBUTOR:
- this.contributors.add(value);
- break;
- case DC_PUBLISHER:
- this.publisher = value;
- break;
- case DC_SUBJECT:
- this.subjects.add(value);
- break;
- case DC_RIGHTS:
- this.rights.add(value);
- break;
- case DC_DATE:
- this.date = value;
- break;
- case UNIQUE_IDENT:
- if (resource == null) {
- this.identifier = value;
- }
- break;
- case HAS_SIGNATURES:
- this.hasSignatures = true;
- break;
- case HAS_ENCRYPTION:
- this.hasEncryption = true;
- break;
- case HAS_FIXED_LAYOUT:
- this.hasFixedLayout = true;
- break;
- case HAS_SCRIPTS:
- this.hasScripts = true;
- break;
- }
- }
+ protected void startElement(int ident, String name, KeyValue<String, String>... attrs) {
+ startElement(ident, name, Arrays.asList(attrs));
+ }
- protected String getNameFromPath(String path)
- {
- if (path == null || path.length() == 0)
- {
- return null;
- }
- int lastSlash = path.lastIndexOf('/');
- if (lastSlash == -1)
- {
- return path;
- }
- else
- {
- return path.substring(lastSlash + 1);
- }
- }
+ protected void startElement(int ident, String name) {
+ startElement(ident, name, (List<KeyValue<String, String>>) null);
+ }
- public abstract int generate();
+ protected void endElement(int ident, String name) {
+ if (name == null || name.trim().length() == 0) {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append("</").append(name).append('>');
+ output(ident, sb.toString());
+ }
- protected void output(int ident, String value)
- {
- if (ident != 0) {
- char[] spaces = new char[ident];
- Arrays.fill(spaces, ' ');
- out.print(spaces);
- }
- out.println(value);
- }
+ protected void generateElement(int ident, String name, String value) {
+ if (value == null || value.trim().length() == 0) {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append('<').append(name).append('>');
+ sb.append(encodeContent(value.trim()));
+ sb.append("</").append(name).append('>');
+ output(ident, sb.toString());
+ }
- protected String capitalize(String in) {
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < in.length(); i++) {
- char c = in.charAt(i);
- if (i == 0) sb.append(Character.toUpperCase(c));
- else sb.append(c);
- }
- return sb.toString();
- }
-
- protected void startElement(int ident, String name, List<KeyValue<String, String>> attrs) {
- if (name == null || name.trim().length() == 0)
- {
- return;
- }
- StringBuilder sb = new StringBuilder();
- sb.append('<').append(name);
- if (attrs != null && attrs.size() != 0) {
- for (KeyValue<String,String> attr : attrs) {
- sb.append(' ').append(attr.getKey()).append("=\"");
- sb.append(encodeContent(attr.getValue())).append('"');
- }
- }
- sb.append('>');
- output(ident, sb.toString());
-}
- protected void startElement(int ident, String name, KeyValue<String, String> ... attrs) {
- startElement(ident, name, Arrays.asList(attrs));
- }
- protected void startElement(int ident, String name) {
- startElement(ident, name, (List<KeyValue<String, String>>)null);
- }
-
- protected void endElement(int ident, String name) {
- if (name == null || name.trim().length() == 0)
- {
- return;
- }
- StringBuilder sb = new StringBuilder();
- sb.append("</").append(name).append('>');
- output(ident, sb.toString());
-}
-
- protected void generateElement(int ident, String name, String value)
- {
- if (value == null || value.trim().length() == 0)
- {
- return;
- }
- StringBuilder sb = new StringBuilder();
- sb.append('<').append(name).append('>');
- sb.append(encodeContent(value.trim()));
- sb.append("</").append(name).append('>');
- output(ident, sb.toString());
- }
+ protected void generateElement(int ident, String name, String value, KeyValue<String, String>... attrs) {
+ generateElement(ident, name, value, Arrays.asList(attrs));
+ }
- /**
- * Encodes a content String in XML-clean form, converting characters
- * to entities as necessary. The null string will be
- * converted to an empty string.
- */
- protected static String encodeContent(String content)
- {
- if (content == null)
- {
- content = "";
- }
- StringBuilder buffer = new StringBuilder(content);
+ protected void generateElement(int ident, String name, String value, List<KeyValue<String, String>> attrs) {
+ if (name == null || name.trim().length() == 0) {
+ return;
+ }
+ StringBuilder sb = new StringBuilder();
+ sb.append('<').append(name);
+ for (KeyValue<String, String> attr : attrs) {
+ sb.append(' ').append(attr.getKey()).append("=\"");
+ sb.append(encodeContent(attr.getValue())).append('"');
+ }
+ if (value == null || value.trim().length() == 0) {
+ sb.append(" />");
+ } else {
+ sb.append('>');
+ sb.append(encodeContent(value.trim()));
+ sb.append("</").append(name).append('>');
+ }
+ output(ident, sb.toString());
+ }
+
+ /**
+ * Encodes a content String in XML-clean form, converting characters to
+ * entities as necessary. The null string will be converted to an empty
+ * string.
+ */
+ protected static String encodeContent(String content) {
+ if (content == null) {
+ content = "";
+ }
+ StringBuilder buffer = new StringBuilder(content);
- int n = 0;
- while ((n = buffer.indexOf("&", n)) > -1)
- {
- buffer.insert(n + 1, "amp;");
- n += 5;
- }
- n = 0;
- while ((n = buffer.indexOf("<", n)) > -1)
- {
- buffer.replace(n, n + 1, "<");
- n += 4;
- }
- n = 0;
- while ((n = buffer.indexOf(">", n)) > -1)
- {
- buffer.replace(n, n + 1, ">");
- n += 4;
- }
+ int n = 0;
+ while ((n = buffer.indexOf("&", n)) > -1) {
+ buffer.insert(n + 1, "amp;");
+ n += 5;
+ }
+ n = 0;
+ while ((n = buffer.indexOf("<", n)) > -1) {
+ buffer.replace(n, n + 1, "<");
+ n += 4;
+ }
+ n = 0;
+ while ((n = buffer.indexOf(">", n)) > -1) {
+ buffer.replace(n, n + 1, ">");
+ n += 4;
+ }
- return buffer.toString();
- }
+ return buffer.toString();
+ }
- /**
- * Transform time into ISO 8601 string.
- */
- protected static String fromTime(final long time)
- {
- Date date = new Date(time);
- // Waiting for Java 7: SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
- String formatted = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
- .format(date);
- return formatted.substring(0, 22) + ":" + formatted.substring(22);
- }
+ /**
+ * Transform time into ISO 8601 string.
+ */
+ protected static String fromTime(final long time) {
+ Date date = new Date(time);
+ // Waiting for Java 7: SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
+ String formatted = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(date);
+ return formatted.substring(0, 22) + ":" + formatted.substring(22);
+ }
}
diff --git a/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java b/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java
index 463ba6f..6151b84 100644
--- a/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java
+++ b/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java
@@ -1,38 +1,32 @@
package com.adobe.epubcheck.util;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-import org.javatuples.KeyValue;
-
-import com.adobe.epubcheck.messages.MessageLocation;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.reporting.CheckMessage;
public class XmlReportImpl extends XmlReportAbstract
{
- public XmlReportImpl(File out, String ePubName, String versionEpubCheck)
+ public XmlReportImpl(PrintWriter out, String ePubName, String versionEpubCheck)
{
super(out, ePubName, versionEpubCheck);
}
-
@SuppressWarnings("unchecked")
- public int generate()
+ public int generateReport()
{
+ if (out == null) return 1;
+
int returnCode = 1;
- out = null;
int ident = 0;
generationDate = fromTime(System.currentTimeMillis());
try
{
- out = new PrintWriter(outputFile, "UTF-8");
output(ident, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
List<KeyValue<String, String>> attrs = new ArrayList<KeyValue<String, String>>();
attrs.add(KeyValue.with("xmlns", "http://hul.harvard.edu/ois/xml/ns/jhove"));
@@ -71,42 +65,42 @@ public class XmlReportImpl extends XmlReportAbstract
startElement(ident++, "messages");
for (CheckMessage c : fatalErrors) {
String m = c.getID() + ", FATAL, [" + encodeContent(c.getMessage()) + "], ";
- for (MessageLocation ml : c.getLocations()) {
+ for (EPUBLocation ml : c.getLocations()) {
String loc = "";
if (ml.getLine() > 0 || ml.getColumn() > 0) {
loc = " (" + ml.getLine() + "-" + ml.getColumn() + ")";
}
- generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getFileName()) + loc);
+ generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getPath()) + loc);
}
}
for (CheckMessage c : errors) {
String m = c.getID() + ", ERROR, [" + encodeContent(c.getMessage()) + "], ";
- for (MessageLocation ml : c.getLocations()) {
+ for (EPUBLocation ml : c.getLocations()) {
String loc = "";
if (ml.getLine() > 0 || ml.getColumn() > 0) {
loc = " (" + ml.getLine() + "-" + ml.getColumn() + ")";
}
- generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getFileName()) + loc);
+ generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getPath()) + loc);
}
}
for (CheckMessage c : warns) {
String m = c.getID() + ", WARN, [" + encodeContent(c.getMessage()) + "], ";
- for (MessageLocation ml : c.getLocations()) {
+ for (EPUBLocation ml : c.getLocations()) {
String loc = "";
if (ml.getLine() > 0 || ml.getColumn() > 0) {
loc = " (" + ml.getLine() + "-" + ml.getColumn() + ")";
}
- generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getFileName()) + loc);
+ generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getPath()) + loc);
}
}
for (CheckMessage c : hints) {
String m = c.getID() + ", HINT, [" + encodeContent(c.getMessage()) + "], ";
- for (MessageLocation ml : c.getLocations()) {
+ for (EPUBLocation ml : c.getLocations()) {
String loc = "";
if (ml.getLine() > 0 || ml.getColumn() > 0) {
loc = " (" + ml.getLine() + "-" + ml.getColumn() + ")";
}
- generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getFileName()) + loc);
+ generateElement(ident, "message", m + PathUtil.removeWorkingDirectory(ml.getPath()) + loc);
}
}
endElement(--ident, "messages");
@@ -230,28 +224,11 @@ public class XmlReportImpl extends XmlReportAbstract
endElement(--ident, "jhove");
returnCode = 0;
}
- catch (FileNotFoundException e)
- {
- System.err.println("FileNotFound error: " + e.getMessage());
- returnCode = 1;
- }
- catch (UnsupportedEncodingException e)
- {
- System.err.println("FileNotFound error: " + e.getMessage());
- returnCode = 1;
- }
catch (Exception e)
{
System.err.println("Exception encountered: " + e.getMessage());
returnCode = 1;
}
- finally
- {
- if (out != null)
- {
- out.close();
- }
- }
return returnCode;
}
diff --git a/src/main/java/com/adobe/epubcheck/util/XmpReportImpl.java b/src/main/java/com/adobe/epubcheck/util/XmpReportImpl.java
index 95c5334..1544081 100644
--- a/src/main/java/com/adobe/epubcheck/util/XmpReportImpl.java
+++ b/src/main/java/com/adobe/epubcheck/util/XmpReportImpl.java
@@ -1,247 +1,245 @@
package com.adobe.epubcheck.util;
-import java.io.File;
-import java.io.FileNotFoundException;
import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
-import org.javatuples.KeyValue;
-
-import com.adobe.epubcheck.messages.MessageLocation;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.reporting.CheckMessage;
+public class XmpReportImpl extends XmlReportAbstract {
-public class XmpReportImpl extends XmlReportAbstract
-{
-
- public XmpReportImpl(File out, String ePubName, String versionEpubCheck)
- {
- super(out, ePubName, versionEpubCheck);
- }
-
-
- @SuppressWarnings("unchecked")
- public int generate()
- {
- int returnCode = 1;
- out = null;
- int ident = 0;
-
- generationDate = fromTime(System.currentTimeMillis());
- try
- {
- out = new PrintWriter(outputFile, "UTF-8");
- output(ident, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
- startElement(ident++, "x:xmpmeta",
- KeyValue.with("xmlns:x", "adobe:ns:meta/"),
- KeyValue.with("x:xmptk", "Adobe XMP Core 5.1.0-jc003")
- );
- startElement(ident++, "rdf:RDF",
- KeyValue.with("xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
- );
- List<KeyValue<String, String>> attrs = new ArrayList<KeyValue<String, String>>();
- attrs.add(KeyValue.with("rdf:about", ""));
- attrs.add(KeyValue.with("xmlns:dc", "http://purl.org/dc/elements/1.1/"));
- attrs.add(KeyValue.with("xmlns:xmp", "http://ns.adobe.com/xap/1.0/"));
- attrs.add(KeyValue.with("xmlns:xmpTPg", "http://ns.adobe.com/xap/1.0/t/pg/"));
- attrs.add(KeyValue.with("stFnt", "http:ns.adobe.com/xap/1.0/sType/Font#"));
- attrs.add(KeyValue.with("xmlns:cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties/"));
- attrs.add(KeyValue.with("xmlns:extended-properties", "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/"));
- attrs.add(KeyValue.with("xmlns:premis", "http://www.loc.gov/premis/rdf/v1"));
- if (formatName == null) {
- attrs.add(KeyValue.with("dc:format", "application/octet-stream"));
- } else {
- if (formatVersion == null) {
- attrs.add(KeyValue.with("dc:format", formatName));
- } else {
- attrs.add(KeyValue.with("dc:format", formatName + ";version=" + formatVersion));
- }
- }
- if (creationDate != null) {
- attrs.add(KeyValue.with("xmp:CreateDate", creationDate));
- }
- if (charsCount != 0) {
- attrs.add(KeyValue.with("extended-properties:Characters", Long.toString(charsCount)));
- }
- if (pagesCount != 0) {
- attrs.add(KeyValue.with("xmpTPg:NPage", Long.toString(pagesCount)));
- }
- if (publisher != null) {
- attrs.add(KeyValue.with("dc:publisher", publisher));
- }
- attrs.add(KeyValue.with("dc:identifier", identifier));
- if (language != null) {
- attrs.add(KeyValue.with("dc:language", language));
- }
-
- startElement(ident++, "rdf:Description", attrs);
-
- // DC
- if (!creators.isEmpty()) {
- startElement(ident++, "dc:creator");
- startElement(ident++, "rdf:Seq");
- for (String creator : creators) {
- generateElement(ident, "rdf:li", creator);
- }
- endElement(--ident, "rdf:Seq");
- endElement(--ident, "dc:creator");
- }
- if (!titles.isEmpty()) {
- startElement(ident++, "dc:title");
- startElement(ident++, "rdf:Alt");
- boolean first = true;
- for (String title : titles) {
- if (first) {
- output(ident, "<rdf:li xml:lang=\"x-default\">" + title + "</rdf:li>");
- first =false;
- } else {
- generateElement(ident, "rdf:li", title);
- }
- }
- endElement(--ident, "rdf:Alt");
- endElement(--ident, "dc:title");
- }
- if (!subjects.isEmpty()) {
- startElement(ident++, "dc:subject");
- startElement(ident++, "rdf:Bag");
- for (String subject : subjects) {
- generateElement(ident, "rdf:li", subject);
- }
- endElement(--ident, "rdf:Bag");
- endElement(--ident, "dc:subject");
- }
-
- // Fonts
- if (!embeddedFonts.isEmpty() || !refFonts.isEmpty()) {
- startElement(ident++, "xmpTPg:Font");
- startElement(ident++, "rdf:Bag");
- for (String font : embeddedFonts) {
- generateFont(ident, font);
- }
- for (String font : refFonts) {
- generateFont(ident, font);
- }
- endElement(--ident, "rdf:Bag");
-
- endElement(ident++, "xmpTPg:Font");
- }
-
- // Premis:event
- startElement(ident++, "premis:hasEvent");
- generateElement(ident, "premis:hasEventDateTime", generationDate);
- output(ident, "<premis:hasEventType rdf:resource=\"http://id.loc.gov/vocabulary/preservation/eventType/val\" />");
- if (fatalErrors.isEmpty() && errors.isEmpty()) {
- generateElement(ident, "premis:hasEventDetail", "Well-formed");
- } else {
- generateElement(ident, "premis:hasEventDetail", "Not well-formed");
- }
- generateEventOutcome(ident, fatalErrors, "FATAL");
- generateEventOutcome(ident, errors, "ERROR");
- generateEventOutcome(ident, warns, "WARN");
- generateEventOutcome(ident, hints, "HINT");
-
- startElement(ident++, "premis:hasEventRelatedAgent");
- output(ident, "<premis:hasAgentType rdf:resource=\"http://id.loc.gov/vocabulary/preservation/agentType/sof\" />");
- if (epubCheckVersion == null) {
- generateElement(ident, "premis:hasAgentName", epubCheckName);
- } else {
- generateElement(ident, "premis:hasAgentName", epubCheckName + " " + epubCheckVersion);
- }
- endElement(--ident, "premis:hasEventRelatedAgent");
-
- endElement(--ident, "premis:hasEvent");
-
- // Significant properties
- generateSignificantProperty(ident, "renditionLayout", hasFixedLayout?"fixed-layout":"reflowable");
- generateSignificantProperty(ident, "isScripted", Boolean.toString(hasScripts));
- generateSignificantProperty(ident, "hasEncryption", Boolean.toString(hasEncryption));
- generateSignificantProperty(ident, "hasAudio", Boolean.toString(hasAudio));
- generateSignificantProperty(ident, "hasVideo", Boolean.toString(hasVideo));
- generateSignificantProperty(ident, "hasSignatures", Boolean.toString(hasSignatures));
- int nRefs = 0;
- for (String ref : references) {
- nRefs++;
- if (nRefs > 50) {
- generateSignificantProperty(ident, "reference", "" + (references.size() - 50) + " more references");
- break;
- }
- generateSignificantProperty(ident, "reference", ref);
- }
-
- endElement(--ident, "rdf:Description");
- endElement(--ident, "rdf:RDF");
- endElement(--ident, "x:xmpmeta");
-
- returnCode = 0;
- }
- catch (FileNotFoundException e)
- {
- System.err.println("FileNotFound error: " + e.getMessage());
- returnCode = 1;
- }
- catch (UnsupportedEncodingException e)
- {
- System.err.println("FileNotFound error: " + e.getMessage());
- returnCode = 1;
- }
- catch (Exception e)
- {
- System.err.println("Exception encountered: " + e.getMessage());
- returnCode = 1;
- }
- finally
- {
- if (out != null)
- {
- out.close();
- }
- }
- return returnCode;
- }
-
- protected void generateFont(int ident, String font) {
- String[] elFont = font.split(",");
- startElement(ident++, "rdf:li");
- // stFnt:fontName, stFnt:fontType, stFnt:versionString, stFnt:composite, stFnt:fontFileName
- generateElement(ident, "stFnt:fontFamily", capitalize(elFont[0]));
- String fontFace = "";
- for (int i = 1; i < elFont.length; i++) {
- fontFace += capitalize(elFont[i]) + " ";
- }
- fontFace = fontFace.trim();
- if (fontFace.length() == 0) {
- generateElement(ident, "stFnt:fontFace", "Regular");
- } else {
- generateElement(ident, "stFnt:fontFace", fontFace);
- }
- endElement(--ident, "rdf:li");
- }
-
- private void generateEventOutcome(int ident, List<CheckMessage> messages, String sev) {
- for (CheckMessage c : messages) {
- startElement(ident++, "premis:hasEventOutcomeInformation");
- generateElement(ident, "premis:hasEventOutcome", c.getID() + ", " + sev + ", " + encodeContent(c.getMessage()));
- for (MessageLocation ml : c.getLocations()) {
- String loc = "";
- if (ml.getLine() > 0 || ml.getColumn() > 0) {
- loc = " (" + ml.getLine() + "-" + ml.getColumn() + ")";
+ public XmpReportImpl(PrintWriter out, String ePubName, String versionEpubCheck) {
+ super(out, ePubName, versionEpubCheck);
+ }
+
+ @SuppressWarnings("unchecked")
+ public int generateReport() {
+ if (out == null)
+ return 1;
+
+ int returnCode = 1;
+ int ident = 0;
+
+ generationDate = fromTime(System.currentTimeMillis());
+ try {
+ output(ident, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
+ startElement(ident++, "x:xmpmeta", KeyValue.with("xmlns:x", "adobe:ns:meta/"),
+ KeyValue.with("x:xmptk", "Adobe XMP Core 5.1.0-jc003"));
+ startElement(ident++, "rdf:RDF", KeyValue.with("xmlns:rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"));
+ List<KeyValue<String, String>> attrs = new ArrayList<KeyValue<String, String>>();
+ attrs.add(KeyValue.with("rdf:about", ""));
+ attrs.add(KeyValue.with("xmlns:dc", "http://purl.org/dc/elements/1.1/"));
+ attrs.add(KeyValue.with("xmlns:xmp", "http://ns.adobe.com/xap/1.0/"));
+ attrs.add(KeyValue.with("xmlns:xmpTPg", "http://ns.adobe.com/xap/1.0/t/pg/"));
+ attrs.add(KeyValue.with("xmlns:stFnt", "http://ns.adobe.com/xap/1.0/sType/Font#"));
+ // Unused core-properties like keywords, lastModifiedBy, revision, category
+ // attrs.add(KeyValue.with("xmlns:cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties/"));
+ // Used extended-properties for Characters
+ // but could be for Words, Lines, Paragraphs, CharactersWithSpaces, Template, DocSecurity, Application, AppVersion
+ attrs.add(KeyValue.with("xmlns:extended-properties",
+ "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/"));
+ attrs.add(KeyValue.with("xmlns:premis", "http://www.loc.gov/premis/rdf/v1#"));
+
+ if (formatName == null) {
+ attrs.add(KeyValue.with("dc:format", "application/octet-stream"));
+ } else {
+ if (formatVersion == null) {
+ attrs.add(KeyValue.with("dc:format", formatName));
+ } else {
+ attrs.add(KeyValue.with("dc:format", formatName + ";version=" + formatVersion));
+ }
+ }
+ if (creationDate != null) {
+ attrs.add(KeyValue.with("xmp:CreateDate", creationDate));
+ }
+ if (charsCount != 0) {
+ attrs.add(KeyValue.with("extended-properties:Characters", Long.toString(charsCount)));
+ }
+ if (pagesCount != 0) {
+ attrs.add(KeyValue.with("xmpTPg:NPages", Long.toString(pagesCount)));
+ }
+ if (publisher != null) {
+ attrs.add(KeyValue.with("dc:publisher", publisher));
+ }
+ attrs.add(KeyValue.with("dc:identifier", identifier));
+ if (language != null) {
+ attrs.add(KeyValue.with("dc:language", language));
+ }
+
+ startElement(ident++, "rdf:Description", attrs);
+
+ // DC
+ if (!creators.isEmpty()) {
+ startElement(ident++, "dc:creator");
+ startElement(ident++, "rdf:Seq");
+ for (String creator : creators) {
+ generateElement(ident, "rdf:li", creator);
+ }
+ endElement(--ident, "rdf:Seq");
+ endElement(--ident, "dc:creator");
+ }
+ if (!titles.isEmpty()) {
+ startElement(ident++, "dc:title");
+ startElement(ident++, "rdf:Alt");
+ boolean first = true;
+ for (String title : titles) {
+ if (first) {
+ generateElement(ident, "rdf:li", title.trim(), KeyValue.with("xml:lang", "x-default"));
+ first = false;
+ } else {
+ generateElement(ident, "rdf:li", title);
+ }
+ }
+ endElement(--ident, "rdf:Alt");
+ endElement(--ident, "dc:title");
+ }
+ if (!subjects.isEmpty()) {
+ startElement(ident++, "dc:subject");
+ startElement(ident++, "rdf:Bag");
+ for (String subject : subjects) {
+ generateElement(ident, "rdf:li", subject);
+ }
+ endElement(--ident, "rdf:Bag");
+ endElement(--ident, "dc:subject");
+ }
+
+ // Fonts
+ if (!embeddedFonts.isEmpty() || !refFonts.isEmpty()) {
+ startElement(ident++, "xmpTPg:Fonts");
+ startElement(ident++, "rdf:Bag");
+ for (String font : embeddedFonts) {
+ generateFont(ident, font, true);
+ }
+ for (String font : refFonts) {
+ generateFont(ident, font, false);
+ }
+ endElement(--ident, "rdf:Bag");
+ endElement(--ident, "xmpTPg:Fonts");
+ }
+
+ // Premis:event
+ startElement(ident++, "premis:hasEvent", KeyValue.with("rdf:parseType", "Resource"));
+ generateElement(ident, "premis:hasEventDateTime", generationDate,
+ KeyValue.with("rdf:datatype", "http://www.w3.org/2001/XMLSchema#dateTime"));
+ generateElement(ident, "premis:hasEventType", null,
+ KeyValue.with("rdf:resource", "http://id.loc.gov/vocabulary/preservation/eventType/val"));
+ if (fatalErrors.isEmpty() && errors.isEmpty()) {
+ generateElement(ident, "premis:hasEventDetail", "Well-formed");
+ } else {
+ generateElement(ident, "premis:hasEventDetail", "Not well-formed");
+ }
+ if (fatalErrors.size() + errors.size() + warns.size() + hints.size() != 0) {
+ startElement(ident++, "premis:hasEventOutcomeInformation");
+ startElement(ident++, "rdf:Seq");
+
+ generateEventOutcome(ident, fatalErrors, "FATAL");
+ generateEventOutcome(ident, errors, "ERROR");
+ generateEventOutcome(ident, warns, "WARN");
+ generateEventOutcome(ident, hints, "HINT");
+
+ endElement(--ident, "rdf:Seq");
+ endElement(--ident, "premis:hasEventOutcomeInformation");
+ }
+ startElement(ident++, "premis:hasEventRelatedAgent", KeyValue.with("rdf:parseType", "Resource"));
+ generateElement(ident, "premis:hasAgentType", null,
+ KeyValue.with("rdf:resource", "http://id.loc.gov/vocabulary/preservation/agentType/sof"));
+ if (epubCheckVersion == null) {
+ generateElement(ident, "premis:hasAgentName", epubCheckName);
+ } else {
+ generateElement(ident, "premis:hasAgentName", epubCheckName + " " + epubCheckVersion);
+ }
+ endElement(--ident, "premis:hasEventRelatedAgent");
+
+ endElement(--ident, "premis:hasEvent");
+
+ // Significant properties
+ startElement(ident++, "premis:hasSignificantProperties");
+ startElement(ident++, "rdf:Bag");
+ generateSignificantProperty(ident, "renditionLayout", hasFixedLayout ? "fixed-layout" : "reflowable");
+ generateSignificantProperty(ident, "isScripted", Boolean.toString(hasScripts));
+ generateSignificantProperty(ident, "hasEncryption", Boolean.toString(hasEncryption));
+ generateSignificantProperty(ident, "hasAudio", Boolean.toString(hasAudio));
+ generateSignificantProperty(ident, "hasVideo", Boolean.toString(hasVideo));
+ generateSignificantProperty(ident, "hasSignatures", Boolean.toString(hasSignatures));
+ generateSignificantProperty(ident, "hasAllFontsEmbedded", Boolean.toString(refFonts.isEmpty()));
+ int nRefs = 0;
+ for (String ref : references) {
+ nRefs++;
+ if (nRefs > 50) {
+ generateSignificantProperty(ident, "reference", "" + (references.size() - 50) + " more references");
+ break;
}
+ generateSignificantProperty(ident, "reference", ref);
+ }
+ endElement(--ident, "rdf:Bag");
+ endElement(--ident, "premis:hasSignificantProperties");
+
+ endElement(--ident, "rdf:Description");
+ endElement(--ident, "rdf:RDF");
+ endElement(--ident, "x:xmpmeta");
+
+ returnCode = 0;
+ } catch (Exception e) {
+ System.err.println("Exception encountered: " + e.getMessage());
+ returnCode = 1;
+ }
+ return returnCode;
+ }
+
+ protected void generateFont(int ident, String font, boolean embeded) {
+ // stFnt:fontName, stFnt:fontType, stFnt:versionString, stFnt:composite, stFnt:fontFileName
+ String[] elFont = font.split(",");
+
+ List<KeyValue<String, String>> attrs = new ArrayList<KeyValue<String, String>>();
+ attrs.add(KeyValue.with("stFnt:fontFamily", capitalize(elFont[0])));
+ String fontFace = "";
+ for (int i = 1; i < elFont.length; i++) {
+ fontFace += capitalize(elFont[i]) + " ";
+ }
+ fontFace = fontFace.trim();
+ if (fontFace.length() == 0) {
+ attrs.add(KeyValue.with("stFnt:fontFace", "Regular"));
+ } else {
+ attrs.add(KeyValue.with("stFnt:fontFace", fontFace));
+ }
+ generateElement(ident, "rdf:li", null, attrs);
+ }
+
+ @SuppressWarnings("unchecked")
+ private void generateEventOutcome(int ident, List<CheckMessage> messages, String sev) {
+ for (CheckMessage c : messages) {
+ startElement(ident++, "rdf:li", KeyValue.with("rdf:parseType", "Resource"));
+ generateElement(ident, "premis:hasEventOutcome", c.getID() + ", " + sev + ", " + encodeContent(c.getMessage()));
+ if (c.getLocations().size() != 0) {
startElement(ident++, "premis:hasEventOutcomeDetail");
- generateElement(ident, "premis:hasEventOutcomeDetailNote", PathUtil.removeWorkingDirectory(ml.getFileName()) + loc);
- endElement(--ident, "premis:hasEventOutcomeDetail");
- }
- endElement(--ident, "premis:hasEventOutcomeInformation");
+ startElement(ident++, "rdf:Seq");
+ String previousValue = "";
+ for (EPUBLocation ml : c.getLocations()) {
+ String value = PathUtil.removeWorkingDirectory(ml.getPath());
+ if (ml.getLine() > 0 || ml.getColumn() > 0) {
+ value += " (" + ml.getLine() + "-" + ml.getColumn() + ")";
+ }
+ if (!previousValue.equals(value)) {
+ generateElement(ident, "rdf:li", null,
+ KeyValue.with("premis:hasEventOutcomeDetailNote", value));
+ previousValue = value;
+ }
+ }
+
+ endElement(--ident, "rdf:Seq");
+ endElement(--ident, "premis:hasEventOutcomeDetail");
+ }
+ endElement(--ident, "rdf:li");
}
- }
-
- private void generateSignificantProperty(int ident, String property, String value) {
- // Significant properties
- startElement(ident++, "premis:hasSignificantProperties");
- generateElement(ident, "premis:hasSignificantPropertiesType", property);
- generateElement(ident, "premis:hasSignificantPropertiesValue", value);
- endElement(--ident, "premis:hasSignificantProperties");
-
- }
+ }
+
+ private void generateSignificantProperty(int ident, String property, String value) {
+ // Significant property
+ List<KeyValue<String, String>> attrs = new ArrayList<KeyValue<String, String>>();
+ attrs.add(KeyValue.with("premis:hasSignificantPropertiesType", property));
+ attrs.add(KeyValue.with("premis:hasSignificantPropertiesValue", value));
+
+ generateElement(ident, "rdf:li", null, attrs);
+ }
}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/AltStylesheetVocab.java b/src/main/java/com/adobe/epubcheck/vocab/AltStylesheetVocab.java
index 0a105ae..47ff9a0 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/AltStylesheetVocab.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/AltStylesheetVocab.java
@@ -4,11 +4,15 @@ public final class AltStylesheetVocab
{
public static final String PREFIX = "";
public static final String URI = "";
- public static final Vocab VOCAB = new EnumVocab(PROPERTIES.class, URI, PREFIX);
+ public static final EnumVocab<PROPERTIES> VOCAB = new EnumVocab<PROPERTIES>(PROPERTIES.class,
+ URI, PREFIX);
public static enum PROPERTIES
{
- VERTICAL, HORIZONTAL, DAY, NIGHT;
+ VERTICAL,
+ HORIZONTAL,
+ DAY,
+ NIGHT;
}
private AltStylesheetVocab()
diff --git a/src/main/java/com/adobe/epubcheck/vocab/DCMESVocab.java b/src/main/java/com/adobe/epubcheck/vocab/DCMESVocab.java
new file mode 100644
index 0000000..ded6fb0
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/DCMESVocab.java
@@ -0,0 +1,27 @@
+package com.adobe.epubcheck.vocab;
+
+public class DCMESVocab
+{
+ public static final String URI = "http://purl.org/dc/elements/1.1/";
+ public static final EnumVocab<PROPERTIES> VOCAB = new EnumVocab<PROPERTIES>(PROPERTIES.class, URI, "dc");
+
+ public static enum PROPERTIES
+ {
+
+ CONTRIBUTOR,
+ COVERAGE,
+ CREATOR,
+ DATE,
+ DESCRIPTION,
+ FORMAT,
+ IDENTIFIER,
+ LANGUAGE,
+ PUBLISHER,
+ RELATION,
+ RIGHTS,
+ SOURCE,
+ SUBJECT,
+ TITLE,
+ TYPE;
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/DataNavVocab.java b/src/main/java/com/adobe/epubcheck/vocab/DataNavVocab.java
new file mode 100644
index 0000000..fd08ae9
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/DataNavVocab.java
@@ -0,0 +1,13 @@
+package com.adobe.epubcheck.vocab;
+
+public class DataNavVocab
+{
+ public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
+ public static final EnumVocab<EPUB_TYPES> VOCAB = new EnumVocab<EPUB_TYPES>(EPUB_TYPES.class,
+ URI);
+
+ public static enum EPUB_TYPES
+ {
+ REGION_BASED;
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/DictVocab.java b/src/main/java/com/adobe/epubcheck/vocab/DictVocab.java
new file mode 100644
index 0000000..02ef13a
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/DictVocab.java
@@ -0,0 +1,32 @@
+package com.adobe.epubcheck.vocab;
+
+public class DictVocab
+{
+ public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
+ public static final EnumVocab<EPUB_TYPES> VOCAB = new EnumVocab<EPUB_TYPES>(EPUB_TYPES.class,
+ URI);
+
+ public static enum EPUB_TYPES
+ {
+ ANTONYM_GROUP,
+ CONDENSED_ENTRY,
+ DEF,
+ DICTENTRY,
+ DICTIONARY,
+ ETYMOLOGY,
+ EXAMPLE,
+ GRAM_INFO,
+ IDIOM,
+ PART_OF_SPEECH,
+ PART_OF_SPEECH_GROUP,
+ PART_OF_SPEECH_LIST,
+ PHONETIC_TRANSCRIPTION,
+ PHRASE_GROUP,
+ PHRASE_LIST,
+ SENSE_GROUP,
+ SENSE_LIST,
+ SYNONYM_GROUP,
+ TRAN,
+ TRAN_INFO;
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/EnumVocab.java b/src/main/java/com/adobe/epubcheck/vocab/EnumVocab.java
index e26f2d0..1b584f1 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/EnumVocab.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/EnumVocab.java
@@ -5,6 +5,7 @@ import java.util.Map;
import com.google.common.base.Function;
import com.google.common.base.Optional;
+import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Maps.EntryTransformer;
@@ -25,7 +26,7 @@ import com.google.common.collect.Maps.EntryTransformer;
* @author Romain Deltour
*
*/
-public final class EnumVocab implements Vocab
+public final class EnumVocab<P extends Enum<P>> implements Vocab
{
public final static Function<Enum<?>, String> ENUM_TO_NAME = new Function<Enum<?>, String>()
@@ -33,7 +34,7 @@ public final class EnumVocab implements Vocab
@Override
public String apply(Enum<?> enumee)
{
- return enumee.toString().toLowerCase().replace('_', '-');
+ return enumee.name().toLowerCase().replace('_', '-');
}
};
@@ -50,7 +51,7 @@ public final class EnumVocab implements Vocab
* @param base
* the common stem URI of properties in this vocabulary.
*/
- public <T extends Enum<T>> EnumVocab(final Class<T> clazz, final String base)
+ public EnumVocab(final Class<P> clazz, final String base)
{
this(clazz, base, null);
}
@@ -67,15 +68,15 @@ public final class EnumVocab implements Vocab
* @param prefix
* the common prefix of properties in this vocabulary.
*/
- public <T extends Enum<T>> EnumVocab(final Class<T> clazz, final String base, final String prefix)
+ public EnumVocab(final Class<P> clazz, final String base, final String prefix)
{
this.index = ImmutableMap.copyOf(Maps.transformEntries(
Maps.uniqueIndex(EnumSet.allOf(clazz), ENUM_TO_NAME),
- new EntryTransformer<String, T, Property>()
+ new EntryTransformer<String, P, Property>()
{
@Override
- public Property transformEntry(String name, T enumee)
+ public Property transformEntry(String name, P enumee)
{
return Property.newFrom(name, base, prefix, enumee);
}
@@ -88,4 +89,20 @@ public final class EnumVocab implements Vocab
{
return Optional.fromNullable(index.get(name));
}
+
+ /**
+ * Returns an {@link Optional} containing the {@link Property} for the given
+ * enum item if it is defined in this vocabulary, or {@link Optional#absent()}
+ * otherwise.
+ *
+ * @param property
+ * the property to look up, must not be <code>null</code>
+ * @return the result of looking up <code>property</code> in
+ * <code>vocab</code>.
+ */
+ public Property get(Enum<P> property)
+ {
+ Preconditions.checkNotNull(property);
+ return lookup(EnumVocab.ENUM_TO_NAME.apply(property)).get();
+ }
}
\ No newline at end of file
diff --git a/src/main/java/com/adobe/epubcheck/vocab/EpubCheckVocab.java b/src/main/java/com/adobe/epubcheck/vocab/EpubCheckVocab.java
new file mode 100644
index 0000000..3fb8947
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/EpubCheckVocab.java
@@ -0,0 +1,51 @@
+package com.adobe.epubcheck.vocab;
+
+import java.util.Map;
+
+import com.google.common.collect.ImmutableMap;
+
+/**
+ * A vocabulary used for storing (temporary) info into properties for
+ * EpubCheck's internal use.
+ *
+ */
+public final class EpubCheckVocab
+{
+ public static final String PREFIX = "epubcheck";
+ public static final String URI = "http://www.idpf.org/epubcheck/#";
+ public static final EnumVocab<PROPERTIES> VOCAB = new EnumVocab<PROPERTIES>(PROPERTIES.class, URI,
+ PREFIX);
+ public static final Map<String, Vocab> VOCAB_MAP = ImmutableMap
+ .<String, Vocab> of(EpubCheckVocab.PREFIX, EpubCheckVocab.VOCAB);
+
+ public static enum PROPERTIES
+ {
+ /**
+ * Property of OPF items representing Fixed Layout Content Documents
+ */
+ FIXED_LAYOUT,
+ /**
+ * Property of OPF items referenced in 'index' collections
+ */
+ IN_INDEX_COLLECTION,
+ /**
+ * Property of OCF entries in Multiple Renditions
+ */
+ MULTIPLE_RENDITION,
+ /**
+ * Property of non-linear OPF items
+ */
+ NON_LINEAR,
+ /**
+ * Property used to identify the Rendition Mapping Document in the OCF
+ * checker
+ */
+ RENDITION_MAPPING;
+
+ }
+
+ private EpubCheckVocab()
+ {
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/IndexVocab.java b/src/main/java/com/adobe/epubcheck/vocab/IndexVocab.java
new file mode 100644
index 0000000..72fa686
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/IndexVocab.java
@@ -0,0 +1,26 @@
+package com.adobe.epubcheck.vocab;
+
+public class IndexVocab
+{
+ public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
+ public static final EnumVocab<EPUB_TYPES> VOCAB = new EnumVocab<EPUB_TYPES>(EPUB_TYPES.class, URI);
+
+ public static enum EPUB_TYPES
+ {
+ INDEX,
+ INDEX_EDITOR_NOTE,
+ INDEX_ENTRY,
+ INDEX_ENTRY_LIST,
+ INDEX_GROUP,
+ INDEX_HEADNOTES,
+ INDEX_LEGEND,
+ INDEX_LOCATOR,
+ INDEX_LOCATOR_LIST,
+ INDEX_LOCATOR_RANGE,
+ INDEX_TERM,
+ INDEX_TERM_CATEGORIES,
+ INDEX_TERM_CATEGORY,
+ INDEX_XREF_PREFERRED,
+ INDEX_XREF_RELATED;
+ }
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/MediaOverlaysVocab.java b/src/main/java/com/adobe/epubcheck/vocab/MediaOverlaysVocab.java
index 6f661c3..659f498 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/MediaOverlaysVocab.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/MediaOverlaysVocab.java
@@ -4,7 +4,8 @@ public final class MediaOverlaysVocab
{
public static final String PREFIX = "media";
public static final String URI = "http://www.idpf.org/epub/vocab/overlays/#";
- public static final Vocab VOCAB = new EnumVocab(PROPERTIES.class, URI, PREFIX);
+ public static final EnumVocab<PROPERTIES> VOCAB = new EnumVocab<PROPERTIES>(PROPERTIES.class,
+ URI, PREFIX);
public static enum PROPERTIES
{
diff --git a/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java b/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java
index 3733593..a06728a 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/PackageVocabs.java
@@ -9,7 +9,8 @@ public final class PackageVocabs
public static final String PACKAGE_VOCAB_URI = "http://idpf.org/epub/vocab/package/#";
- public static Vocab META_VOCAB = new EnumVocab(META_PROPERTIES.class, PACKAGE_VOCAB_URI);
+ public static EnumVocab<META_PROPERTIES> META_VOCAB = new EnumVocab<META_PROPERTIES>(
+ META_PROPERTIES.class, PACKAGE_VOCAB_URI);
public static enum META_PROPERTIES
{
@@ -17,24 +18,33 @@ public final class PackageVocabs
BELONGS_TO_COLLECTION,
COLLECTION_TYPE,
DISPLAY_SEQ,
+ DICTIONARY_TYPE, // DICT
FILE_AS,
GROUP_POSITION,
IDENTIFIER_TYPE,
META_AUTH,
ROLE,
+ SOURCE_LANGUAGE, // DICT
SOURCE_OF,
+ TARGET_LANGUAGE, // DICT
TITLE_TYPE
}
- public static Vocab ITEM_VOCAB = new EnumVocab(ITEM_PROPERTIES.class, PACKAGE_VOCAB_URI);
+ public static EnumVocab<ITEM_PROPERTIES> ITEM_VOCAB = new EnumVocab<ITEM_PROPERTIES>(
+ ITEM_PROPERTIES.class, PACKAGE_VOCAB_URI);
public static enum ITEM_PROPERTIES
{
COVER_IMAGE("image/gif", "image/jpeg", "image/png", "image/svg+xml"),
+ DATA_NAV("application/xhtml+xml"),
+ DICTIONARY("application/vnd.epub.search-key-map+xml"),
+ GLOSSARY("application/vnd.epub.search-key-map+xml", "application/xhtml+xml"),
+ INDEX("application/xhtml+xml"),
MATHML("application/xhtml+xml", "image/svg+xml"),
NAV("application/xhtml+xml"),
- REMOTE_RESOURCES("application/xhtml+xml", "image/svg+xml", "text/css"),
+ REMOTE_RESOURCES("application/xhtml+xml", "application/smil+xml", "image/svg+xml", "text/css"),
SCRIPTED("application/xhtml+xml", "image/svg+xml"),
+ SEARCH_KEY_MAP("application/vnd.epub.search-key-map+xml"),
SVG("application/xhtml+xml"),
SWITCH("application/xhtml+xml", "image/svg+xml");
@@ -51,7 +61,8 @@ public final class PackageVocabs
}
}
- public static Vocab ITEMREF_VOCAB = new EnumVocab(ITEMREF_PROPERTIES.class, PACKAGE_VOCAB_URI);
+ public static EnumVocab<ITEMREF_PROPERTIES> ITEMREF_VOCAB = new EnumVocab<ITEMREF_PROPERTIES>(
+ ITEMREF_PROPERTIES.class, PACKAGE_VOCAB_URI);
public static enum ITEMREF_PROPERTIES
{
@@ -61,16 +72,18 @@ public final class PackageVocabs
public static final String LINKREL_VOCAB_URI = "http://idpf.org/epub/vocab/package/link/#";
- public static Vocab LINKREL_VOCAB = new EnumVocab(LINKREL_PROPERTIES.class, LINKREL_VOCAB_URI);
+ public static EnumVocab<LINKREL_PROPERTIES> LINKREL_VOCAB = new EnumVocab<LINKREL_PROPERTIES>(
+ LINKREL_PROPERTIES.class, LINKREL_VOCAB_URI);
public static enum LINKREL_PROPERTIES
{
+ ACQUIRE,
MARC21XML_RECORD,
MODS_RECORD,
ONIX_RECORD,
+ RECORD,
XML_SIGNATURE,
- XMP_RECORD,
- RECORD
+ XMP_RECORD
}
private PackageVocabs()
diff --git a/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java b/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java
index 2f7eb6b..a05c3fa 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java
@@ -11,9 +11,9 @@ import java.util.Map;
import net.sf.saxon.om.Name10Checker;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.google.common.base.CharMatcher;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -62,7 +62,7 @@ public class PrefixDeclarationParser
* the location of attribute in the validated file.
* @return a map of prefixes to URI strings.
*/
- public static Map<String, String> parsePrefixMappings(String value, Report report, MessageLocation location)
+ public static Map<String, String> parsePrefixMappings(String value, Report report, EPUBLocation location)
{
// ---- prefix attribute EBNF ----
// prefixes = mapping , { whitespace, { whitespace } , mapping } ;
diff --git a/src/main/java/com/adobe/epubcheck/vocab/Property.java b/src/main/java/com/adobe/epubcheck/vocab/Property.java
index 460936f..d1e2f2c 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/Property.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/Property.java
@@ -143,4 +143,35 @@ public final class Property
return enumee;
}
+ @Override
+ public String toString()
+ {
+ return "Property [" + prefixedName + "]";
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
+ Property other = (Property) obj;
+ if (fullName == null)
+ {
+ if (other.fullName != null) return false;
+ }
+ else if (!fullName.equals(other.fullName)) return false;
+ return true;
+ }
+
+
}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/RenditionVocabs.java b/src/main/java/com/adobe/epubcheck/vocab/RenditionVocabs.java
index 1659660..88d790e 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/RenditionVocabs.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/RenditionVocabs.java
@@ -5,9 +5,10 @@ public final class RenditionVocabs
public static final String PREFIX = "rendition";
public static final String URI = "http://www.idpf.org/vocab/rendition/#";
- public static final Vocab META_VOCAB = new EnumVocab(META_PROPERTIES.class, URI);
+ public static final EnumVocab<META_PROPERTIES> META_VOCAB = new EnumVocab<META_PROPERTIES>(
+ META_PROPERTIES.class, URI);
- enum META_PROPERTIES
+ public enum META_PROPERTIES
{
FLOW,
LAYOUT,
@@ -16,9 +17,10 @@ public final class RenditionVocabs
VIEWPORT
}
- public static final Vocab ITEMREF_VOCAB = new EnumVocab(ITEMREF_PROPERTIES.class, URI);
+ public static final EnumVocab<ITEMREF_PROPERTIES> ITEMREF_VOCAB = new EnumVocab<ITEMREF_PROPERTIES>(
+ ITEMREF_PROPERTIES.class, URI);
- enum ITEMREF_PROPERTIES
+ public enum ITEMREF_PROPERTIES
{
ALIGN_X_CENTER,
FLOW_AUTO,
diff --git a/src/main/java/com/adobe/epubcheck/vocab/ScriptedCompVocab.java b/src/main/java/com/adobe/epubcheck/vocab/ScriptedCompVocab.java
new file mode 100644
index 0000000..0310c7b
--- /dev/null
+++ b/src/main/java/com/adobe/epubcheck/vocab/ScriptedCompVocab.java
@@ -0,0 +1,22 @@
+package com.adobe.epubcheck.vocab;
+
+public final class ScriptedCompVocab
+{
+ public static final String PREFIX = "epubsc";
+ public static final String URI = "http://idpf.org/epub/vocab/sc/#";
+ public static final EnumVocab<PROPERTIES> VOCAB = new EnumVocab<PROPERTIES>(PROPERTIES.class,
+ URI, PREFIX);
+
+ public static enum PROPERTIES
+ {
+ NETWORK_ACCESS_REQUIRED,
+ REQUIRED_PARAMS,
+ STORAGE_REQUIRED,
+ VERSION;
+ }
+
+ private ScriptedCompVocab()
+ {
+ }
+
+}
diff --git a/src/main/java/com/adobe/epubcheck/vocab/StagingEdupubVocab.java b/src/main/java/com/adobe/epubcheck/vocab/StagingEdupubVocab.java
index fc4335c..be4f258 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/StagingEdupubVocab.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/StagingEdupubVocab.java
@@ -3,7 +3,7 @@ package com.adobe.epubcheck.vocab;
public class StagingEdupubVocab
{
public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
- public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI);
+ public static final EnumVocab<EPUB_TYPES> VOCAB = new EnumVocab<EPUB_TYPES>(EPUB_TYPES.class, URI);
public static enum EPUB_TYPES
{
@@ -12,27 +12,15 @@ public class StagingEdupubVocab
ANSWERS,
ASSESSMENTS,
BIBLIOREF,
+ CASE_STUDY,
CREDIT,
CREDITS,
FEEDBACK,
FILL_IN_THE_BLANK_PROBLEM,
GENERAL_PROBLEM,
GLOSSREF,
- INDEX_EDITOR_NOTE,
- INDEX_ENTRY,
- INDEX_ENTRY_LIST,
- INDEX_GROUP,
- INDEX_HEADNOTES,
- INDEX_LEGEND,
- INDEX_LOCATOR,
- INDEX_LOCATOR_LIST,
- INDEX_LOCATOR_RANGE,
- INDEX_TERM,
- INDEX_TERM_CATEGORIES,
- INDEX_TERM_CATEGORY,
- INDEX_XREF_PREFERRED,
- INDEX_XREF_RELATED,
KEYWORD,
+ KEYWORDS,
LABEL,
LEARNING_OBJECTIVES,
LEARNING_OUTCOME,
diff --git a/src/main/java/com/adobe/epubcheck/vocab/StructureVocab.java b/src/main/java/com/adobe/epubcheck/vocab/StructureVocab.java
index 5df2098..1f9444c 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/StructureVocab.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/StructureVocab.java
@@ -3,7 +3,7 @@ package com.adobe.epubcheck.vocab;
public class StructureVocab
{
public static final String URI = "http://www.idpf.org/epub/vocab/structure/#";
- public static final Vocab VOCAB = new EnumVocab(EPUB_TYPES.class, URI);
+ public static final EnumVocab<EPUB_TYPES> VOCAB = new EnumVocab<EPUB_TYPES>(EPUB_TYPES.class, URI);
public static enum EPUB_TYPES
{
diff --git a/src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java b/src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java
index 6e2fe4f..99ce854 100644
--- a/src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java
+++ b/src/main/java/com/adobe/epubcheck/vocab/VocabUtil.java
@@ -6,9 +6,10 @@ import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.QuietReport;
import com.adobe.epubcheck.api.Report;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.google.common.base.Optional;
import com.google.common.base.Preconditions;
import com.google.common.base.Splitter;
@@ -17,6 +18,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
/**
* Utilities related to property values, vocabularies, and prefix declarations.
@@ -26,7 +28,7 @@ import com.google.common.collect.Maps;
*/
public final class VocabUtil
{
- public static Vocab EMPTY_VOCAB = new EnumVocab(EMPTY.class, "");
+ public static Vocab EMPTY_VOCAB = new EnumVocab<EMPTY>(EMPTY.class, "");
private enum EMPTY
{
@@ -50,7 +52,7 @@ public final class VocabUtil
* successfully or nothing if there was a parsing error
*/
public static Optional<Property> parseProperty(String value, Map<String, Vocab> vocabs,
- Report report, MessageLocation location)
+ Report report, EPUBLocation location)
{
return Optional.fromNullable(Iterables.get(
@@ -71,14 +73,33 @@ public final class VocabUtil
* the location in the validated file.
* @return
*/
- public static Set<Property> parsePropertyList(String value, Map<String, Vocab> vocabs,
- Report report, MessageLocation location)
+ public static Set<Property> parsePropertyList(String value, Map<String, ? extends Vocab> vocabs,
+ Report report, EPUBLocation location)
{
return parseProperties(value, vocabs, true, report, location);
}
- private static Set<Property> parseProperties(String value, Map<String, Vocab> vocabs,
- boolean isList, Report report, MessageLocation location)
+ /**
+ * Parses a space-separated list of property values silently, and returns a
+ * set the properties as a set of Enum values.
+ *
+ * @param properties
+ * the properties string to parse
+ * @param vocabs
+ * a map of prefix to vocabularies.
+ * @param clazz
+ * the class of the Enum holding the returned properties
+ * @return
+ */
+ public static <E extends Enum<E>> Set<E> parsePropertyListAsEnumSet(String properties,
+ Map<String, ? extends Vocab> vocabs, Class<E> clazz)
+ {
+ return Sets.newEnumSet(Property.filter(VocabUtil.parsePropertyList(properties, vocabs,
+ QuietReport.INSTANCE, EPUBLocation.create("")), clazz), clazz);
+ }
+
+ private static Set<Property> parseProperties(String value, Map<String, ? extends Vocab> vocabs,
+ boolean isList, Report report, EPUBLocation location)
{
Preconditions.checkNotNull(vocabs);
Preconditions.checkNotNull(report);
@@ -155,8 +176,8 @@ public final class VocabUtil
* @return
*/
public static Map<String, Vocab> parsePrefixDeclaration(String value,
- Map<String, Vocab> predefined, Map<String, Vocab> known, Set<String> forbidden,
- Report report, MessageLocation location)
+ Map<String, ? extends Vocab> predefined, Map<String, ? extends Vocab> known,
+ Set<String> forbidden, Report report, EPUBLocation location)
{
Map<String, Vocab> vocabs = Maps.newHashMap(predefined);
Map<String, String> mappings = PrefixDeclarationParser.parsePrefixMappings(value, report,
diff --git a/src/main/java/com/adobe/epubcheck/xml/XMLHandler.java b/src/main/java/com/adobe/epubcheck/xml/XMLHandler.java
index 7d03877..bd3ef94 100755
--- a/src/main/java/com/adobe/epubcheck/xml/XMLHandler.java
+++ b/src/main/java/com/adobe/epubcheck/xml/XMLHandler.java
@@ -34,4 +34,5 @@ public interface XMLHandler
public void endElement();
public void processingInstruction(String arg0, String arg1);
+
}
diff --git a/src/main/java/com/adobe/epubcheck/xml/XMLParser.java b/src/main/java/com/adobe/epubcheck/xml/XMLParser.java
index bf1a306..7479abe 100755
--- a/src/main/java/com/adobe/epubcheck/xml/XMLParser.java
+++ b/src/main/java/com/adobe/epubcheck/xml/XMLParser.java
@@ -22,38 +22,58 @@
package com.adobe.epubcheck.xml;
-import com.adobe.epubcheck.api.Report;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
-import com.adobe.epubcheck.ocf.OCFPackage;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.ResourceUtil;
-import com.thaiopensource.util.PropertyMapBuilder;
-import com.thaiopensource.validate.ValidateProperty;
-import com.thaiopensource.validate.Validator;
+import java.io.BufferedInputStream;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
-import org.xml.sax.*;
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.DTDHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.Locator;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXNotRecognizedException;
+import org.xml.sax.SAXNotSupportedException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.XMLReader;
import org.xml.sax.ext.DeclHandler;
import org.xml.sax.ext.LexicalHandler;
import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.AttributesImpl;
import org.xml.sax.helpers.DefaultHandler;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import java.io.*;
-import java.util.*;
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.ResourceUtil;
+import com.google.common.io.Closer;
+import com.thaiopensource.util.PropertyMapBuilder;
+import com.thaiopensource.validate.ValidateProperty;
+import com.thaiopensource.validate.Validator;
public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHandler
{
private static final String SAXPROP_LEXICAL_HANDLER = "http://xml.org/sax/properties/lexical-handler";
private static final String SAXPROP_DECL_HANDLER = "http://xml.org/sax/properties/declaration-handler";
private SAXParser parser;
+ private final ValidationContext context;
private final Report report;
- private final String resource;
- private final InputStream resourceIn;
+ private final String path;
private final Vector<XMLHandler> contentHandlers = new Vector<XMLHandler>();
private XMLElement currentElement;
private final Vector<ContentHandler> validatorContentHandlers = new Vector<ContentHandler>();
@@ -61,23 +81,16 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
private final Vector<LexicalHandler> validatorLexicalHandlers = new Vector<LexicalHandler>();
private final Vector<DeclHandler> validatorDeclHandlers = new Vector<DeclHandler>();
private Locator2 documentLocator;
- private final EPUBVersion version;
private static final String zipRoot = "file:///epub-root/";
private static final Hashtable<String, String> systemIdMap;
private final HashSet<String> entities = new HashSet<String>();
- private final String mimeType;
private boolean firstStartDTDInvocation = true;
- private OCFPackage thePackage;
- public XMLParser(OCFPackage thePackage, InputStream resourceIn, String entryName, String mimeType,
- Report report, EPUBVersion version)
+ public XMLParser(ValidationContext context)
{
- this.report = report;
- this.resource = entryName;
- this.resourceIn = resourceIn;
- this.mimeType = mimeType;
- this.version = version;
- this.thePackage = thePackage;
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
// XML predefined
entities.add("gt");
@@ -93,12 +106,11 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
try
{
factory.setFeature("http://xml.org/sax/features/validation", false);
- if (version == EPUBVersion.VERSION_3)
+ if (context.version == EPUBVersion.VERSION_3)
{
factory.setXIncludeAware(false);
}
- }
- catch (Exception ignored)
+ } catch (Exception ignored)
{
}
@@ -116,27 +128,22 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
{
reader.setProperty(SAXPROP_LEXICAL_HANDLER, this);
reader.setProperty(SAXPROP_DECL_HANDLER, this);
- }
- catch (SAXNotRecognizedException e)
+ } catch (SAXNotRecognizedException e)
{
e.printStackTrace();
- }
- catch (SAXNotSupportedException e)
+ } catch (SAXNotSupportedException e)
{
e.printStackTrace();
}
- }
- catch (ParserConfigurationException e)
+ } catch (ParserConfigurationException e)
{
e.printStackTrace();
- }
- catch (SAXException e)
+ } catch (SAXException e)
{
e.printStackTrace();
}
}
-
public void addXMLHandler(XMLHandler handler)
{
if (handler != null)
@@ -149,8 +156,7 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
{
PropertyMapBuilder propertyMapBuilder = new PropertyMapBuilder();
propertyMapBuilder.put(ValidateProperty.ERROR_HANDLER, this);
- Validator validator = xv.schema.createValidator(propertyMapBuilder
- .toPropertyMap());
+ Validator validator = xv.schema.createValidator(propertyMapBuilder.toPropertyMap());
ContentHandler contentHandler = validator.getContentHandler();
if (contentHandler != null)
{
@@ -179,31 +185,43 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
}
}
-
public void process()
{
- InputStream in = resourceIn;
try
{
- //System.err.println("DEBUG XMLParser#process on" + resource);
- if (!in.markSupported())
+ Closer closer = Closer.create();
+ try
{
- in = new BufferedInputStream(in);
- }
+ InputStream in = closer.register(context.resourceProvider.getInputStream(path));
+ // System.err.println("DEBUG XMLParser#process on" + resource);
+ if (!in.markSupported())
+ {
+ in = new BufferedInputStream(in);
+ }
- String encoding = sniffEncoding(in);
- if (encoding != null && !encoding.equals("UTF-8")
- && !encoding.equals("UTF-16"))
- {
- report.message(MessageId.CSS_003, new MessageLocation(resource, 0, 0, ""), encoding);
- }
+ String encoding = sniffEncoding(in);
+ if (encoding != null && !encoding.equals("UTF-8") && !encoding.equals("UTF-16"))
+ {
+ report.message(MessageId.CSS_003, EPUBLocation.create(path, ""), encoding);
+ }
- InputSource ins = new InputSource(in);
- ins.setSystemId(zipRoot + resource);
- parser.parse(ins, this);
+ InputSource ins = new InputSource(in);
+ ins.setSystemId(zipRoot + path);
+ parser.parse(ins, this);
- }
- catch (FileNotFoundException e)
+ } catch (Throwable e)
+ {
+ // ensure that any checked exception types other than IOException that
+ // could be thrown are
+ // provided here, e.g. throw closer.rethrow(e,
+ // CheckedException.class);
+ // throw closer.rethrow(e);
+ throw closer.rethrow(e, SAXException.class);
+ } finally
+ {
+ closer.close();
+ }
+ } catch (FileNotFoundException e)
{
String message = e.getMessage();
message = new File(message).getName();
@@ -213,54 +231,37 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
message = message.substring(0, message.indexOf("("));
}
message = message.trim();
- report.message(MessageId.RSC_001, new MessageLocation(resource, -1, -1), message);
- }
- catch (IOException e)
+ report.message(MessageId.RSC_001, EPUBLocation.create(path), message);
+ } catch (IOException e)
{
- report.message(MessageId.PKG_008, new MessageLocation(resource, 0, 0), resource);
- }
- catch (IllegalArgumentException e)
- {
- report.message(MessageId.RSC_005, new MessageLocation(resource, 0, 0), e.getMessage());
- }
- catch (SAXException e)
+ report.message(MessageId.PKG_008, EPUBLocation.create(path), path);
+ } catch (IllegalArgumentException e)
{
- report.message(MessageId.RSC_005, new MessageLocation(resource, 0, 0), e.getMessage());
- }
- catch (NullPointerException e)
+ report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());
+ } catch (SAXException e)
{
- // this happens for unresolved entities, reported in entityResolver
- // code.
- }
- finally
- {
- try
- {
- in.close();
- }
- catch (IOException ignored)
- {
- }
+ report.message(MessageId.RSC_005, EPUBLocation.create(path), e.getMessage());
}
}
public InputSource resolveEntity(String publicId, String systemId)
- throws
- SAXException,
- IOException
+ throws SAXException,
+ IOException
{
- //if (systemId.startsWith(zipRoot))
- //{
- // InputStream inStream = this.thePackage.getInputStream(systemId.substring(zipRoot.length()));
- // if (inStream != null)
- // {
- // InputSource source = new InputSource(inStream);
- // source.setPublicId(publicId);
- // source.setSystemId(systemId);
- // return source;
- // }
- //}
- //outWriter.println("DEBUG XMLParser#resolveEntity ==> "+ publicId + ", " + systemId + ", " );
+ // if (systemId.startsWith(zipRoot))
+ // {
+ // InputStream inStream =
+ // this.thePackage.getInputStream(systemId.substring(zipRoot.length()));
+ // if (inStream != null)
+ // {
+ // InputSource source = new InputSource(inStream);
+ // source.setPublicId(publicId);
+ // source.setSystemId(systemId);
+ // return source;
+ // }
+ // }
+ // outWriter.println("DEBUG XMLParser#resolveEntity ==> "+ publicId + ", " +
+ // systemId + ", " );
String resourcePath = systemIdMap.get(systemId);
@@ -274,41 +275,38 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
}
else if (systemId.equals("about:legacy-compat"))
{
- //special case
+ // special case
return new InputSource(new StringReader(""));
}
else
{
- //check for a system prop that turns off online fetching
- //the default is to attempt online fetching, as this has been the default forever
+ // check for a system prop that turns off online fetching
+ // the default is to attempt online fetching, as this has been the default
+ // forever
boolean offline = Boolean.parseBoolean(System.getProperty("epubcheck.offline"));
- //outWriter.println("offline value is " + offline);
+ // outWriter.println("offline value is " + offline);
if (systemId.startsWith("http:") && offline)
{
return new InputSource(new StringReader(""));
}
- //else return null and let the caller try to fetch the goods
+ // else return null and let the caller try to fetch the goods
return null;
}
}
-
public void notationDecl(String name, String publicId, String systemId)
- throws
- SAXException
+ throws SAXException
{
int len = validatorDTDHandlers.size();
for (int i = 0; i < len; i++)
{
- (validatorDTDHandlers.elementAt(i)).notationDecl(name,
- publicId, systemId);
+ (validatorDTDHandlers.elementAt(i)).notationDecl(name, publicId, systemId);
}
}
- public void unparsedEntityDecl(String name, String publicId,
- String systemId, String notationName) throws
- SAXException
+ public void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
+ throws SAXException
{
int len = validatorDTDHandlers.size();
for (int i = 0; i < len; i++)
@@ -318,68 +316,70 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
}
}
- public void error(SAXParseException ex) throws
- SAXException
+ public void error(SAXParseException ex)
+ throws SAXException
{
- report.message(MessageId.RSC_005,
- new MessageLocation(resource, ex.getLineNumber(), ex.getColumnNumber()),
- ex.getMessage());
+ String message = ex.getMessage().trim();
+ if (message != null && message.startsWith("WARNING:"))
+ {
+ report.message(MessageId.RSC_017,
+ EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()),
+ message.substring(9, message.length()));
+ }
+ else
+ {
+ report.message(MessageId.RSC_005,
+ EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), message);
+ }
}
- public void fatalError(SAXParseException ex) throws
- SAXException
+ public void fatalError(SAXParseException ex)
+ throws SAXException
{
report.message(MessageId.RSC_016,
- new MessageLocation(resource, ex.getLineNumber(), ex.getColumnNumber()),
- ex.getMessage());
+ EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), ex.getMessage());
}
- public void warning(SAXParseException ex) throws
- SAXException
+ public void warning(SAXParseException ex)
+ throws SAXException
{
report.message(MessageId.RSC_017,
- new MessageLocation(resource, ex.getLineNumber(), ex.getColumnNumber()),
- ex.getMessage());
+ EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), ex.getMessage());
}
- public void characters(char[] arg0, int arg1, int arg2) throws
- SAXException
+ public void characters(char[] arg0, int arg1, int arg2)
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .characters(arg0, arg1, arg2);
+ (validatorContentHandlers.elementAt(i)).characters(arg0, arg1, arg2);
}
int len = contentHandlers.size();
for (int i = 0; i < len; i++)
{
- (contentHandlers.elementAt(i)).characters(arg0, arg1,
- arg2);
+ (contentHandlers.elementAt(i)).characters(arg0, arg1, arg2);
}
}
- public void endDocument() throws
- SAXException
+ public void endDocument()
+ throws SAXException
{
int len = validatorContentHandlers.size();
for (int i = 0; i < len; i++)
{
- (validatorContentHandlers.elementAt(i))
- .endDocument();
+ (validatorContentHandlers.elementAt(i)).endDocument();
}
}
public void endElement(String arg0, String arg1, String arg2)
- throws
- SAXException
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .endElement(arg0, arg1, arg2);
+ (validatorContentHandlers.elementAt(i)).endElement(arg0, arg1, arg2);
}
int len = contentHandlers.size();
for (int i = 0; i < len; i++)
@@ -389,50 +389,43 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
currentElement = currentElement.getParent();
}
- public void endPrefixMapping(String arg0) throws
- SAXException
+ public void endPrefixMapping(String arg0)
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .endPrefixMapping(arg0);
+ (validatorContentHandlers.elementAt(i)).endPrefixMapping(arg0);
}
}
public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
- throws
- SAXException
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .ignorableWhitespace(arg0, arg1, arg2);
+ (validatorContentHandlers.elementAt(i)).ignorableWhitespace(arg0, arg1, arg2);
}
int len = contentHandlers.size();
for (int i = 0; i < len; i++)
{
- (contentHandlers.elementAt(i)).ignorableWhitespace(
- arg0, arg1, arg2);
+ (contentHandlers.elementAt(i)).ignorableWhitespace(arg0, arg1, arg2);
}
}
public void processingInstruction(String arg0, String arg1)
- throws
- SAXException
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .processingInstruction(arg0, arg1);
+ (validatorContentHandlers.elementAt(i)).processingInstruction(arg0, arg1);
}
int len = contentHandlers.size();
for (int i = 0; i < len; i++)
{
- (contentHandlers.elementAt(i)).processingInstruction(
- arg0, arg1);
+ (contentHandlers.elementAt(i)).processingInstruction(arg0, arg1);
}
}
@@ -441,43 +434,39 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .setDocumentLocator(locator);
+ (validatorContentHandlers.elementAt(i)).setDocumentLocator(locator);
}
documentLocator = new DocumentLocatorImpl(locator);
}
- public void skippedEntity(String arg0) throws
- SAXException
+ public void skippedEntity(String arg0)
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .skippedEntity(arg0);
+ (validatorContentHandlers.elementAt(i)).skippedEntity(arg0);
}
}
- public void startDocument() throws
- SAXException
+ public void startDocument()
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .startDocument();
+ (validatorContentHandlers.elementAt(i)).startDocument();
}
}
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts) throws
- SAXException
+ public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
+ throws SAXException
{
AttributesImpl attribs = new AttributesImpl(atts);
- if (mimeType.equals("application/xhtml+xml")
- && version == EPUBVersion.VERSION_3)
+ if ("application/xhtml+xml".equals(context.mimeType)
+ && context.version == EPUBVersion.VERSION_3)
{
try
{
@@ -488,29 +477,28 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
if (attribs.getLocalName(i).startsWith("data-"))
{
removals.add(attribs.getQName(i));
- } else if(isCustomNamespaceAttr(attribs.getURI(i))) {
- removals.add(attribs.getQName(i));
+ }
+ else if (isCustomNamespaceAttr(attribs.getURI(i)))
+ {
+ removals.add(attribs.getQName(i));
}
}
for (String remove : removals)
{
int rmv = attribs.getIndex(remove);
- //System.out.println("removing attribute " + attribs.getQName(rmv));
+ // System.out.println("removing attribute " + attribs.getQName(rmv));
attribs.removeAttribute(rmv);
}
- }
- catch (Exception e)
+ } catch (Exception e)
{
- System.err.println("data-* removal exception: "
- + e.getMessage());
+ System.err.println("data-* removal exception: " + e.getMessage());
}
}
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .startElement(namespaceURI, localName, qName, attribs);
+ (validatorContentHandlers.elementAt(i)).startElement(namespaceURI, localName, qName, attribs);
}
int index = qName.indexOf(':');
String prefix;
@@ -545,61 +533,61 @@ public class XMLParser extends DefaultHandler implements LexicalHandler, DeclHan
}
String attValue = attribs.getValue(i);
assert attributes != null;
- attributes[i] = new XMLAttribute(attNamespace, attPrefix, attName,
- attValue);
+ attributes[i] = new XMLAttribute(attNamespace, attPrefix, attName, attValue);
}
- currentElement = new XMLElement(namespaceURI, prefix, name, attributes,
- currentElement);
+ currentElement = new XMLElement(namespaceURI, prefix, name, attributes, currentElement);
int len = contentHandlers.size();
for (int i = 0; i < len; i++)
{
(contentHandlers.elementAt(i)).startElement();
}
}
-
- //3.0.1 custom attributes handling
+
+ // 3.0.1 custom attributes handling
private static final Set<String> knownXHTMLContentDocsNamespaces = new HashSet<String>();
- static {
- knownXHTMLContentDocsNamespaces.add(Namespaces.MATHML);
- knownXHTMLContentDocsNamespaces.add(Namespaces.OPS);
- knownXHTMLContentDocsNamespaces.add(Namespaces.SSML);
- knownXHTMLContentDocsNamespaces.add(Namespaces.SVG);
- knownXHTMLContentDocsNamespaces.add(Namespaces.XHTML);
- knownXHTMLContentDocsNamespaces.add(Namespaces.XMLEVENTS);
- knownXHTMLContentDocsNamespaces.add(Namespaces.XML);
- knownXHTMLContentDocsNamespaces.add(Namespaces.XLINK);
- }
- private boolean isCustomNamespaceAttr(String nsuri) {
-
-
- if(nsuri == null || nsuri.trim().length() == 0) {
- return false;
- }
-
- for(String ns : knownXHTMLContentDocsNamespaces) {
- if(ns.equals(nsuri)) {
- return false;
- }
- }
-
- return true;
+ static
+ {
+ knownXHTMLContentDocsNamespaces.add(Namespaces.MATHML);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.OPS);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.SSML);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.SVG);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.XHTML);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.XMLEVENTS);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.XML);
+ knownXHTMLContentDocsNamespaces.add(Namespaces.XLINK);
}
+ private boolean isCustomNamespaceAttr(String nsuri)
+ {
+
+ if (nsuri == null || nsuri.trim().length() == 0)
+ {
+ return false;
+ }
-public void startPrefixMapping(String arg0, String arg1)
- throws
- SAXException
+ for (String ns : knownXHTMLContentDocsNamespaces)
+ {
+ if (ns.equals(nsuri))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public void startPrefixMapping(String arg0, String arg1)
+ throws SAXException
{
int vlen = validatorContentHandlers.size();
for (int i = 0; i < vlen; i++)
{
- (validatorContentHandlers.elementAt(i))
- .startPrefixMapping(arg0, arg1);
+ (validatorContentHandlers.elementAt(i)).startPrefixMapping(arg0, arg1);
}
}
- public void comment(char[] text, int arg1, int arg2) throws
- SAXException
+ public void comment(char[] text, int arg1, int arg2)
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -610,8 +598,8 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- public void endCDATA() throws
- SAXException
+ public void endCDATA()
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -622,8 +610,8 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- public void endDTD() throws
- SAXException
+ public void endDTD()
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -634,8 +622,8 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- public void endEntity(String ent) throws
- SAXException
+ public void endEntity(String ent)
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -646,8 +634,8 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- public void startCDATA() throws
- SAXException
+ public void startCDATA()
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -659,8 +647,7 @@ public void startPrefixMapping(String arg0, String arg1)
}
public void startDTD(String root, String publicId, String systemId)
- throws
- SAXException
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -675,22 +662,24 @@ public void startPrefixMapping(String arg0, String arg1)
private void handleDocTypeUserInfo(String root, String publicId, String systemId)
{
- //outWriter.println("DEBUG doctype ==> "+ root + ", " + publicId + ", " + systemId + ", " );
+ final String mimeType = context.mimeType;
+ // outWriter.println("DEBUG doctype ==> "+ root + ", " + publicId + ", " +
+ // systemId + ", " );
- //for modular DTDs etc, just issue a warning for the top level IDs.
+ // for modular DTDs etc, just issue a warning for the top level IDs.
if (!firstStartDTDInvocation)
{
return;
}
- if (version == EPUBVersion.VERSION_2)
+ if (context.version == EPUBVersion.VERSION_2)
{
if (mimeType != null && "application/xhtml+xml".equals(mimeType) && root.equals("html"))
{
- //OPS 2.0(.1)
- String complete = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n" +
- "\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">";
+ // OPS 2.0(.1)
+ String complete = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n"
+ + "\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">";
if (matchDoctypeId("-//W3C//DTD XHTML 1.1//EN", publicId, complete))
{
@@ -702,26 +691,30 @@ public void startPrefixMapping(String arg0, String arg1)
if (mimeType != null && "opf".equals(mimeType) && (publicId != null || systemId != null))
{
- //1.2: <!DOCTYPE package PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN" "http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd">
- //http://http://idpf.org/dtds/oeb-1.2/oebpkg12.dtd
+ // 1.2: <!DOCTYPE package PUBLIC
+ // "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"
+ // "http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd">
+ // http://http://idpf.org/dtds/oeb-1.2/oebpkg12.dtd
if ("package".equals(root)
- && (publicId == null || publicId.equals("+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"))
- && (systemId == null || systemId.equals("http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd"))
- )
+ && (publicId == null || publicId
+ .equals("+//ISBN 0-9673008-1-9//DTD OEB 1.2 Package//EN"))
+ && (systemId == null || systemId
+ .equals("http://openebook.org/dtds/oeb-1.2/oebpkg12.dtd")))
{
- //for heritage content collections, dont warn about this, as its not explicitly forbidden by the spec
+ // for heritage content collections, dont warn about this, as its not
+ // explicitly forbidden by the spec
}
else
{
- report.message(MessageId.HTM_009, new MessageLocation(resource, 0, 0));
+ report.message(MessageId.HTM_009, EPUBLocation.create(path));
}
}
if (mimeType != null && "application/x-dtbncx+xml".equals(mimeType))
{
- String complete = "<!DOCTYPE ncx PUBLIC \"-//NISO//DTD ncx 2005-1//EN\" " +
- "\n \"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd\">";
+ String complete = "<!DOCTYPE ncx PUBLIC \"-//NISO//DTD ncx 2005-1//EN\" "
+ + "\n \"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd\">";
if (matchDoctypeId("-//NISO//DTD ncx 2005-1//EN", publicId, complete))
{
matchDoctypeId("http://www.daisy.org/z3986/2005/ncx-2005-1.dtd", systemId, complete);
@@ -729,55 +722,39 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- else if (version == EPUBVersion.VERSION_3)
+ else if (context.version == EPUBVersion.VERSION_3)
{
- if (mimeType != null && "application/xhtml+xml".equals(mimeType) && "html".equalsIgnoreCase(root))
+ if (mimeType != null && "application/xhtml+xml".equals(mimeType)
+ && "html".equalsIgnoreCase(root))
{
String complete = "<!DOCTYPE html>";
- //warn for obsolete or unknown doctypes
+ // warn for obsolete or unknown doctypes
if (publicId == null && (systemId == null || systemId.equals("about:legacy-compat")))
{
- // we assume to have have <!DOCTYPE html> or <!DOCTYPE html SYSTEM "about:legacy-compat">
+ // we assume to have have <!DOCTYPE html> or <!DOCTYPE html SYSTEM
+ // "about:legacy-compat">
}
else
{
- report.message(MessageId.HTM_004, new MessageLocation(resource, 0, 0), publicId, complete);
+ report.message(MessageId.HTM_004, EPUBLocation.create(path), publicId, complete);
}
}
- else if ("image/svg+xml".equals(mimeType) && "svg".equalsIgnoreCase(root))
+ else if (publicId != null || systemId != null)
{
- if (
- !(checkDTD("-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd", publicId, systemId) ||
- checkDTD("-//W3C//DTD SVG 1.0//EN", "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd", publicId, systemId) ||
- checkDTD("-//W3C//DTD SVG 1.1 Basic//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-basic.dtd", publicId, systemId) ||
- checkDTD("-//W3C//DTD SVG 1.1 Tiny//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd", publicId, systemId))
- )
- {
- report.message(MessageId.HTM_009, new MessageLocation(resource, 0, 0));
- }
- }
- else if (mimeType != null && "application/x-dtbncx+xml".equals(mimeType))
- {
- String complete = "<!DOCTYPE ncx PUBLIC \"-//NISO//DTD ncx 2005-1//EN\" " +
- "\n \"http://www.daisy.org/z3986/2005/ncx-2005-1.dtd\">";
- if (matchDoctypeId("-//NISO//DTD ncx 2005-1//EN", publicId, complete))
- {
- matchDoctypeId("http://www.daisy.org/z3986/2005/ncx-2005-1.dtd", systemId, complete);
- }
- }
- else
- {
- report.message(MessageId.HTM_009, new MessageLocation(resource, 0, 0));
+ report.message(MessageId.OPF_073, getLocation());
}
}
firstStartDTDInvocation = false;
}
- boolean checkDTD(String expectedPublicId, String expectedSystemId, String actualPublicId, String actualSystemId)
+ boolean checkDTD(String expectedPublicId, String expectedSystemId, String actualPublicId,
+ String actualSystemId)
{
- if ((actualPublicId == null || (actualPublicId != null && expectedPublicId.equalsIgnoreCase(actualPublicId))) &&
- (actualSystemId == null || (actualSystemId != null && expectedSystemId.equalsIgnoreCase(actualSystemId))))
+ if ((actualPublicId == null || (actualPublicId != null && expectedPublicId
+ .equalsIgnoreCase(actualPublicId)))
+ && (actualSystemId == null || (actualSystemId != null && expectedSystemId
+ .equalsIgnoreCase(actualSystemId))))
{
return true;
}
@@ -788,14 +765,14 @@ public void startPrefixMapping(String arg0, String arg1)
{
if (given != null && !expected.equals(given))
{
- report.message(MessageId.HTM_004, new MessageLocation(resource, 0, 0), given, messageParam);
+ report.message(MessageId.HTM_004, EPUBLocation.create(path), given, messageParam);
return false;
}
return true;
}
- public void startEntity(String ent) throws
- SAXException
+ public void startEntity(String ent)
+ throws SAXException
{
if (validatorLexicalHandlers.size() > 0)
{
@@ -806,14 +783,15 @@ public void startPrefixMapping(String arg0, String arg1)
}
if (!entities.contains(ent) && !ent.equals("[dtd]"))
{
- // This message may never be reported. Undeclared entities result in a Sax Parser Error and message RSC_005.
- report.message(MessageId.HTM_011, new MessageLocation(resource, getLineNumber(), getColumnNumber(), ent));
+ // This message may never be reported. Undeclared entities result in a Sax
+ // Parser Error and message RSC_005.
+ report.message(MessageId.HTM_011,
+ EPUBLocation.create(path, getLineNumber(), getColumnNumber(), ent));
}
}
- public void attributeDecl(String name, String name2, String type,
- String mode, String value) throws
- SAXException
+ public void attributeDecl(String name, String name2, String type, String mode, String value)
+ throws SAXException
{
if (validatorDeclHandlers.size() > 0)
{
@@ -824,8 +802,8 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- public void elementDecl(String name, String model) throws
- SAXException
+ public void elementDecl(String name, String model)
+ throws SAXException
{
if (validatorDeclHandlers.size() > 0)
{
@@ -837,8 +815,7 @@ public void startPrefixMapping(String arg0, String arg1)
}
public void externalEntityDecl(String name, String publicId, String systemId)
- throws
- SAXException
+ throws SAXException
{
if (validatorDeclHandlers.size() > 0)
{
@@ -848,17 +825,17 @@ public void startPrefixMapping(String arg0, String arg1)
}
}
- if (version == EPUBVersion.VERSION_3 && (mimeType.compareTo("application/xhtml+xml") == 0))
+ if (context.version == EPUBVersion.VERSION_3)
{
- report.message(MessageId.HTM_003, new MessageLocation(resource, getLineNumber(), getColumnNumber(), name), name);
+ report.message(MessageId.HTM_003,
+ EPUBLocation.create(path, getLineNumber(), getColumnNumber(), name), name);
return;
}
entities.add(name);
}
public void internalEntityDecl(String name, String value)
- throws
- SAXException
+ throws SAXException
{
if (validatorDeclHandlers.size() > 0)
{
@@ -890,6 +867,12 @@ public void startPrefixMapping(String arg0, String arg1)
return documentLocator.getColumnNumber();
}
+ public EPUBLocation getLocation()
+ {
+ return EPUBLocation.create(path, documentLocator.getLineNumber(),
+ documentLocator.getColumnNumber());
+ }
+
public String getXMLVersion()
{
return documentLocator.getXMLVersion();
@@ -897,22 +880,20 @@ public void startPrefixMapping(String arg0, String arg1)
public String getResourceName()
{
- return resource;
+ return path;
}
- private static final byte[][] utf16magic = {{(byte) 0xFE, (byte) 0xFF},
- {(byte) 0xFF, (byte) 0xFE}, {0, 0x3C, 0, 0x3F},
- {0x3C, 0, 0x3F, 0}};
+ private static final byte[][] utf16magic = { { (byte) 0xFE, (byte) 0xFF },
+ { (byte) 0xFF, (byte) 0xFE }, { 0, 0x3C, 0, 0x3F }, { 0x3C, 0, 0x3F, 0 } };
- private static final byte[][] ucs4magic = {{0, 0, (byte) 0xFE, (byte) 0xFF},
- {(byte) 0xFF, (byte) 0xFE, 0, 0},
- {0, 0, (byte) 0xFF, (byte) 0xFE},
- {(byte) 0xFE, (byte) 0xFF, 0, 0}, {0, 0, 0, 0x3C},
- {0, 0, 0x3C, 0}, {0, 0x3C, 0, 0}, {0x3C, 0, 0, 0}};
+ private static final byte[][] ucs4magic = { { 0, 0, (byte) 0xFE, (byte) 0xFF },
+ { (byte) 0xFF, (byte) 0xFE, 0, 0 }, { 0, 0, (byte) 0xFF, (byte) 0xFE },
+ { (byte) 0xFE, (byte) 0xFF, 0, 0 }, { 0, 0, 0, 0x3C }, { 0, 0, 0x3C, 0 }, { 0, 0x3C, 0, 0 },
+ { 0x3C, 0, 0, 0 } };
- private static final byte[] utf8magic = {(byte) 0xEF, (byte) 0xBB, (byte) 0xBF};
+ private static final byte[] utf8magic = { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF };
- private static final byte[] ebcdicmagic = {0x4C, 0x6F, (byte) 0xA7, (byte) 0x94};
+ private static final byte[] ebcdicmagic = { 0x4C, 0x6F, (byte) 0xA7, (byte) 0x94 };
private static boolean matchesMagic(byte[] magic, byte[] buffer)
{
@@ -926,8 +907,8 @@ public void startPrefixMapping(String arg0, String arg1)
return true;
}
- private static String sniffEncoding(InputStream in) throws
- IOException
+ private static String sniffEncoding(InputStream in)
+ throws IOException
{
// see http://www.w3.org/TR/REC-xml/#sec-guessing
byte[] buffer = new byte[256];
@@ -1014,11 +995,13 @@ public void startPrefixMapping(String arg0, String arg1)
ResourceUtil.getResourcePath("schema/20/dtd/oebpkg12.dtd"));
map.put("http://openebook.org/dtds/oeb-1.2/oeb12.ent",
ResourceUtil.getResourcePath("schema/20/dtd/oeb12.dtdinc"));
+ map.put("http://openebook.org/dtds/oeb-1.2/oebdoc12.dtd",
+ ResourceUtil.getResourcePath("schema/20/dtd/oebdoc12.dtd"));
- //2.0 dtd, probably never published
+ // 2.0 dtd, probably never published
map.put("http://www.idpf.org/dtds/2007/opf.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/opf20.dtd"));
- //xhtml 1.1
+ // xhtml 1.1
map.put("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/xhtml1-transitional.dtd"));
map.put("http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd",
@@ -1029,17 +1012,17 @@ public void startPrefixMapping(String arg0, String arg1)
ResourceUtil.getResourcePath("schema/20/dtd/xhtml-symbol.dtdinc"));
map.put("http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent",
ResourceUtil.getResourcePath("schema/20/dtd/xhtml-special.dtdinc"));
- //svg 1.1
+ // svg 1.1
map.put("http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/svg11.dtd"));
- //dtbook
+ // dtbook
map.put("http://www.daisy.org/z3986/2005/dtbook-2005-2.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/dtbook-2005-2.dtd"));
- //ncx
+ // ncx
map.put("http://www.daisy.org/z3986/2005/ncx-2005-1.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/ncx-2005-1.dtd"));
- //xhtml 1.1: just reference the character entities, as we validate with rng
+ // xhtml 1.1: just reference the character entities, as we validate with rng
map.put("http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd",
ResourceUtil.getResourcePath("schema/20/dtd/xhtml11-ent.dtd"));
map.put("http://www.w3.org/MarkUp/DTD/xhtml11.dtd",
@@ -1047,12 +1030,9 @@ public void startPrefixMapping(String arg0, String arg1)
// non-resolved names; Saxon (which schematron requires and registers as
// preferred parser, it seems) passes us those (bad, bad!), work around it
- map.put("xhtml-lat1.ent",
- ResourceUtil.getResourcePath("dtd/xhtml-lat1.dtdinc"));
- map.put("xhtml-symbol.ent",
- ResourceUtil.getResourcePath("dtd/xhtml-symbol.dtdinc"));
- map.put("xhtml-special.ent",
- ResourceUtil.getResourcePath("dtd/xhtml-special.dtdinc"));
+ map.put("xhtml-lat1.ent", ResourceUtil.getResourcePath("dtd/xhtml-lat1.dtdinc"));
+ map.put("xhtml-symbol.ent", ResourceUtil.getResourcePath("dtd/xhtml-symbol.dtdinc"));
+ map.put("xhtml-special.ent", ResourceUtil.getResourcePath("dtd/xhtml-special.dtdinc"));
systemIdMap = map;
}
}
diff --git a/src/main/java/com/adobe/epubcheck/xml/XMLValidators.java b/src/main/java/com/adobe/epubcheck/xml/XMLValidators.java
index 97c74a1..064855b 100644
--- a/src/main/java/com/adobe/epubcheck/xml/XMLValidators.java
+++ b/src/main/java/com/adobe/epubcheck/xml/XMLValidators.java
@@ -4,10 +4,14 @@ public enum XMLValidators
{
CONTAINER_20_RNG("schema/20/rng/container.rng"),
CONTAINER_30_RNC("schema/30/ocf-container-30.rnc"),
+ CONTAINER_30_RENDITIONS_SCH("schema/30/multiple-renditions/container.sch"),
DTBOOK_RNG("schema/20/rng/dtbook-2005-2.rng"),
ENC_20_RNG("schema/20/rng/encryption.rng"),
ENC_30_RNC("schema/30/ocf-encryption-30.rnc"),
IDUNIQUE_20_SCH("schema/20/sch/id-unique.sch"),
+ META_30_RNC("schema/30/ocf-metadata-30.rnc"),
+ META_30_SCH("schema/30/ocf-metadata-30.sch"),
+ META_EDUPUB_SCH("schema/30/edupub/edu-ocf-metadata.sch"),
MO_30_RNC("schema/30/media-overlay-30.rnc"),
MO_30_SCH("schema/30/media-overlay-30.sch"),
NAV_30_RNC("schema/30/epub-nav-30.rnc"),
@@ -18,16 +22,32 @@ public enum XMLValidators
OPF_20_SCH("schema/20/sch/opf.sch"),
OPF_30_RNC("schema/30/package-30.rnc"),
OPF_30_SCH("schema/30/package-30.sch"),
+ OPF_30_COLLECTION_DICT_SCH("schema/30/dict/dict-collection.sch"),
+ OPF_30_COLLECTION_DO_SCH("schema/30/collection-do-30.sch"),
+ OPF_30_COLLECTION_IDX_SCH("schema/30/idx/idx-collection.sch"),
+ OPF_30_COLLECTION_MANIFEST_SCH("schema/30/collection-manifest-30.sch"),
+ OPF_30_COLLECTION_PREVIEW_SCH("schema/30/previews/preview-collection.sch"),
+ OPF_DICT_SCH("schema/30/dict/dict-opf.sch"),
+ OPF_EDUPUB_SCH("schema/30/edupub/edu-opf.sch"),
+ OPF_PREVIEW_SCH("schema/30/previews/preview-pub-opf.sch"),
+ RENDITION_MAPPING_RNC("schema/30/multiple-renditions/mapping.rnc"),
+ RENDITION_MAPPING_SCH("schema/30/multiple-renditions/mapping.sch"),
+ SEARCH_KEY_MAP_RNC("schema/30/dict/search-key-map.rnc"),
SIG_20_RNG("schema/20/rng/signatures.rng"),
SIG_30_RNC("schema/30/ocf-signatures-30.rnc"),
SVG_20_RNG("schema/20/rng/svg11.rng"),
SVG_30_RNC("schema/30/epub-svg-30.rnc"),
SVG_30_SCH("schema/30/epub-svg-30.sch"),
XHTML_20_NVDL("schema/20/rng/ops20.nvdl"),
+ XHTML_20_SCH("schema/20/sch/xhtml.sch"),
XHTML_30_SCH("schema/30/epub-xhtml-30.sch"),
XHTML_30_RNC("schema/30/epub-xhtml-30.rnc"),
- XHTML_EDUPUB_HEADINGS_SCH("schema/30/edupub/edu-headings.sch"),
- XHTML_EDUPUB_SEMANTICS_SCH("schema/30/edupub/edu-semantics.sch");
+ XHTML_EDUPUB_STRUCTURE_SCH("schema/30/edupub/edu-structure.sch"),
+ XHTML_EDUPUB_SEMANTICS_SCH("schema/30/edupub/edu-semantics.sch"),
+ XHTML_DATANAV_SCH("schema/30/datanav/datanav-xhtml.sch"),
+ XHTML_DICT_SCH("schema/30/dict/dict-xhtml.sch"),
+ XHTML_IDX_SCH("schema/30/idx/idx-xhtml.sch"),
+ XHTML_IDX_INDEX_SCH("schema/30/idx/idx-xhtml-index.sch");
private final XMLValidator val;
diff --git a/src/main/java/dict/SearchKeyMapChecker.java b/src/main/java/dict/SearchKeyMapChecker.java
new file mode 100644
index 0000000..4c5481b
--- /dev/null
+++ b/src/main/java/dict/SearchKeyMapChecker.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2011 Adobe Systems Incorporated
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+package dict;
+
+import com.adobe.epubcheck.api.EPUBLocation;
+import com.adobe.epubcheck.api.Report;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.ocf.OCFPackage;
+import com.adobe.epubcheck.opf.ContentChecker;
+import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.xml.XMLParser;
+import com.adobe.epubcheck.xml.XMLValidators;
+import com.google.common.base.Preconditions;
+
+public class SearchKeyMapChecker implements ContentChecker, DocumentValidator
+{
+
+ private final ValidationContext context;
+ private final Report report;
+ private final String path;
+
+ public SearchKeyMapChecker(ValidationContext context)
+ {
+ Preconditions.checkState("application/vnd.epub.search-key-map+xml".equals(context.mimeType));
+ this.context = context;
+ this.report = context.report;
+ this.path = context.path;
+ }
+
+ public void runChecks()
+ {
+ OCFPackage ocf = context.ocf.get();
+ if (!ocf.hasEntry(path))
+ {
+ report.message(MessageId.RSC_001, EPUBLocation.create(ocf.getName()), path);
+ }
+ else if (!ocf.canDecrypt(path))
+ {
+ report.message(MessageId.RSC_004, EPUBLocation.create(ocf.getName()), path);
+ }
+ else if (!path.endsWith(".xml"))
+ {
+ report.message(MessageId.OPF_080, EPUBLocation.create(path));
+ }
+ else
+ {
+ validate();
+ }
+ }
+
+ public boolean validate()
+ {
+ int fatalErrorsSoFar = report.getFatalErrorCount();
+ int errorsSoFar = report.getErrorCount();
+ int warningsSoFar = report.getWarningCount();
+ SearchKeyMapHandler handler;
+ XMLParser parser = new XMLParser(context);
+ handler = new SearchKeyMapHandler(context, parser);
+ parser.addValidator(XMLValidators.SEARCH_KEY_MAP_RNC.get());
+ parser.addXMLHandler(handler);
+ parser.process();
+
+ return fatalErrorsSoFar == report.getFatalErrorCount() && errorsSoFar == report.getErrorCount()
+ && warningsSoFar == report.getWarningCount();
+ }
+}
diff --git a/src/main/java/dict/SearchKeyMapCheckerFactory.java b/src/main/java/dict/SearchKeyMapCheckerFactory.java
new file mode 100644
index 0000000..8634f77
--- /dev/null
+++ b/src/main/java/dict/SearchKeyMapCheckerFactory.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011 Adobe Systems Incorporated
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+ * the Software, and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+package dict;
+
+import com.adobe.epubcheck.opf.ContentCheckerFactory;
+import com.adobe.epubcheck.opf.DocumentValidatorFactory;
+import com.adobe.epubcheck.opf.ValidationContext;
+
+public class SearchKeyMapCheckerFactory implements ContentCheckerFactory, DocumentValidatorFactory
+{
+ static private final SearchKeyMapCheckerFactory instance = new SearchKeyMapCheckerFactory();
+
+ public SearchKeyMapChecker newInstance(ValidationContext context)
+ {
+ return new SearchKeyMapChecker(context);
+ }
+
+ static public SearchKeyMapCheckerFactory getInstance()
+ {
+ return instance;
+ }
+
+}
diff --git a/src/main/java/dict/SearchKeyMapHandler.java b/src/main/java/dict/SearchKeyMapHandler.java
new file mode 100644
index 0000000..6f30a35
--- /dev/null
+++ b/src/main/java/dict/SearchKeyMapHandler.java
@@ -0,0 +1,70 @@
+package dict;
+
+import com.adobe.epubcheck.opf.ValidationContext;
+import com.adobe.epubcheck.opf.XRefChecker.Type;
+import com.adobe.epubcheck.util.PathUtil;
+import com.adobe.epubcheck.xml.XMLElement;
+import com.adobe.epubcheck.xml.XMLHandler;
+import com.adobe.epubcheck.xml.XMLParser;
+
+public class SearchKeyMapHandler implements XMLHandler
+{
+
+ private final ValidationContext context;
+ private final String path;
+ private final XMLParser parser;
+
+ public SearchKeyMapHandler(ValidationContext context, XMLParser parser)
+ {
+ this.context = context;
+ this.path = context.path;
+ this.parser = parser;
+ }
+
+ public void startElement()
+ {
+
+ XMLElement e = parser.getCurrentElement();
+ String name = e.getName();
+
+ if ("http://www.idpf.org/2007/ops".equals(e.getNamespace()))
+ {
+
+ if ("search-key-group".equals(name))
+ {
+ processRef(e.getAttribute("href"));
+ }
+ else if ("match".equals(name))
+ {
+ processRef(e.getAttribute("href"));
+ }
+ }
+ }
+
+ private void processRef(String ref)
+ {
+ if (ref != null && context.xrefChecker.isPresent())
+ {
+ ref = PathUtil.resolveRelativeReference(path, ref, null);
+ context.xrefChecker.get().registerReference(path, parser.getLineNumber(),
+ parser.getColumnNumber(), ref, Type.SEARCH_KEY);
+ }
+ }
+
+ public void characters(char[] chars, int arg1, int arg2)
+ {
+ }
+
+ public void endElement()
+ {
+ }
+
+ public void ignorableWhitespace(char[] chars, int arg1, int arg2)
+ {
+ }
+
+ public void processingInstruction(String arg0, String arg1)
+ {
+ }
+
+}
diff --git a/src/main/java/org/idpf/epubcheck/util/css/CssParser.java b/src/main/java/org/idpf/epubcheck/util/css/CssParser.java
index 1353c2a..e388d59 100644
--- a/src/main/java/org/idpf/epubcheck/util/css/CssParser.java
+++ b/src/main/java/org/idpf/epubcheck/util/css/CssParser.java
@@ -21,25 +21,33 @@
*/
package org.idpf.epubcheck.util.css;
-import com.google.common.base.Predicate;
-import com.google.common.collect.Lists;
-import org.idpf.epubcheck.util.css.CssExceptions.CssException;
-import org.idpf.epubcheck.util.css.CssExceptions.CssGrammarException;
-import org.idpf.epubcheck.util.css.CssGrammar.*;
-import org.idpf.epubcheck.util.css.CssToken.CssTokenConsumer;
-import org.idpf.epubcheck.util.css.CssTokenList.CssTokenIterator;
-import org.idpf.epubcheck.util.css.CssTokenList.PrematureEOFException;
+import static com.google.common.base.Preconditions.*;
+import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.*;
+import static org.idpf.epubcheck.util.css.CssToken.Matchers.*;
+import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_S_CMNT;
+import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_S_CMNT_CDO_CDC;
import java.io.IOException;
import java.io.Reader;
import java.util.List;
import java.util.NoSuchElementException;
-import static com.google.common.base.Preconditions.*;
-import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.*;
-import static org.idpf.epubcheck.util.css.CssToken.Matchers.*;
-import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_S_CMNT;
-import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_S_CMNT_CDO_CDC;
+import org.idpf.epubcheck.util.css.CssExceptions.CssException;
+import org.idpf.epubcheck.util.css.CssExceptions.CssGrammarException;
+import org.idpf.epubcheck.util.css.CssGrammar.CssAtRule;
+import org.idpf.epubcheck.util.css.CssGrammar.CssConstruct;
+import org.idpf.epubcheck.util.css.CssGrammar.CssConstructFactory;
+import org.idpf.epubcheck.util.css.CssGrammar.CssDeclaration;
+import org.idpf.epubcheck.util.css.CssGrammar.CssSelector;
+import org.idpf.epubcheck.util.css.CssGrammar.CssSelectorCombinator;
+import org.idpf.epubcheck.util.css.CssGrammar.CssSelectorConstructFactory;
+import org.idpf.epubcheck.util.css.CssGrammar.CssSimpleSelectorSequence;
+import org.idpf.epubcheck.util.css.CssToken.CssTokenConsumer;
+import org.idpf.epubcheck.util.css.CssTokenList.CssTokenIterator;
+import org.idpf.epubcheck.util.css.CssTokenList.PrematureEOFException;
+
+import com.google.common.base.Predicate;
+import com.google.common.collect.Lists;
/**
* A CSS parser.
@@ -668,7 +676,7 @@ public final class CssParser
public boolean apply(CssConstruct cc)
{
checkNotNull(cc);
- return cc.type != CssConstruct.Type.FUNCTION;
+ return cc.type != CssConstruct.Type.ATRULE; //TODO;
}
};
diff --git a/src/main/licenses/third-party.properties b/src/main/licenses/third-party.properties
new file mode 100644
index 0000000..fb55c28
--- /dev/null
+++ b/src/main/licenses/third-party.properties
@@ -0,0 +1,18 @@
+# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
+#-------------------------------------------------------------------------------
+# Already used licenses in project :
+# - Mozilla Public License Version 2.0
+# - New BSD License
+# - The Apache Software License, Version 2.0
+# - The W3C Software License
+#-------------------------------------------------------------------------------
+# Please fill the missing licenses for dependencies :
+#
+#
+#Sat Aug 29 02:32:05 CEST 2015
+com.twelvemonkeys.common--common-image--3.1.2=New BSD License
+com.twelvemonkeys.common--common-io--3.1.2=New BSD License
+com.twelvemonkeys.common--common-lang--3.1.2=New BSD License
+com.twelvemonkeys.imageio--imageio-core--3.1.2=New BSD License
+com.twelvemonkeys.imageio--imageio-jpeg--3.1.2=New BSD License
+com.twelvemonkeys.imageio--imageio-metadata--3.1.2=New BSD License
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties
index d7c212d..171ba79 100644
--- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties
@@ -15,13 +15,13 @@ ACC_011=Link elements within SVG should include an xlink:title attribute.
ACC_012=Table elements should include a caption element.
ACC_013=Content file contains at least one inline style declaration.
ACC_013_SUG=Inline styles are not compatible with accessibility settings and display personalization. Use CSS Styles instead.
-ACC_014=CSS Selector font-size attribute value does not use a relative size.
+ACC_014=Value of CSS property 'font-size' does not use a relative size.
ACC_014_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-ACC_015=CSS Selector font line-height attribute value does not use a relative size.
+ACC_015=Value of CSS property 'line-height' does not use a relative size.
ACC_015_SUG=Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
-ACC_016=CSS Selector font-size attribute value should use a relative size.
+ACC_016=Value of CSS property 'font-size' should use a relative size.
ACC_016_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-ACC_017=CSS Selector font line-height attribute value does not use a relative size.
+ACC_017=Value of CSS property 'line-height' does not use a relative size.
ACC_017_SUG=Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
#Checker Errors
@@ -34,7 +34,7 @@ CHK_006=Unable to parse the custom format parameter in message overrides file '%
CHK_007=Error encountered while processing custom message file '%1$s': "%2$s".
#CSS
-CSS_001=The \'%1$s\' property must not be included in an ePub Style Sheet.
+CSS_001=The \'%1$s\' property must not be included in an EPUB Style Sheet.
CSS_002=Empty or NULL reference found.
CSS_003=Only UTF-8 and UTF-16 encodings are allowed, detected %1$s.
CSS_004=Only UTF-8 and UTF-16 encodings are allowed, detected %1$s BOM.
@@ -43,32 +43,32 @@ CSS_006=CSS position:fixed property should not be used in EPUBs.
CSS_007=Font-face reference %1$s refers to non-standard font type %2$s.
CSS_008=An error occurred while parsing the CSS: %1$s.
CSS_009=Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.
-CSS_010=Use of non-standard stylesheet.
+CSS_010=Stylesheet of type other than 'text/css' must have a fallback.
CSS_011=Excessive number of css files.
CSS_011_SUG=Consider merging CSS files to reduce the number of CSS files.
CSS_012=Document links to multiple CSS files.
-CSS_013=CSS Selector attribute is declared !Important.
+CSS_013=CSS property is declared !Important.
CSS_015=Alternate Stylesheet has no title.
CSS_016=Alternate Stylesheet precedes primary stylesheet.
-CSS_017=CSS Selector specifies absolute position.
+CSS_017=CSS selector specifies absolute position.
CSS_019=CSS font-face declaration has no attributes.
CSS_020=CSS font selector declaration uses unexpected font-size value '%1$s'.
CSS_020_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-CSS_021=CSS Selector font shorthand specifies an invalid System Font.
+CSS_021=Shorthand CSS property 'font-family' specifies an invalid System Font.
CSS_021_SUG=Acceptable values include 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', or 'inherit'.
-CSS_022=CSS Selector specifies global margin setting.
-CSS_023=CSS Selector specifies media query.
+CSS_022=CSS selector specifies global margin setting.
+CSS_023=CSS selector specifies media query.
CSS_024=CSS class Selector is not used.
CSS_024_SUG=Remove unused CSS selectors.
-CSS_025=CSS class Selector is not found.
+CSS_025=CSS class Selector could not be found.
CSS_025_SUG=Check for typos or define a class selector to document the use of the class.
-CSS_027=CSS Selector specifies absolute position.
+CSS_027=CSS selector specifies absolute position.
CSS_028=Use of Font-face declaration.
#HTM - XHTML related messages
HTM_001=Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: %1$s.
HTM_002=The installed xml parser doesn't support xml version verification. Xml files must be a valid XML 1.0 document.
-HTM_003=External entities are not allowed in ePub v3 documents. External entity declaration found: %1$s.
+HTM_003=External entities are not allowed in EPUB v3 documents. External entity declaration found: %1$s.
HTM_004=Irregular DOCTYPE: found '%1$s', expected '%2$s'.
HTM_005=An external reference was found.
HTM_006=An XHTML Named Entity was found.
@@ -82,8 +82,8 @@ HTM_012=Found a link to a CFI in an external book.
HTM_013=Intra-Publication CFIs found in document.
HTM_014=Invalid file extension for HTML file, expecting (html, htm or xhtml).
HTM_014a=XHTML Content Document file name '%1$s' should have the extension '.xhtml'.
-HTM_015=HTML4 DOCTYPE definition within ePub v3.
-HTM_016=HTML5 DOCTYPE definition within ePub v2.
+HTM_015=HTML4 DOCTYPE definition within EPUB v3.
+HTM_016=HTML5 DOCTYPE definition within EPUB v2.
HTM_017=Content file has different language value in attributes xml:lang and lang.
HTM_018=Content file has invalid language value at attribute xml:lang.
HTM_019=Content file has invalid language definition at attribute lang.
@@ -118,6 +118,8 @@ HTM_048_SUG=A viewBox declaration is required for fixed format documents.
HTM_049=Html element does not have an xmlns set to 'http://www.w3.org/1999/xhtml'.
HTM_049_SUG=Add xmlns="http://www.w3.org/1999/xhtml" to the html element.
HTM_050=Found epub:type="pagebreak" attribute in content document.
+HTM_051=Found Microdata semantic enrichments but no RDFa. EDUPUB recommends using RDFa Lite.
+HTM_052=The property 'region-based' is only allowed on nav elements in Data Navigation Documents.
#media
MED_001=Video poster must have core media image type.
@@ -127,25 +129,29 @@ MED_004=Image file header may be corrupted.
MED_005=Media Overlay audio reference %1$s to non-standard audio type %2$s found.
MED_006=Some browsers do not support rendering SVG images which use a filename in the xlink:href property.
-#NAV ePub v3 Table of contents
-NAV_001=The nav file is not supported for ePub v2.
+#NAV EPUB v3 Table of contents
+NAV_001=The nav file is not supported for EPUB v2.
NAV_002=Found epub:type="page-list" in nav document
-NAV_003=Found both epub:type="page-list" in nav document and epub:type="pagebreak" in content document(s)
-NAV_003_SUG=Using multiple paging constructs can cause unpredictable paging behavior in some epub readers.
+NAV_003=The Navigation Document must have a page list when content document(s) contain page breaks (epub:type="pagebreak").
+NAV_004=The Navigation Document should contain the full document heading hierarchy in EDUPUB.
+NAV_005=Content documents contain 'audio' elements but the Navigation Document does not have a listing of audio clips (epub:type="loa").
+NAV_006=Content documents contain 'audio' elements but the Navigation Document does not have a listing of figures (epub:type="loi").
+NAV_007=Content documents contain 'audio' elements but the Navigation Document does not have a listing of tables (epub:type="lot").
+NAV_008=Content documents contain 'audio' elements but the Navigation Document does not have a listing of video clips (epub:type="lov").
+NAV_009=Region-based navigation links must point to Fixed-Layout Documents.
-#NCX ePub v2 Table of Contents
-NCX_001=Failed performing NCX Schematron tests: %1$s.
+#NCX EPUB v2 Table of Contents
+NCX_001=NCX identifier ('%1$s') does not match OPF identifier ('%2$s').
NCX_002=toc attribute was not found on the spine element.
-NCX_003=An .NCX file is required for TOC navigation on ePub v2 readers.
-NCX_004=NCX identifier does not match ocf identifier: %1$s
+NCX_003=An .NCX file is required for TOC navigation on EPUB v2 readers.
+NCX_004=NCX identifier ('dtb:uid' metadata) should not contain leading or trailing whitespace.
NCX_005=Found ncx "page-list" in .ncx file
-NCX_006=Found both "page-list" construct in ncx document and Adobe page-map attribute on the spine.
-NCX_006_SUG=Using multiple paging constructs can cause unpredictable paging behavior in some readers.
+NCX_006=Empty "text" label in the NCX document
#OPF
-OPF_001=There was an error when parsing the ePub version: %1$s.
-OPF_002=The OPF file '%1$s' was not found in the ePub.
-OPF_003=Item '%1$s' exists in the ePub, but is not declared in the OPF manifest.
+OPF_001=There was an error when parsing the EPUB version: %1$s.
+OPF_002=The OPF file '%1$s' was not found in the EPUB.
+OPF_003=Item '%1$s' exists in the EPUB, but is not declared in the OPF manifest.
OPF_004=Invalid prefix declaration: leading or trailing whitespace is not allowed.
OPF_004a=Invalid prefix declaration: found empty prefix.
OPF_004b=Invalid prefix '%1$s': must be a valid non-colonized name (aka 'NCName').
@@ -159,7 +165,7 @@ OPF_007=Re-declaration of reserved prefix '%1$s'.
OPF_007a=Invalid prefix mapping: prefix '_' must not be declared.
OPF_007b=Invalid prefix mapping: default vocabulary '%1$s' must not be re-declared.
OPF_008=Handler binding for core Media-type '%1$s' is not allowed.
-OPF_009=The media-type %1$s has already been assigned handler '%2$s'.
+OPF_009=The media-type '%1$s' has already been assigned a handler, with ID '%2$s'.
OPF_010=Error resolving reference: '%1$s'.
OPF_011=itemref can't have both page-spread-right and page-spread-left properties.
OPF_012=Item property '%1$s' is not defined for media type '%2$s'.
@@ -172,8 +178,6 @@ OPF_018=The 'remote-resources' property was declared in the OPF, but no referenc
OPF_019=Spine tag was not found in the OPF file.
OPF_020=Excessive number of spine items.
OPF_021=Use of non-registered URI scheme type in href: '%1$s'.
-OPF_022=Invalid path: '%1$s'.
-OPF_024=Found unknown ePub version %1$s.
OPF_025=Property '%1$s' can take only one value.
OPF_026=Found malformed property value: '%1$s'.
OPF_027=Undefined property: '%1$s'.
@@ -207,51 +211,73 @@ OPF_052=Role value '%1$s' is not valid.
OPF_053=Date value '%1$s' does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:%2$s.
OPF_054=Date value '%1$s' is not valid as per http://www.w3.org/TR/NOTE-datetime:%2$s.
OPF_055=%1$s tag is empty.
-OPF_056=Media type '%1$s' is not an appropriate audio mimetype.
-OPF_056_SUG=Use 'audio/mp3', 'audio/mp4' or 'audio/ogg' instead.
+OPF_056=Media type '%1$s' is not a core audio type.
OPF_057=Image file length exceeds recommended size.
OPF_058=Spine item has no TOC entry reference.
OPF_058_SUG=Every spine item in the manifest should be referenced by at least one TOC entry.
-OPF_059=Spine item has no NAV entry reference.
-OPF_059_SUG=Every spine item in the manifest should be referenced by at least one NAV entry.
+OPF_059=Spine item has no NCX entry reference.
+OPF_059_SUG=Every spine item in the manifest should be referenced by at least one NCX entry.
OPF_060=Duplicate entry in the ZIP file: '%1$f'.
OPF_061=Duplicate entry in the ZIP file (after Unicode NFC normalization) '%1$f'.
OPF_062=Found Adobe page-map attribute on spine element in opf file.
OPF_063=Referenced Adobe page-map item '%1$s' was not found in the manifest.
-
+OPF_064=OPF declares type '%1$s', validating using profile '%2$s'.
+OPF_065=Invalid metadata declaration, probably due to a cycle in 'refines' metadata.
+OPF_066=Missing 'dc:source' or 'source-of' pagination metadata. The pagination source must be identified using the 'dc:source' and 'source-of' properties when the content includes page break markers.
+OPF_067=The resource '%1$s' must not be listed both as a 'link' element in the package metadata and as a manifest item.
+OPF_068=Unknown collection role '%1$s'.
+OPF_069=Custom collection role URI '%1$s' must not include the string 'idpf.org' in its host component.
+OPF_070=Custom collection role '%1$s' is an invalid URI.
+OPF_071=Index collections must only contain resources pointing to XHTML Content Documents.
+OPF_072=Metadata element '%1$s' is empty.
+OPF_073=External identifiers must not appear in the document type declaration.
+OPF_074=Package resource '%1$s' is declared in several manifest item.
+OPF_075=Preview collections must only point to EPUB Content Documents.
+OPF_076=The URI of preview collections link elements must not include EPUB canonical fragment identifiers.
+OPF_077=A Data Navigation Document should not be included in the spine.
+OPF_078=An EPUB Dictionary must contain at least one Content Document with dictionary content (epub:type 'dictionary').
+OPF_079=Dictionary content was found (epub:type 'dictionary'), the Package Document should declare the dc:type 'dictionary'.
+OPF_080=A Search Key Map document file name should have the extension '.xml'.
+OPF_081=Resource '%1$s' (referenced from an EPUB Dictionary collection) was not found.
+OPF_082=Found an EPUB Dictionary collection containing more than one Search Key Map Document.
+OPF_083=Found an EPUB Dictionary collection containing no Search Key Map Document.
+OPF_084=Found an EPUB Dictionary collection containing resource '%1$s' which is neither a Search Key Map Document nor an XHTML Content Document.
+
#Package
-PKG_001=Validating the ePub against version %1$s but detected version %2$s.
-PKG_003=Unable to read ePub file header. This is likely a corrupted ePub file.
-PKG_004=Corrupted ePub ZIP header.
-PKG_005=The mimetype file has an extension of length %1$s. No filename extensions are permitted for the mimetype file.
+PKG_001=Validating the EPUB against version %1$s but detected version %2$s.
+PKG_003=Unable to read EPUB file header. This is likely a corrupted EPUB file.
+PKG_004=Corrupted EPUB ZIP header.
+PKG_005=The mimetype file has an extra field of length %1$s. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
PKG_006=Mimetype file entry is missing or is not the first file in the archive.
-PKG_007=Mimetype file should only contain the string 'application/epub+zip'.
+PKG_007=Mimetype file should only contain the string 'application/epub+zip' and should not be compressed.
PKG_008=Unable to read file '%1$s'.
PKG_009=File name contains characters that are not allowed in OCF file names: '%1$s'.
PKG_010=Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.
PKG_011=Filename is not allowed to end with '.'.
PKG_012=File name contains the following non-ascii characters: %1$s. Consider changing the filename.
-PKG_013=The ePub file includes multiple OPS renditions.
-PKG_014=The ePub contains empty directory '%1$s'.
-PKG_015=Unable to read ePub contents: %1$s
-PKG_016=Use only lowercase characters for the ePub file extension for maximum compatibility.
+PKG_013=The EPUB file includes multiple OPS renditions.
+PKG_014=The EPUB contains empty directory '%1$s'.
+PKG_015=Unable to read EPUB contents: %1$s
+PKG_016=Use only lowercase characters for the EPUB file extension for maximum compatibility.
PKG_016_SUG=For maximum compatibility, use '.epub'.
-PKG_017=Uncommon ePub file extension.
+PKG_017=Uncommon EPUB file extension.
PKG_017_SUG=For maximum compatibility, use '.epub'.
-PKG_018=The ePub file is not found.
-PKG_020=OPF file '%1$s' is not found.
+PKG_018=The EPUB file could not be found.
+PKG_020=OPF file '%1$s' could not be found.
PKG_021=Corrupted image file encountered.
PKG_022=Wrong file extension for image. The image is a '%1$s' file but has the file extension '%2$s'.
+PKG_023=Validating the EPUB against version 2.0, default validation profile will be used.
#Resources
-RSC_001=File '%1$s' is not found.
-RSC_002=Required META-INF/container.xml resource is not found.
+RSC_001=File '%1$s' could not be found.
+RSC_002=Required META-INF/container.xml resource could not be found.
RSC_003=No rootfile tag with media type 'application/oebps-package+xml' was found in the container.
RSC_004=File '%1$s' could not be decrypted.
RSC_005=Error while parsing file '%1$s'.
RSC_006=Remote resource reference not allowed; resource must be placed in the OCF.
RSC_006_SUG=Only audio and video remote resources are permitted.
-RSC_007=Referenced resource is not found in the ePub.
+RSC_007=Referenced resource could not be found in the EPUB.
+RSC_007w=Referenced resource could not be found in the EPUB.
RSC_008=Referenced resource is not declared in the OPF manifest.
RSC_009=A fragment identifier should not be used with an img src attribute.
RSC_010=Reference to non-standard resource type found.
@@ -262,13 +288,17 @@ RSC_014=Fragment identifier defines an incompatible resource type.
RSC_015=A fragment identifier is required for svg use tag references.
RSC_016=Fatal Error while parsing file '%1$s'.
RSC_017=Warning while parsing file '%1$s'.
-RSC_018=Altimg file '%1$s' is not found.
+RSC_018=Altimg file '%1$s' could not be found.
+RSC_019=EPUBs with Multiple Renditions should contain a META-INF/metadata.xml file.
+RSC_020='%1$s' is not a valid URI.
+RSC_021=A Search Key Map Document must point to Content Documents ('%1s' was not found in the spine).
+RSC_022=Cannot check image details (requires Java version 7 or higher).
#Scripting
-SCP_001=Use of Javascript eval() function in ePub scripts is a security risk.
-SCP_002=Use of XMLHttpRequest in ePub scripts is a security risk.
+SCP_001=Use of Javascript eval() function in EPUB scripts is a security risk.
+SCP_002=Use of XMLHttpRequest in EPUB scripts is a security risk.
SCP_003=Local and Session Storage is not currently supported.
-SCP_004=Content file contains script which is not supported in ePub v2.
+SCP_004=Content file contains script which is not supported in EPUB v2.
SCP_005=Content file contains script but it is not marked as scripted.
SCP_006=Inline scripts found.
SCP_007=Script references 'innerHtml'.
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties
new file mode 100644
index 0000000..757aa03
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties
@@ -0,0 +1,278 @@
+# This is the German translation of MessageBundle.properties file
+# Translation by Tobias Fischer (https://github.com/tofi86)
+
+#Accessibility
+ACC_001=Einem 'img' oder 'area' HTML-Element fehlt das 'alt'-Attribut.
+ACC_002=Ein 'input' HTML-Element wird von keinem zugehörigen 'label'-Element referenziert.
+ACC_003=HTML-Elemente ohne Text-Inhalt sollten ein 'title'-Attribut für bessere Barrierefreiheit besitzen.
+ACC_004=Ein 'a'-Element darf nicht leer sein.
+ACC_005=Tabellenkopfzellen sollten für bessere Barrierefreiheit mit 'th'-Elementen ausgezeichnet werden.
+ACC_006=Tabellen sollten für bessere Barrierefreiheit ein 'thead'-Element besitzen.
+ACC_007=Das Dokument nutzt keine 'epub:type'-Attribute für semantische Auszeichnung.
+ACC_008=Die Navigationsdatei enthält kein 'landmarks nav'-Element.
+ACC_009=MathML sollte entweder ein 'alt'-Attribut besitzen oder ein 'annotation-xml'-Kindelement.
+ACC_010=Überschriften sollten nicht innerhalb von 'blockquote' oder 'figure'-Elementen benutzt werden.
+ACC_011=Link-Elemente innerhalb von SVG sollten ein 'xlink:title'-Attribut besitzen.
+ACC_012=Tabellen sollten ein 'caption'-Element besitzen.
+ACC_013=Die Datei enthält mindestens eine Inline-CSS-Deklaration.
+ACC_013_SUG=Inline-Styles sind nicht kompatibel mit Einstellungen für Barrierefreiheit und benutzerspezifische Display-Anpassungen. Stattdessen sollten CSS-Klassen verwendet werden.
+ACC_014=Wert der CSS-Eigenschaft 'font-size' ist keine relative Größenangabe.
+ACC_014_SUG=Erlaubte Werte sind Prozentangaben, 'em'-Werte, 'larger', 'smaller', 'normal' oder 'inherit'.
+ACC_015=Wert der CSS-Eigenschaft 'line-height' ist keine relative Größenangabe.
+ACC_015_SUG=Erlaubte Werte sind Prozentangaben, Zahlen, 'larger', 'smaller', 'normal' oder 'inherit'.
+ACC_016=CSS-Eigenschaft 'font-size' sollte in einer relativen Größe angegeben werden.
+ACC_016_SUG=Erlaubte Werte sind Prozentangaben, 'em'-Werte, 'larger', 'smaller', 'normal' oder 'inherit'.
+ACC_017=Wert der CSS-Eigenschaft 'line-height' ist keine relative Größenangabe.
+ACC_017_SUG=Erlaubte Werte sind Prozentangaben, Zahlen, 'larger', 'smaller', 'normal' oder 'inherit'.
+
+#Checker Errors
+CHK_001=Die benutzerspezifische Datei zum Überschreiben von Warnungen und Fehlermeldungen wurde nicht gefunden.
+CHK_002=Unbekannte benutzerdefinierte Message-ID '%1$s' in Datei zum Überschreiben von Warnungen und Fehlermeldungen '%2$s'.
+CHK_003=Unbekannter benutzerdefinierter Fehlerlevel '%1$s' in Datei zum Überschreiben von Warnungen und Fehlermeldungen '%2$s'.
+CHK_004=Die benutzerdefinierte Meldung enthält zu viele Parameter in der Datei zum Überschreiben von Warnungen und Fehlermeldungen '%1$s'.
+CHK_005=Der benutzerdefinierte Vorschlag enthält zu viele Parameter in der Datei zum Überschreiben von Warnungen und Fehlermeldungen '%1$s'.
+CHK_006=Der benutzerdefinierte Formatierungs-Parameter ist ungültig in der Datei zum Überschreiben von Warnungen und Fehlermeldungen '%1$s'.
+CHK_007=Fehler beim Einlesen der Datei zum Überschreiben von Warnungen und Fehlermeldungen '%1$s': %2$s
+
+#CSS
+CSS_001=Die CSS-Eigenschaft '%1$s' darf im EPUB nicht verwendet werden!
+CSS_002=Leere oder Keine Referenz gefunden.
+CSS_003=Es sind nur UTF-8 und UTF-16 Zeichenkodierungen erlaubt, die Datei ist aber '%1$s' kodiert.
+CSS_004=Es sind nur UTF-8 und UTF-16 Zeichenkodierungen erlaubt, die Datei ist aber '%1$s' kodiert (mit 'Byte Order Mark').
+CSS_005=Unverträgliche Style-Eigenschaften gefunden: '%1$s'
+CSS_006=CSS-Eigenschaft 'position:fixed' sollte in EPUBs nicht verwendet werden.
+CSS_007=Die 'font-face' Deklaration '%1$s' referenziert einen nicht-standardisierten Schriftentyp: '%2$s'
+CSS_008=CSS-Validierungsfehler: %1$s
+CSS_009=Die Verwendung spezieller CSS-Eigenschaften wie etwa Columns, Transforms, Transitions, box-sizing oder KeyFrames kann Fehler bei der Paginierung erzeugen!
+CSS_010=Es wird ein Stylesheet genutzt das nicht den Standards entspricht.
+CSS_011=Zu viele CSS-Dateien!
+CSS_011_SUG=Denke darüber nach, einige CSS-Dateien zusammenzufassen um die Anzahl der Dateien zu verringern.
+CSS_012=Im Dokument sind zu viele CSS-Dateien referenziert!
+CSS_013=CSS-Eigenschaft wurde mit '!important' markiert.
+CSS_015=Alternatives Stylesheet hat keinen Titel!
+CSS_016=Alternatives Stylesheet wird vor dem Haupt-Stylesheet aufgerufen!
+CSS_017=CSS-Selektor enthält Anweisungen zu absoluter Positionierung.
+CSS_019=CSS-Deklaration 'font-face' enthält keine Anweisungen!
+CSS_020=CSS-Eigenschaft enthält unerwartete Schriftgröße '%1$s'.
+CSS_020_SUG=Erlaubte Werte sind Prozentangaben, 'em'-Werte, 'larger', 'smaller', 'normal' oder 'inherit'.
+CSS_021=CSS-Eigenschaft referenziert eine ungültige Systemschrift!
+CSS_021_SUG=Erlaubte Werte sind 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar' oder 'inherit'.
+CSS_022=CSS-Selektor enthält globale 'margin'-Anweisungen.
+CSS_023=CSS-Selektor deklariert eine MediaQuery.
+CSS_024=CSS-Klasse wird nicht verwendet.
+CSS_024_SUG=Entferne unbenutzte CSS-Selektoren/-Klassen.
+CSS_025=CSS-Klasse wurde nicht gefunden.
+CSS_025_SUG=Überprüfe die Angabe der CSS-Klasse auf Schreibfehler oder definiere einen neuen Klassen-Selektor im CSS.
+CSS_027=CSS-Selektor enthält Anweisungen zu absoluter Positionierung.
+CSS_028=Eine 'font-face'-Deklaration wird genutzt.
+
+#HTM - XHTML related messages
+HTM_001=Jede EPUB-Ressource mit XML-basiertem MIME-Type muss ein valides XML 1.0 Dokument sein. Gefundene XML-Version: '%1$s'
+HTM_002=Der installierte XML-Parser unterstützt die Verifikation von XML-Versionen nicht. XML-Dateien müssen valide XML 1.0 Dokumente sein.
+HTM_003=Externe Entity-Deklaration gefunden: '%1$s'. Externe Entities sind in EPUB 3 Dokumenten jedoch nicht erlaubt!
+HTM_004=Ungültiger DOCTYPE '%1$s'. Erwartet wird '%2$s'
+HTM_005=Eine externe Referenz wurde gefunden.
+HTM_006=Ein benanntes XHTML-Entity wurde gefunden.
+HTM_007=Leeres Attribut 'ssml:ph'.
+HTM_008=Das 'src'-Attribut ist verpflichtend!
+HTM_009=Der angegebene DOCTYPE ist veraltet oder ungültig und kann entfernt werden.
+HTM_010=Namespace-URI '%1$s' wurde gefunden.
+HTM_011=Entity ist nicht deklariert!
+HTM_011_SUG=Deklariere das benannte Entity oder nutze die nummerische Variante.
+HTM_012=CFI-Link zu einem externen Buch gefunden.
+HTM_013=Interner CFI-Link wurde in diesem Dokument gefunden.
+HTM_014=Ungültige Dateiendung für HTML-Dateien. Erwartet wird 'html', 'htm' oder 'xhtml'.
+HTM_014a=Die XHTML-Datei '%1$s' sollte die Endung '.xhtml' tragen.
+HTM_015=HTML4 DOCTYPE innerhalb eines EPUB 3.
+HTM_016=HTML5 DOCTYPE innerhalb eines EPUB 2.
+HTM_017=Datei hat verschiedene Sprachangaben in den Attributen 'xml:lang' und 'lang'.
+HTM_018=Datei enthält ungültige Sprachangabe im Attribut 'xml:lang'.
+HTM_019=Datei enthält ungültige Sprachangabe im Attribut 'lang'.
+HTM_020=Datei enthält das 'xml:lang'-Attribut nicht!
+HTM_021=Datei enthält das 'lang'-Attribut nicht!
+HTM_022=Datei enthält offenbar zu viele 'div' oder 'span'-Elemente.
+HTM_022_SUG=Denke darüber nach, 'div' oder 'span'-Elemente zusammenzufassen wenn sie aufeinanderfolgen und das gleiche Aussehen haben.
+HTM_023=Ein ungültiges benanntes XHTML-Entity wurde gefunden: '%1$s'.
+HTM_023_SUG=Prüfe die Schreibweise oder nutze die nummerische Variante.
+HTM_024=Ein benanntes XHTML-Entity wurde gefunden. Erlaubt sind nur '&' ''' '"e;' '<' und '>'.
+HTM_024_SUG=Prüfe die Schreibweise oder nutze die nummerische Variante.
+HTM_025=Nicht-definiertes URI-Schema im 'href'-Attribut gefunden.
+HTM_027=Liste enthält weniger als 2 Listeneinträge.
+HTM_027_SUG=Listen sollten mehr als einen Listeneintrag besitzen.
+HTM_028='input'-Elemente sollten ein 'id'-Attribut besitzen.
+HTM_029='label'-Elemente sollten ein 'for'-Attribut besitzen und damit die ID des zugehörigen 'input'-Elements referenzieren.
+HTM_033=Das 'head'-Element besitzt kein 'title'-Kindelement!
+HTM_036=Von der Nutzung von IFrames wird stark abgeraten!
+HTM_038=Stelle sicher, dass die Elemente 'b', 'i', 'em' und 'strong' auch korrekt nach den W3C HTML5 Richtlinien eingesetzt werden.
+HTM_038_SUG=Normalerweise sind CSS-Stile der bessere Weg um Text zu fetten oder zu kursivieren.
+HTM_043=SVG-Elemente sollten die Attribute 'xml:lang' und 'lang' besitzen.
+HTM_044=Namespace-URI '%1$s' ist deklariert, wird aber nicht genutzt.
+HTM_044_SUG=Entferne ungenutzte Namespaces.
+HTM_045=Leeres 'href'-Attribut gefunden!
+HTM_045_SUG=Leere 'href'-Attribute sind gültige Selbst-Referenzen. Bitte prüfe, ob das so gewollt ist.
+HTM_046=FixedLayout-Dokument ohne 'viewport'-Deklaration!
+HTM_046_SUG=Diese ist erforderlich für FixedLayout-Dokumente.
+HTM_047=Der HTML-'viewport'-Angabe fehlt die Breiten oder Höhenangabe.
+HTM_047_SUG=Die 'viewport'-Deklaration muss 'width' und 'height' enhalten.
+HTM_048=Die SVG-'ViewBox'-Angabe fehlt für das FixedLayout-Dokument.
+HTM_048_SUG=Diese ist erforderlich für FixedLayout-Dokumente.
+HTM_049=Das 'html'-Element besitzt kein Namespace-Attribut 'xmlns' mit dem Wert 'http://www.w3.org/1999/xhtml'.
+HTM_049_SUG=Füge das Attribut am 'html'-Element hinzu: xmlns="http://www.w3.org/1999/xhtml".
+HTM_050=Das Attribut epub:type="pagebreak" wurde im Dokument gefunden.
+
+#media
+MED_001=Das Video-Standbild muss in einem vom OPF-Standard unterstützten Dateiformate für Bilder vorliegen!
+MED_002=Für das '%1$s'-Element ist kein Fallback definiert!
+MED_003=Bilder vom Typ '%1$s' sind laut OPF-Standard nicht erlaubt.
+MED_004=Der Datei-Header des Bildes scheint fehlerhaft zu sein.
+MED_005=Im MediaOverlay wurde eine Audio-Referenz '%1$s' zu einem nicht unterstützten Audio-MimeType '%2$s' gefunden.
+MED_006=Hinweis: Einige Browser unterstützen die Darstellung von SVG-Grafiken nicht, die einen Dateinamen im 'xlink:href'-Attribut verwenden.
+
+#NAV ePub v3 Table of contents
+NAV_001=Die Navigationsdatei wird von EPUB 2 nicht unterstützt.
+NAV_002=Attribut epub:type="page-list" in der Navigationsdatei gefunden.
+
+#NCX ePub v2 Table of Contents
+NCX_001=NCX-Schematron-Tests konnten nicht ausgeführt werden: %1$s
+NCX_002=Das 'spine'-Element enthält kein 'toc'-Attribut!
+NCX_003=Eine NCX-Datei ist für die TOC-Navigation in EPUB 2-Dokumenten erforderlich.
+NCX_004=Das 'identifier'-Element im TOC muss mit dem 'unique-identifier'-Attribut am 'package'-Element der OPF-Datei übereinstimmen: '%1$s'
+NCX_005=NCX "page-list" in der .ncx-Datei gefunden
+
+#OPF
+OPF_001=Fehler beim Parsen der EPUB-Version: %1$s
+OPF_002=Die OPF-Datei '%1$s' wurde nicht im EPUB gefunden.
+OPF_003=Die Datei '%1$s' ist im EPUB vorhanden, wurde jedoch nicht in der OPF-Datei deklariert.
+OPF_004=Ungültige Präfix-Deklaration: Führende oder anhängende Leerzeichen sind nicht erlaubt.
+OPF_004a=Ungültige Präfix-Deklaration: Leerer Präfix gefunden.
+OPF_004b=Ungültiger Präfix '%1$s': Muss ein gültiger NCName sein ('non-colonized name').
+OPF_004c=Ungültige Präfix-Deklaration: Auf das Präfix '%1$s' muss direkt ein Doppelpunkt folgen.
+OPF_004d=Ungültige Präfix-Deklaration: Präfix '%1$s' muss von der zugehörigen URI durch ein Leerzeichen getrennt sein.
+OPF_004e=Ungültige Präfix-Deklaration: Ungültige Leerzeichen zwischen Präfix und URI.
+OPF_004f=Ungültige Präfix-Deklaration: Ungültige Leerzeichen zwischen Präfix-Mappings.
+OPF_005=Ungültige Präfix-Deklaration: Die URI für den Präfix '%1$s' existiert nicht!
+OPF_006=Ungültige Präfix-Deklaration: Die URI '%1$s' ist keine gültige URI!
+OPF_007=Erneute Deklaration eines reservierten Präfixes: '%1$s'
+OPF_007a=Ungültiges Präfix-Mapping: Präfix '_' darf nicht deklariert werden!
+OPF_007b=Ungültiges Präfix-Mapping: Standard-Vokabular '%1$s' darf nicht erneut deklariert werden!
+OPF_008=Die Bindung eines Handlers ist für den Core-MediaType '%1$s' nicht erlaubt.
+OPF_009=Der MIME-Type %1$s wurde bereits dem folgenden Handler zugeordnet: %2$s
+OPF_010=Fehler beim Auflösen der Referenz: '%1$s'
+OPF_011=Element 'itemref' darf die Eigenschaften 'page-spread-right' und 'page-spread-left' nicht gleichzeitig aufweisen.
+OPF_012=Die Eigenschaft '%1$s' ist für den MimeType '%2$s' nicht definiert.
+OPF_013=Die 'type'-Eigenschaft '%1$s' am 'object'-Element entspricht nicht dem MimeType '%2$s' aus dem OPF-Manifest.
+OPF_014=Die Eigenschaft '%1$s' sollte in der OPF-Datei deklariert werden.
+OPF_015=Die Eigenschaft '%1$s' sollte NICHT in der OPF-Datei deklariert sein.
+OPF_016=Am Element 'rootfile' fehlt das erforderliche Attribut 'full-path'.
+OPF_017=Das Attribut 'full-path' am Element 'rootfile' darf nicht leer sein.
+OPF_018=Diese Datei weist die Eigenschaft 'remote-resources' auf, es wurden jedoch keine Referenzen auf entfernte Ressourcen gefunden.
+OPF_019=Das 'spine'-Element wurde in der OPF-Datei nicht gefunden.
+OPF_020=Sehr viele 'spine'-Einträge gefunden!
+OPF_021=Nicht-definiertes URI-Schema im 'href'-Attribut benutzt: '%1$s'
+OPF_022=Ungültiger Pfad: '%1$s'
+OPF_024=Unbekannte EPUB-Versionsnummer gefunden: '%1$s'
+OPF_025=Der Eigenschaft '%1$s' kann nur ein einziger Wert zugewiesen werden.
+OPF_026=Ungültigen Eigenschaftswert gefunden: '%1$s'
+OPF_027=Nicht definierte Eigenschaft: '%1$s'
+OPF_028=Nicht definierter Präfix: '%1$s'
+OPF_029=Die Datei '%1$s' scheint nicht vom MimeType '%2$s' zu sein, welcher in der OPF-Datei für diese Datei deklariert wurde.
+OPF_030=Das 'unique-identifier'-Attribut mit dem Wert '%1$s' wurde nicht gefunden.
+OPF_031=Der EPUB-'Guide' referenziert die Datei '%1$s' welche aber nicht im OPF-Manifest deklariert wurde.
+OPF_032=Der EPUB-'Guide' referenziert die Datei '%1$s' welche kein gültiges EPUB-Inhaltsdokument ist.
+OPF_033=Der EPUB-'Spine' enthält keine Einträge die als 'linear' gekennzeichnet sind.
+OPF_034=Der EPUB-'Spine' enthält mehrfache Referenzen auf die manifestierte Datei mit der ID '%1$s'.
+OPF_035=Der MimeType 'text/html' ist für XHTML/OPS nicht gültig.
+OPF_035_SUG= Verwende stattdessen 'application/xhtml+xml'.
+OPF_036=Der Video-MimeType '%1$s' wird unter Umständen nicht von allen Lesegeräten unterstützt.
+OPF_036_SUG=Erlaubt sind 'video/mp4', 'video/h264' oder 'video/webm'.
+OPF_037=Veralteter MimeType '%1$s'.
+OPF_038=Der MimeType '%1$s' ist im Kontext von OEBPS 1.2 nicht gültig. Bitte stattdessen 'text/x-oeb1-document' verwenden.
+OPF_039=Der MimeType '%1$s' ist im Kontext von OEBPS 1.2 nicht gültig. Bitte stattdessen 'text/x-oeb1-css' verwenden.
+OPF_040=Der Fallback-Eintrag konnte nicht gefunden werden.
+OPF_041=Der 'style'-Fallback-Eintrag konnte nicht gefunden werden.
+OPF_042='%1$s' ist kein im 'Spine' erlaubter MimeType (laut OPF-Standard).
+OPF_043=Ein 'spine'-Eintrag mit MimeType '%1$s' ist nicht erlaubt und enthält auch kein Fallback.
+OPF_044=Ein 'spine'-Eintrag mit MimeType '%1$s' ist nicht erlaubt und er enthält einen Fallback zu einem im 'Spine' nicht erlaubten MimeType.
+OPF_045=Nicht erlaubter zirkulärer/gegenseitiger Bezug von Fallback-Referenzen.
+OPF_046=Die "scripted"-Eigenschaft ist am mediaType-Handler nicht gesetzt.
+OPF_047=Die OPF-Datei nutzt OEBPS-1.2-Syntax, welche Abwärtskompatibilität gewährleistet.
+OPF_048=Am 'package'-Element fehlt das erforderliche 'unique-identifier'-Attribut.
+OPF_049=Die Datei '%1$s' wurde nicht im OPF-Manifest gefunden.
+OPF_050=Das TOC-Attribut referenziert eine Ressource ohne NCX-MimeType; erwartet wird aber der MimeType 'application/x-dtbncx+xml'.
+OPF_051=Die Bild-Abmessungen überschreiten die empfohlenen Maße.
+OPF_052=Wert des 'role'-Attributs am Element 'dc:creator' ist ungültig: '%1$s'
+OPF_053=Datumseintrag '%1$s' folgt nicht dem vorgegebenen Schema aus http://www.w3.org/TR/NOTE-datetime : %2$s
+OPF_054=Datumseintrag '%1$s' ist invalide per Definition (siehe http://www.w3.org/TR/NOTE-datetime): %2$s
+OPF_055='%1$s'-Element ist leer.
+OPF_056=MimeType '%1$s' ist kein gültiger Audio-MimeType.
+OPF_056_SUG=Erlaubt sind 'audio/mp3', 'audio/mp4' oder 'audio/ogg'.
+OPF_057=Die Bild-Dateigröße überschreiten die empfohlenen Vorgaben.
+OPF_058='spine'-Eintrag wird nicht aus der '.ncx'-Datei referenziert.
+OPF_058_SUG=Jeder 'spine'-Eintrag im OPF-Manifest sollte von mindestens einem TOC-Eintrag in der '.ncx'-Datei referenziert werden.
+OPF_059='spine'-Eintrag wird nicht aus der Navigationsdatei referenziert.
+OPF_059_SUG=Jeder 'spine'-Eintrag im OPF-Manifest sollte von mindestens einem 'nav'-Eintrag in der Navigationsdatei referenziert werden.
+OPF_060=Doppelte Datei im EPUB-Archiv: '%1$f'
+OPF_061=Doppelte Datei im EPUB-Archiv (nach Unicode-NFC-Normalisierung): '%1$f'
+OPF_062=Adobe "page-map" Attribut am 'spine'-Element der OPF-Datei gefunden.
+OPF_063=Die in der Adobe 'page-map' referenzierte Datei '%1$s' wurde nicht im OPF-Manifest gefunden.
+
+#Package
+PKG_001=Validierung gegen den EPUB-Standard Version %1$s, es wurde aber die EPUB-Version %2$s entdeckt.
+PKG_003=Der EPUB Datei-Header kann nicht ausgelesen werden. Diese EPUB-Datei scheint kaputt zu sein.
+PKG_004=Fehlerhafter EPUB ZIP-Header.
+PKG_005=Die 'mimetype'-Datei hat ein Extra Field der Länge %1$s. Die Verwendung des Extra-Field-Features des ZIP-Formats ist für die 'mimetype'-Datei nicht erlaubt.
+PKG_006=MimeType-Eintrag fehlt oder ist nicht der Erste im EPUB-Archiv.
+PKG_007=Die Mimetype-Datei darf nur den String 'application/epub+zip' als Inhalt haben!
+PKG_008=Kann die Datei '%1$s' nicht lesen.
+PKG_009=Dateiname enthält Zeichen die nicht in OCF-Dateinamen erlaubt sind: %1$s
+PKG_010=Dateiname enthält Leerzeichen! Leerzeichen sollten vermieden werden.
+PKG_011=Dateiname darf nicht mit einem Punkt '.' enden.
+PKG_012=Dateiname enthält die folgenden Nicht-ASCII-Zeichen: '%1$s'. Versuche den Dateinamen zu ändern!
+PKG_013=Das EPUB enthält mehrere OPS-Darstellungen ('renditions').
+PKG_014=Das EPUB enthält ein leeres Verzeichnis: %1$s
+PKG_015=Folgende Inhalte des EPUBs können nicht gelesen werden: %1$s
+PKG_016=Benutze nur Kleinbuchstaben für die EPUB-Dateiendung um die Kompatibilität zu erhöhen.
+PKG_016_SUG=Es sollte '.epub' verwendet werden.
+PKG_017=Ungewöhnliche EPUB-Dateiendung.
+PKG_017_SUG=Es sollte '.epub' verwendet werden.
+PKG_018=Die EPUB-Datei wurde nicht gefunden.
+PKG_020=Die OPF-Datei '%1$s' wurde nicht gefunden.
+PKG_021=Fehlerhafte Bild-Datei gefunden.
+PKG_022=Falsche Dateiendung für das Bild. Es ist eine '%1$s'-Datei, besitzt aber die Dateiendung '%2$s'.
+
+#Resources
+RSC_001=Datei '%1$s' wurde nicht gefunden.
+RSC_002=Benötigte Datei 'META-INF/container.xml' fehlt.
+RSC_003=Es wurde kein 'rootfile'-Element mit MimeType 'application/oebps-package+xml' im EPUB gefunden.
+RSC_004=Die DRM-geschützte Datei '%1$s' kann nicht entschlüsselt werden.
+RSC_005=Validierungsfehler: %1$s
+RSC_006=Verlinkte Ressourcen sind nicht erlaubt. Platzieren Sie den Inhalt stattdessen im EPUB selbst.
+RSC_006_SUG=Remote-Ressourcen sind nur für Audio und Video erlaubt!
+RSC_007=Die Datei wurde im EPUB nicht gefunden.
+RSC_008=Die referenzierte Datei ist im OPF-Manifest nicht deklariert.
+RSC_009=Im 'src'-Attribut am 'img'-Element darf keine 'fragment identifier' (ID-Referenz) angegeben werden.
+RSC_010=Referenz auf eine Ressource gefunden, die laut Standard nicht erlaubt ist.
+RSC_011=Referenz auf eine Ressource gefunden, die nicht im OPF 'Spine' deklariert ist.
+RSC_012=Fragmentbezeichner ist nicht angegeben.
+RSC_013=Fragmentbezeichner wird in einem Link zu einem Stylesheet-Dokument genutzt.
+RSC_014=Fragmentbezeichner an einer inkompatiblen Ressource.
+RSC_015=Das SVG-Element <use> benötigt zwingend einen Fragmentbezeichner zur Referenzierung.
+RSC_016=Schwerer Fehler beim Parsen der Datei '%1$s'.
+RSC_017=Warnung beim Parsen der Datei '%1$s'.
+RSC_018=Bildatei '%1$s' wurde nicht gefunden.
+
+#Scripting
+SCP_001=Die Nutzung der JavaScript-Funktion 'eval()' in EPUBs ist ein Sicherheitsrisiko!
+SCP_002=Die Nutzung der JavaScript-Funktionalität 'XMLHttpRequest' in EPUBs ist ein Sicherheitsrisiko!
+SCP_003="Local Storage" und "Session Storage" werden derzeit nicht unterstützt.
+SCP_004=Datei enthält ein Skript welches in EPUB 2 derzeit nicht unterstützt wird.
+SCP_005=Datei enthält ein Skript, wurde aber im OPF nicht als 'scripted' gekennzeichnet.
+SCP_006=Inzeilige JavaScript-Anweisungen gefunden.
+SCP_007=Skript nutzt 'innerHtml'.
+SCP_007_SUG=Benutze besser einen DOM-Handler.
+SCP_008=Skript nutzt 'innerText'.
+SCP_008_SUG=Benutze besser 'textContent'.
+SCP_009=Datei nutzt Maus-EventHandler.
+SCP_009_SUG=Stelle sicher, dass alle Maus-basierten Events auch per Tastatur oder Touch-Eingabe funktionieren.
+SCP_010=EPUB 3 Inhaltsdatei enthält Skripte.
+
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties
new file mode 100644
index 0000000..cc7faf5
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties
@@ -0,0 +1,277 @@
+# This is the spanish translation of MessageBundle.properties file
+# Traducido por por Emiliano Molina (www.cuadratin.es)
+
+#Accessibility
+ACC_001=los elementos HTML 'img' o 'area' no tienen atributo 'alt'.
+ACC_002=el elemento HTML 'input' no se referencia adecuadamente mediante un elemento que lo etiquete.
+ACC_003=los elementos HTML no textuales deben incluir un atributo 'title' para favorecer la accesibilidad.
+ACC_004=el elemento HTML 'a' debe contener texto.
+ACC_005=Las celdas de cabecera de tabla deben identificarse con etiquetas 'th' para favorecer la accesibilidad.
+ACC_006=Las tablas debe tener un elemento 'thead' para favorecer la accesibilidad.
+ACC_007=Los archivos de contenido no utilizan el atributo 'epub:type' para asignar semántica.
+ACC_008=El archivo de navegación o índice no contiene un elemento 'landmarks nav'.
+ACC_009=MathML debe tener un atributo de texto 'alt' o un elemento annotation-xml hijo.
+ACC_010=Los encbezados no deben utilizarse dentro de etiquetas 'blockquote' o 'figure'.
+ACC_011=Los elementos enlazados dentro de SVG deben incluir un atributo xlink:title.
+ACC_012=Las tablas deben incluir un elemento 'caption'.
+ACC_013=Un archivo de contenido tiene al menos una declaración interna de estilo.
+ACC_013_SUG=Los estilos internos no son compatibles con las opciones de accesibilidad y ajustes personalizados. Utilice estilos CSS.
+ACC_014=El valor de la propiedad CSS 'font-size' no usa medidas relativas.
+ACC_014_SUG=Los valores válidos incluyen porcentajes, unidades em, 'larger', 'smaller', 'normal' o 'inherit'.
+ACC_015=El valor de la propiedad CSS 'line-height' no usa medidas relativas.
+ACC_015_SUG=Los valores válidos incluyen porcentajes, unidades numéricas, 'larger', 'smaller', 'normal' o 'inherit'.
+ACC_016=El valor de la propiedad CSS 'font-size' debe usar medidas relativas.
+ACC_016_SUG=Los valores válidos incluyen porcentajes, unidades em, 'larger', 'smaller', 'normal' o 'inherit'.
+ACC_017=El valor de la propiedad CSS 'line-height' debe usar medidas relativas.
+ACC_017_SUG=Los valores válidos incluyen porcentajes, unidades numéricas, 'larger', 'smaller', 'normal' o 'inherit'.
+
+#Checker Errors
+CHK_001=El archivo de mensajes persoanlizado no se encuentra.
+CHK_002=Id de mensaje personalizado no reconocido %1$s hallado en archivo de mensajes personalizado '%2$s'.
+CHK_003=Gravedad de mensaje personalizad no reconocido '%1$s' hallado en archivo de mensajes personalizado '%2$s'.
+CHK_004=El mensaje personalizado contiene demasiados parámetros en archivo de mensajes personalizado '%1$s'.
+CHK_005=La sugerencia personalizada contiene demasiados parámetros en archivo de mensajes personalizado '%1$s'.
+CHK_006=No es posible analizar el parámetro de formato hallado en archivo de mensajes personalizado '%1$s'.
+CHK_007=Error hallado en archivo de mensajes personalizado '%1$s': "%2$s".
+
+#CSS
+CSS_001=La propiedad \'%1$s\' no debe incluirse en la hoja de estilos del ePub.
+CSS_002=Se ha encontrado una referencia vacía o NULL.
+CSS_003=Solo se permiten codificaciones UTF-8 y UTF-16: detectado %1$s.
+CSS_004=Solo se permiten codificaciones UTF-8 y UTF-16: detectado %1$s BOM.
+CSS_005=Se han encontrado conflictos con alternancias de estilos: %1$s.
+CSS_006=La propiedad CSS 'position:fixed' no debe utilizarse en EPUBs.
+CSS_007=La propiedad 'font-face' %1$s hace referencia a un tipo de fuente no estándar %2$s.
+CSS_008=Ha ocurrido un error analizando el archivo CSS: %1$s.
+CSS_009=El uso de elementos CSS como columnas, transformaciones, transiciones, modelos de caja o KeyFrames puede causar errores de paginación.
+CSS_010=La hoja de estilos no es válida: no tiene un formata estándar.
+CSS_011=Número excesivo de archivos CSS.
+CSS_011_SUG=Valore la posibilidad de combinar archivos CSS en un solo archivo.
+CSS_012=El documento enlaza a múltiples archivos CSS.
+CSS_013=La propiedad CSS se declara como !important.
+CSS_015=La hoja de estilos alternativa no tiene un título.
+CSS_016=La hoja de estilos alternativa precede a la principal.
+CSS_017=El selector CSS especifica una posición absoluta.
+CSS_019=La propiedad CSS 'font-face' no contiene atributos.
+CSS_020=La declaración CSS de selección de fuente utilizada un valor 'font-size' no válido: '%1$s'.
+CSS_020_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
+CSS_021=La propiedad CSS 'font-family' especifica una fuente de sistema no válida.
+CSS_021_SUG=Los valores válidos incluyen 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar' o 'inherit'.
+CSS_022=El selector CSS especifica un valor de margen global.
+CSS_023=El selector CSS especifica un media query.
+CSS_024=El selector de clase CSS no se utiliza.
+CSS_024_SUG=Elimine los selectores CSS no usados.
+CSS_025=No se encuentra el selector de clase CSS.
+CSS_025_SUG=Compruebe la sintaxis o defina un selector de clase para documentar el uso de la clase.
+CSS_027=El selector CSS especifica una posición absoluta.
+CSS_028=Uso de declaración 'font-face'.
+
+#HTM - XHTML related messages
+HTM_001=Los recursos con media type basados en XML deben ser documentos XML 1.0 válidos. La versión XML utilizada es: %1$s.
+HTM_002=El analizador XML instalado no soporta la verificación de versiones XML. Los archivos XML deben ser documentos XML 1.0 válidos.
+HTM_003=No se permiten entidades externas en documentos ePub v3. Se ha encontrado la siguiente entidad externa: %1$s.
+HTM_004=El DOCTYPE no es válido: se ha encontrado '%1$s', y se esperaba '%2$s'.
+HTM_005=Se ha encontrado una referencia externa.
+HTM_006=Se ha encontrado una entidad XHTML.
+HTM_007=El valor del atributo ssml:ph está vacío o solo contiene espacios.
+HTM_008=El atributo src es obligatorio.
+HTM_009=El DOCTYPE incluido está obsoleto o es irregular y puede ser eliminado.
+HTM_010=Se ha encontrado el espacio de nombre '%1$s'.
+HTM_011=No se ha declarado la entidad.
+HTM_011_SUG=Defina la entidad o utilice la entidad numerada en su lugar.
+HTM_012=Se ha encontrado un enlace al CFI en un libro externo.
+HTM_013=Se han encontrado CFIs interno en el documento.
+HTM_014=Extensión de archivo no válida en el archivo HTML: se esperaba html, htm o xhtml.
+HTM_014a=El bombre de archivo para el documento XHTML '%1$s' dbería tener la extensión '.xhtml'.
+HTM_015=Definición DOCTYPE HTML4 dentro de un ePub v3.
+HTM_016=Definición DOCTYPE HTML5 dentro de un ePub v2.
+HTM_017=El archivo tiene valores de idioma diferentes en los atributos xml:lang y lang.
+HTM_018=El archivo tiene una definición de idioma no válida en el atributo xml:lang.
+HTM_019=El archivo tiene una definición de idioma no válida en el atributo lang.
+HTM_020=El archivo no contiene un atributo xml:lang.
+HTM_021=El archivo no contiene un atributo lang.
+HTM_022=El documento puede contener un número excesivo de etiquetas <div> o <span>.
+HTM_022_SUG=Combine las etiquetas <div> y <span> cuando sean consecutivas y utilice el mismo estilo.
+HTM_023=Se ha encontrado una entidad XHTML no válida: '%1$s'.
+HTM_023_SUG=Compruebe la sintaxis o utilice entidades numeradas en su lugar.
+HTM_024=Se ha encontrado una entidad XHTML. Solo se permiten '&' ''' '"e;' '<' o '>'.
+HTM_024_SUG=Compruebe la sintaxis o utilice entidades numeradas en su lugar.
+HTM_025=Se ha encontrado un tipo de esquema URI no registrado en el atributo href.
+HTM_027=La lista contiene menos de 2 elementos.
+HTM_027_SUG=Las listas deberían tener más de un elemento para favorecer la accesibilidad.
+HTM_028=Los elementos HTML input deben incluir una id.
+HTM_029=Los elementos HTML label deben incluir un atributo 'for' que haga referencia a la id de un elemento input.
+HTM_033=El elemento HTML 'head' no tiene un elemento hijo 'title'.
+HTM_036=Se desaconseja el uso de iframes.
+HTM_038=Asegúrese que los elementos b, i, em y strong se utilizan de acuerdo con las directivas HTML5 del W3C.
+HTM_038_SUG=Los estilos CSS son más apropiados para marcar el texto en negritas o cursivas.
+HTM_043=Los elementos SVG deben incluir atributos xml:lang y lang.
+HTM_044=El espacio de nombre URI '%1$s' está incluido, pero no se ha utilizado.
+HTM_044_SUG=Elimine espacios de nombre URI no utilizados.
+HTM_045=Se ha encontrado un href vacío.
+HTM_045_SUG=Los hrefs vacíos son auto-referencias válidas. Deben ser validados para asegurarse de que se incluyen intencionadamente.
+HTM_046=Un elemento con formato fijo no tiene medidas definidas para el viewport.
+HTM_046_SUG=Una declaración viewport es obligatoria para elementos con formato fijo.
+HTM_047=El viewport HTML no tiene atributo height y/o width.
+HTM_047_SUG=El viewport debe declarar tanto la anchura (width) como la altura (height).
+HTM_048=El SVG ViewBox no se encuentra en el documento de formato fijo.
+HTM_048_SUG=La declaración viewBox es obligtoria para documentos con formato fijo.
+HTM_049=El elemento html no tiene una declaración xmlns que apunte a 'http://www.w3.org/1999/xhtml'.
+HTM_049_SUG=Añada xmlns="http://www.w3.org/1999/xhtml" al elemento html.
+HTM_050=Se ha encontrado un atributo epub:type="pagebreak" en el documento.
+
+#media
+MED_001=El poster de vídeo debe ser un tipo de imagen soportado.
+MED_002=El elemento %1$s no incluye fallback.
+MED_003=Se ha encontrado un recurso de imagen no estándar de tipo %1$s.
+MED_004=La cabecera del archivo de imagen puede estar dañada.
+MED_005=Se ha encontrado un recurso de audio Media Overlay %1$s que hace referencia a un tipo de audio no estándar %2$s.
+MED_006=Algunos navegadores no soportan imágenes SVG que utilizan nombres de archivo en la propiedad xlink:href.
+
+#NAV ePub v3 Table of contents
+NAV_001=El archivo nav no está soportado en ePub v2.
+NAV_002=Se ha encontrado epub:type="page-list" en el archivo nav.
+
+#NCX ePub v2 Table of Contents
+NCX_001=No se han podido ejecutar los test de NCX Schematron: %1$s.
+NCX_002=No se ha encontrado un atributo toc en el elemento spine.
+NCX_003=Un archivo .ncx es obligatorio para la navegación en un ePub v2.
+NCX_004=Un identificador NCX no concuerda con el identificador ocf: %1$s
+NCX_005=Se ha encontrado un elemento ncx "page-list" en un archivo .ncx
+
+#OPF
+OPF_001=Ha ocurrido un error analizando la versión del ePub: %1$s.
+OPF_002=El archivo OPF '%1$s' no se encuentra en el ePub.
+OPF_003=El elemento '%1$s' existe en el ePub, pero no está declarado en la sección <manifest> del archivo OPF.
+OPF_004=Prefijo de declaración no válido: no está permitidos espacios iniciales o finales.
+OPF_004a=Prefijo de declaración no válido: se ha encontrado un prefijo vacío.
+OPF_004b=Prefijo no válido '%1$s': debe ser un nombre válido sin puntuación (aka 'NCName').
+OPF_004c=Prefijo de declaración no válido: el prefijo '%1$s' debe estar inmediatemente seguido de dos puntos (':').
+OPF_004d=Prefijo de declaración no válido: el prefijo '%1$s' debe estar separado de su URI por un espacio.
+OPF_004e=Prefijo de declaración no válido: se ha encontrado un espacio no permitido entre el prefijo y la URI.
+OPF_004f=Prefijo de declaración no válido: se ha encontrado un espacio no permitido entre los mapeados del prefijo.
+OPF_005=Prefijo de declaración no válido: el URI para el prefijo '%1$s' no existe.
+OPF_006=Prefijo de declaración no válido: el URI '%1$s' no es un URI válido.
+OPF_007=Se ha declarado de nuevo un prefijo reservado: '%1$s'.
+OPF_007a=Mapeado de prefijo no válido: el prefijo '_' no se debe declarar.
+OPF_007b=Mapeado de prefijo no válido: el término por defecto '%1$s' no debe volver a declararse.
+OPF_008=El manejador vinculado a los media-type por defecto '%1$s' no está permitido.
+OPF_009=The media-type %1$s has already been assigned handler '%2$s'.
+OPF_010=Se ha producido un error con la referencia: '%1$s'.
+OPF_011=El elemento itemref no puede tener asignadas a la vez las propiedades page-spread-right y page-spread-left.
+OPF_012=La propiedad de elemento '%1$s' no está definida con el media-type '%2$s'.
+OPF_013=La propiedad type '%1$s' en la etiqueta objeto no concuerda con el media-type '%2$s' declarado en la sección <manifest> del archivo OPF.
+OPF_014=La propiedad '%1$s' debe declararse en el archivo OPF.
+OPF_015=La propiedad '%1$s' no debe estar declarada en el archivo OPF.
+OPF_016=El elemento \"rootfile\" no presenta su atributo \"full-path\", el cual es obligatorio.
+OPF_017=El atributo \"full-path\" del elemento \"rootfile\" no debe estar vacío.
+OPF_018=La propiedad 'remote-resources' se ha declarado en el archivo OPF, pero no se han encontrado referencias a recursos externos. Compruebe que la propiedad es necesaria.
+OPF_019=No se ha encontrado la sección <spine> en el archivo OPF.
+OPF_020=Hay un número excesivo de elementos dentro de la sección <spine>.
+OPF_021=Uso de un esquema URI no registrado en href: '%1$s'.
+OPF_022=Ruta no válida: '%1$s'.
+OPF_024=Se ha encontrado una versión ePub desconocida %1$s.
+OPF_025=La propiedad '%1$s' solo puede tener un valor.
+OPF_026=Se ha encontrado un valor de propiedad erróneo: '%1$s'.
+OPF_027=Propiedad no definida: '%1$s'.
+OPF_028=Prefijo no declarado: '%1$s'.
+OPF_029=El archivo '%1$s' no concuerda con el media-type %2$s tal y como se especifica en el archivo OPF.
+OPF_030=No se ha encontrado el identificador único '%1$s'.
+OPF_031=El archivo mencionado en la sección <guide> no se ha declarado en la sección <manifest> del archivo OPF: %1$s.
+OPF_032=La referencia en <guide> '%1$s' no es válida según 'OPS Content Document'.
+OPF_033=La sección <spine> contiene recursos no lineales.
+OPF_034=La sección <spine> contiene múltiples referencias al elemento con id '%1$s' de la sección <manifest>.
+OPF_035=La declaración media-type 'text/html' no es correcta para XHTML/OPS.
+OPF_035_SUG=Utilice en su lugar 'application/xhtml+xml'.
+OPF_036=El formato de vídeo '%1$s' podría no estar soportado por algunos sistemas de lectura.
+OPF_036_SUG=Utilice en su lugar 'video/mp4', 'video/h264' o 'video/webm'.
+OPF_037=Se ha encontrado un media-type obsoleto: '%1$s'.
+OPF_038=El media-type '%1$s' no es recomendable en un contexto OEBPS 1.2: utilice en su lugar 'text/x-oeb1-document'.
+OPF_039=El media-type '%1$s' no es recomendable en un contexto OEBPS 1.2: utilice en su lugar 'text/x-oeb1-css'.
+OPF_040=No se ha encontrado ningún elemento fallback.
+OPF_041=No se ha encontrado ningún elemento fallback de estilo.
+OPF_042='%1$s' no es un media-type permitido en <spine>.
+OPF_043=El elemento '%1$s' de <spine> con un media-type no estándar carece de fallback.
+OPF_044=El elemento '%1$s' de <spine> con un media-type no estándar tiene un fallback que apunta a un media-type no estándar.
+OPF_045=Se ha encontrado una referencia recursiva en la cadena de fallback.
+OPF_046=La propiedad con script no está definida en el manejador del media-type.
+OPF_047=El archivo OPF utiliza la sintaxis OEBPS 1.2 que permite compatibilidad hacia atrás.
+OPF_048=La etiqueta package no tiene atributo unique-identifier ni valor para el mismo: ambos son oligatorios.
+OPF_049=La id de elemento '%1$s' no se ha encontrado en <manifest>.
+OPF_050=El atributo TOC hace referencia a un recurso con un mime type que no es ncx: se esperaba 'application/x-dtbncx+xml'.
+OPF_051=Las dimensiones de la imagen exceden el tamaño recomendado.
+OPF_052=El valor de role '%1$s' no es válido.
+OPF_053=El valor de date '%1$s' no sigue la sintaxis recomendada por http://www.w3.org/TR/NOTE-datetime:%2$s.
+OPF_054=El valor de date '%1$s' no es válido según http://www.w3.org/TR/NOTE-datetime:%2$s.
+OPF_055=La etiqueta %1$s está vacía.
+OPF_056=El media-type '%1$s' no es un mimetype de audio recomendado.
+OPF_056_SUG=Utilice en su lugar 'audio/mp3', 'audio/mp4' o 'audio/ogg'.
+OPF_057=El tamaño del archivo de imagen excede el tamaño recomendado.
+OPF_058=Un elmento de <spine> no tiene referencia en una entrada del TOC.
+OPF_058_SUG=Cada elemento de <spine> debe estar referenciado por al menos una entrada del TOC.
+OPF_059=Un elmento de <spine> no tiene referencia en una entrada del NAV.
+OPF_059_SUG=Cada elemento de <spine> debe estar referenciado por al menos una entrada del NAV.
+OPF_060=Entrada duplicada en el archivo ZIP: '%1$f'.
+OPF_061=Entrada duplicada en el archivo ZIP (tras la normalización Unicode NFC) '%1$f'.
+OPF_062=Se ha encontrado un atributo page-map de Adobe en un elemento de <spine> en el archivo OPF.
+OPF_063=El elemento page-map de Adobe '%1$s' referenciado no se ha encontrado en <manifest>.
+
+#Package
+PKG_001=Se valida el ePub con la versión %1$s pero se ha detectado la versión %2$s.
+PKG_003=No se puede leer la cabecera del ePub. Parece que el ePub está corrupto.
+PKG_004=Cabecera de archivo ZIP corrupta.
+PKG_005=El archivo mimetype tiene una extensión de longitud %1$s. No se permiten extensiones de archivo para el archivo mimetype.
+PKG_006=El archivo mimetype no existe o no ocupa el primer lugar dentro del ePub.
+PKG_007=El archivo mimetype solo debe contener la cadena 'application/epub+zip'.
+PKG_008=No se puede leer el archivo '%1$s'.
+PKG_009=El nombre de archivo contiene caracteres no permitidos para nombres de archivo OCF: '%1$s'.
+PKG_010=El nombre de archivo contiene espacios, por lo que deben incluirse en el URI. Es recomendable eliminar los espacios del nombre de archivo.
+PKG_011=El nombre de archivo no puede terminar con '.'.
+PKG_012=El nombre de archivo contiene los siguientes caracteres no ascii: %1$s. Es recomendable cambiar el nombre de archivo.
+PKG_013=El archivo ePub incluye múltiples interpretaciones OPS.
+PKG_014=El ePub contiene un directorio vacío: '%1$s'.
+PKG_015=No se pueden leer los contenidos del ePub: %1$s
+PKG_016=Utilice solo minúsculas para la extensión del archivo ePub para asegurar la compatibilidad.
+PKG_016_SUG=Para asegurar la compatibilidad utilice '.epub'.
+PKG_017=Extensión de archivo ePub no estándar.
+PKG_017_SUG=Para asegurar la compatibilidad utilice '.epub'.
+PKG_018=No se encuentra el archivo ePub.
+PKG_020=No se encuentra el archivo OPF '%1$s'.
+PKG_021=Se ha encontrado un archivo de imagen corrupto.
+PKG_022=Extensión de archivo de imagen incorrecto. La imagen es un archivo '%1$s' pero tiene una extensión '%2$s'.
+
+#Resources
+RSC_001=No se encuentra el archivo '%1$s'.
+RSC_002=No se encuentra el recurso obligatorio META-INF/container.xml.
+RSC_003=No se ha encontrado en el contenedor una etiqueta de archivo raíz con media type 'application/oebps-package+xml'.
+RSC_004=El archivo '%1$s' no se ha podido desencriptar.
+RSC_005=Error al analizar el archivo '%1$s'.
+RSC_006=No se permite la referencia al recurso remoto: el recurso debe estar en el OCF.
+RSC_006_SUG=Solo están permitidos recursos remotos de audio y vídeo.
+RSC_007=El recurso referenciado no se encuentra en el ePub.
+RSC_008=El recurso referenciado no está declarado en el <manifest> del archivo OPF.
+RSC_009=No se debe utilizar un identificador fragmentado con un atributo img src.
+RSC_010=Se ha encontrado una referencia a un tipo de recurso no estándar.
+RSC_011=Se ha encontrado una referencia a un recurso que no es un elemento incluido en <spine>.
+RSC_012=No se ha definido el identificador fragmentado.
+RSC_013=Se ha utilizado el identificador fragmentado como referencia a un recurso de hoja de estilos.
+RSC_014=El identiicador fragmentado define un tipo de recurso incompatible.
+RSC_015=Es obligatorio el uso de un identificador fragmentado para referencias a etiquetas svg.
+RSC_016=Error fatal al analizar el archivo '%1$s'.
+RSC_017=Aviso al analizar el archivo '%1$s'.
+RSC_018=No se encuentra el archivo Altimg '%1$s'.
+
+#Scripting
+SCP_001=La utilización de la función de Javascript eval() en ePub constituye un riesgo de seguridad.
+SCP_002=La utilización de XMLHttpRequest en ePub constituye un riesgo de seguridad.
+SCP_003=El almacenamiento local o de sesión no está soportado por ahora.
+SCP_004=El archivo contiene scripts no soportados en ePub v2.
+SCP_005=El archivo contiene scripts, pero no se ha especificado en el archivo OPF.
+SCP_006=Se han encontrado scripts integrados.
+SCP_007=El script hace referencia a 'innerHtml'.
+SCP_007_SUG=Utilice en su lugar el DOM.
+SCP_008=El script hace referencia a 'innerText'.
+SCP_008_SUG=Utilice en su lugar 'textContent'.
+SCP_009=El archivo utiliza manejadores de eventos de ratón.
+SCP_009_SUG=Asegúrese de que las funcionalidades relativas al ratón son accesibles mediante teclado o acciones táctiles.
+SCP_010=El archivo Epub 3 contiene script.
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties
new file mode 100644
index 0000000..bba0bc0
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties
@@ -0,0 +1,287 @@
+# This is the French translation of MessageBundle.properties file.
+# Voici la traduction française du fichier MessageBundle.properties.
+
+#Accessibility
+#Accessibilité
+ACC_001=Les éléments HTML 'img' ou 'area' n'ont pas d'attribut 'alt'.
+ACC_002=L'élément HTML 'input' n'est pas référencé par un élément 'label' correspondant.
+ACC_003=Les éléments HTML non-textuels devraient inclure un attribut 'title' pour l'accessibilité.
+ACC_004=L'élément HTML 'a' doit avoir du texte.
+ACC_005=Les cellules de l'en-tête du tableau devraient être identifiées par des éléments 'th' pour l'accessibilité.
+ACC_006=Les tableaux devraient inclure un élément 'thead' pour l'accessibilité.
+ACC_007=Les documents de contenu (Content Documents) n'utilisent pas l'attribut 'epub:type' pour l'inflexion sémantique (semantic inflection).
+ACC_008=Le document de navigation (Navigation Document) n'a pas d'élément 'landmarks nav'.
+ACC_009=MathML devrait avoir soit un attribut 'alttext' soit un élément fils 'annotation-xml'.
+ACC_010=Les titrailles ne devrait pas être utilisées au sein des éléments 'blockquote' et 'figure'.
+ACC_011=Les éléments 'link' au sein de SVG devraient inclure un attribut 'xlink:title'.
+ACC_012=Les éléments 'table' devraient inclure un élément 'caption'.
+ACC_013=Le contenu du fichier contient au moins une déclaration de style en ligne (inline style declaration).
+ACC_013_SUG=Les styles en ligne (inline styles) ne sont pas compatibles avec les paramètres d'accessibilité et de personnalisation de l'affichage. Utilisez les styles CSS à la place.
+ACC_014=La valeur de la propriété CSS 'font-size' n'utilise pas une taille relative.
+ACC_014_SUG=Les valeurs acceptées sont les pourcentages, les multiples em, 'larger', 'smaller', 'normal' ou 'inherit'.
+ACC_015=La valeur de la propriété CSS 'line-height' n'utilise pas une taille relative.
+ACC_015_SUG=Les valeurs acceptées sont les pourcentages, les multiples numériques, les multiples em, 'normal' ou 'inherit'.
+ACC_016=La valeur de la propriété CSS 'font-size' devrait utiliser une taille relative.
+ACC_016_SUG=Les valeurs acceptées sont les pourcentages, les multiples em, 'larger', 'smaller', 'normal' ou 'inherit'.
+ACC_017=La valeur de la propriété CSS 'line-height' n'utilise pas une taille relative.
+ACC_017_SUG=Les valeurs acceptées sont les pourcentages, les multiples numériques, les multiples em, 'normal' ou 'inherit'.
+
+#Checker Errors
+#Erreur du programme de contrôle
+CHK_001=Le fichier personnalisé des remplacements de message est introuvable.
+CHK_002=Id du message personnalisé '%1$s' rencontré dans le fichier des remplacements de message '%2$s' non reconnu.
+CHK_003=La gravité du message personnalisé '%1$s' rencontrée dans le fichier des remplacements de message '%2$s' non reconnue.
+CHK_004=Le message personnalisé contient trop de paramètres dans le fichier des remplacements de message '%1$s'.
+CHK_005=La suggestion personnalisée contient trop de paramètres dans le fichier des remplacements de message '%1$s'.
+CHK_006=Impossible de parcourir le paramètre de format personnalisé dans le fichier des remplacements de message '%1$s'.
+CHK_007=Une erreur s'est produite lors du traitement du fichier de message personnalisé '%1$s': "%2$s".
+
+#CSS
+CSS_001=La propriété \'%1$s\' ne doit pas être incluse dans une feuille de style ePub.
+CSS_002=Référence vide ou NULL présente.
+CSS_003=Seuls les encodages UTF-8 et UTF-16 sont autorisés, '%1$s' détecté.
+CSS_004=Seuls les encodages UTF-8 et UTF-16 sont autorisés, '%1$s' BOM détecté.
+CSS_005=Attributs de style alternatif contradictoires trouvés : '%1$s'.
+CSS_006=La propriété CSS position:fixed ne devrait pas être utilisée dans des EPUBs.
+CSS_007=La référence font-face '%1$s' se réfère à une fonte de type non-standard '%2$s'.
+CSS_008=Une erreur s'est produite lors de l'analyse de la CSS : '%1$s'.
+CSS_009=L'utilisation de certaines parties CSS comme Columns, Transforms, Transitions, box-sizing ou KeyFrames peut causer des problèmes de pagination.
+CSS_010=Utilisation de feuille de style non-standard.
+CSS_011=Nombre excessif de fichiers CSS.
+CSS_011_SUG=Considérez la fusion de fichiers CSS pour réduire le nombre de fichiers CSS.
+CSS_012=Le document est relié à plusieurs fichiers CSS.
+CSS_013=La propriété CSS est déclarée !Important.
+CSS_015=La feuille de style alternative (Alternate Stylesheet) n'a pas de titre.
+CSS_016=La feuille de style alternative (Alternate Stylesheet) précède la feuille de style principale.
+CSS_017=Le sélecteur CSS spécifie une position absolue.
+CSS_019=La déclaration CSS font-face n'a pas d'attribut.
+CSS_020=La déclaration du sélecteur CSS font utilise une valeur 'font-size' '%1$s' inattendue.
+CSS_020_SUG=Les valeurs acceptées sont les pourcentages, les multiples em, 'larger', 'smaller', 'normal' ou 'inherit'.
+CSS_021=La propriété CSS raccourcie 'font-family' spécifie une Fonte Système (System Font) incorrecte.
+CSS_021_SUG=Les valeurs acceptées sont 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar' ou 'inherit'.
+CSS_022=Le sélecteur CSS spécifie le paramétrage de la marge globale.
+CSS_023=Le sélecteur CSS spécifie des media query.
+CSS_024=Le sélecteur CSS de classe n'est pas utilisé.
+CSS_024_SUG=Supprimez les sélecteurs CSS inutilisés.
+CSS_025=Le sélecteur CSS de classe est introuvable.
+CSS_025_SUG=Vérifiez les fautes de frappe ou définissez un sélecteur de classe pour attester de l'utilisation de la classe.
+CSS_027=Le sélecteur CSS spécifie une position absolue.
+CSS_028=Utilisation d'une déclaration font-face.
+
+#HTM - XHTML related messages
+#Messages liés à HTM - XHTML
+HTM_001=Tout document de référence qui a un mediatype basé sur XML doit être un document valide XML 1.0. Version XML trouvée : '%1$s'.
+HTM_002=Le parseur XML installé ne supporte pas la vérification de la version de XML. Les fichiers XML doivent être des documents valides XML 1.0.
+HTM_003=Les entités externes ne sont pas autorisées dans des documents ePub v3. Déclaration d'une entité externe trouvée : '%1$s'.
+HTM_004=DOCTYPE anormal : '%1$s' trouvé, '%2$s' attendu.
+HTM_005=Une référence externe a été trouvée.
+HTM_006=Une entité XHTML a été trouvée.
+HTM_007=Valeur de l'attribut ssml:ph vide ou composée uniquement d'espace(s).
+HTM_008=L'attribut src est requis.
+HTM_009=Le DOCTYPE fourni est obsolète ou anormal et peut être supprimé.
+HTM_010=L'URI de l'espace de noms '%1$s' a été trouvé.
+HTM_011=L'entité n'est pas déclarée.
+HTM_011_SUG=Définissez l'entité ou utilisez l'entité numérique à la place.
+HTM_012=Un lien vers un CFI dans un livre externe est présent.
+HTM_013=des Intra-Publication CFIs ont été trouvés dans le document.
+HTM_014=Extension de fichier incorrecte pour un fichier HTML, (html, htm ou xhtml) attendus.
+HTM_014a=Le nom de fichier du XHTML Content Document '%1$s' devrait avoir l'extension '.xhtml'.
+HTM_015=Définition de DOCTYPE HTML4 au sein d'un ePub v3.
+HTM_016=Définition de DOCTYPE HTML5 au sein d'un ePub v2.
+HTM_017=Le fichier de contenu a différentes valeurs de langage dans les attributs 'xml:lang' et 'lang'.
+HTM_018=Le fichier de contenu a une valeur de langage incorrecte dans l'attribut 'xml:lang'.
+HTM_019=Le fichier de contenu a une définition de langage incorrecte dans l'attribut 'lang'.
+HTM_020=Le fichier de contenu ne contient pas d'attribut xml:lang.
+HTM_021=Le fichier de contenu ne contient pas d'attribut lang.
+HTM_022=Le document pourrait contenir des balises DIV ou SPAN excessives.
+HTM_022_SUG=Fusionnez les éléments DIV ou SPAN quand ils sont consécutifs et utilisez le même style.
+HTM_023=Une entité XHTML incorrecte a été trouvée : '%1$s'.
+HTM_023_SUG=Vérifiez l'orthographe ou utilisez des entités numériques à la place.
+HTM_024=Une entité XHTML a été trouvé. Seules '&', ''', '"e;', '<' ou '>' sont autorisées.
+HTM_024_SUG=Vérifiez l'orthographe ou utilisez des entités numériques à la place.
+HTM_025=Type de protocole URI non-autorisé trouvé dans 'href'.
+HTM_027=La liste contient moins de 2 items.
+HTM_027_SUG=Les listes devraient avoir plus d'un item pour l'accessibilité.
+HTM_028=Les éléments HTML 'input' devraient inclure un id.
+HTM_029=Les éléments HTML 'label' devraient inclure un attribut 'for' référençant l'id d'un élément 'input'.
+HTM_033=L'élément HTML 'head' ne possède pas d'élément fils 'title'.
+HTM_036=Les iframes sont fortement déconseillés.
+HTM_038=Assurez vous que les éléments 'b', 'i', 'em' et 'strong' sont utilisés en accord avec les directives HTML5 du W3C.
+HTM_038_SUG=Les styles CSS sont généralement plus appropriés pour le texte italique ou gras.
+HTM_043=Les éléments 'svg' devraient inclure des attributs xml:lang et lang.
+HTM_044=L'URI de l'espace de nom '%1$s' est inclus mais pas utilisé.
+HTM_044_SUG=Supprimez les URI des espaces de noms inutilisés.
+HTM_045=href vide rencontré.
+HTM_045_SUG=href vides sont des auto-références valides. Ceux-ci devraient être validés pour s'assurer qu'il s'agit de l'intention voulue.
+HTM_046=L'item de format 'fixed' n'a pas de 'viewport' défini.
+HTM_046_SUG=Une déclaration de 'viewport' est requise pour les items de format 'fixed'.
+HTM_047=Il manque la hauteur (height) et/ou la largeur (width) pour le 'viewport' HTML.
+HTM_047_SUG=La déclaration du 'viewport' doit déclarer à la fois la largeur (width) et la hauteur (height).
+HTM_048=Le 'viewBox' SVG est manquant sur le document de format 'fixed'.
+HTM_048_SUG=Une déclaration de 'viewBox' est requise pour les documents de format 'fixed'.
+HTM_049=L'élément 'html' n'a pas de 'xmlns' déterminé par 'http://www.w3.org/1999/xhtml'.
+HTM_049_SUG=Ajoutez xmlns="http://www.w3.org/1999/xhtml" pour l'élément 'html'.
+HTM_050=Un attribut epub:type="pagebreak" est présent dans le document de contenu.
+
+#media
+#média
+MED_001=Le 'poster' de 'video' doit être un type d'image Core Media Type.
+MED_002=L'élément %1$s ne fournit pas de fallback.
+MED_003=Une ressource image non-standard de type '%1$s' a été trouvée.
+MED_004=L'en-tête du fichier image pourrait être corrompu.
+MED_005=La référence audio Media Overlay %1$s d'un type audio non-standard %2$s a été trouvée.
+MED_006=Certains navigateurs ne supportent pas les images rendues en SVG qui utilisent un nom de fichier dans la propriété xlink:href.
+
+#NAV ePub v3 Table of contents
+#Table des matières epub v3 NAV
+NAV_001=Le fichier nav n'est pas supporté pour les ePub v2.
+NAV_002=epub:type="page-list" a été trouvé dans le document nav.
+NAV_003=Une liste des pages (epub:type="page-list") est obligatoire dans le document de navigation lorsque des sauts de page (epub:type="pagebreak") sont présents dans les documents de contenu.
+
+#NCX ePub v2 Table of Contents
+#Table des matières epub v2 NCX
+NCX_001=Impossible d'effectuer les tests Schematron NCX : %1$s.
+NCX_002=L'attribut 'toc' est introuvable sur l'élément 'spine'.
+NCX_003=Un fichier .ncx est requis pour la navigation TOC au sein des lecteurs ePub v2.
+NCX_004=L'identifiant NCX ne correspond pas à l'identifiant OCF : %1$s.
+NCX_005="page-list" a été trouvé dans le fichier .ncx.
+
+#OPF
+OPF_001=Une erreur a été constatée lors du traitement de la version ePub : %1$s.
+OPF_002=Le fichier OPF '%1$s' est introuvable dans l'ePub.
+OPF_003=L'item '%1$s' existe dans l'ePub, mais n'est pas déclaré dans le manifest de l'OPF.
+OPF_004=Déclaration de préfixe incorrecte : les espaces avant ou après ne sont pas autorisés.
+OPF_004a=Déclaration de préfixe incorrecte : un préfixe vide a été trouvé.
+OPF_004b=Préfixe incorrect '%1$s' : il doit avoir un nom correct sans séparateur (alias 'NCName').
+OPF_004c=Déclaration de préfixe incorrecte : le préfixe '%1$s' doit être immédiatement suivi par un caractère double point (':').
+OPF_004d=Déclaration de préfixe incorrecte : '%1$s' doit être séparé par son URI avec un espace.
+OPF_004e=Déclaration de préfixe incorrecte : espace non-autorisé trouvé entre le préfixe et l'URI.
+OPF_004f=Déclaration de préfixe incorrecte : espace non-autorisé entre les mises en correspondance de préfixe.
+OPF_005=Déclaration de préfixe incorrecte : l'URI pour le préfixe '%1$s' n'existe pas.
+OPF_006=Déclaration de préfixe incorrecte : l'URI '%1$s' n'est pas une URI valide.
+OPF_007=Redéclaration du préfixe réservé '%1$s'.
+OPF_007a=Mise en correspondance de préfixe incorrecte : le préfixe '_' ne doit pas être déclaré.
+OPF_007b=Mise en correspondance de préfixe incorrecte : le vocabulaire par défaut ''%1$s'' ne doit pas être redéclaré.
+OPF_008=L'handler binding pour le Core Media Type '%1$s' n'est pas autorisé.
+OPF_009=Le media-type %1$s a déjà été attribué au handler '%2$s'.
+OPF_010=Erreur de résolution de la référence : '%1$s'.
+OPF_011=itemref ne peut pas avoir à la fois une propriété 'page-spread-right' et 'page-spread-left'.
+OPF_012=La propriété d'item '%1$s' n'est pas définie pour le media-type '%2$s'.
+OPF_013=Le type de propriété '%1$s' sur l'élément object ne correspond pas au media-type '%2$s' déclaré dans le manifest de l'OPF.
+OPF_014=La propriété '%1$s' devrait être déclarée dans le fichier OPF.
+OPF_015=La propriété '%1$s' ne devrait pas être déclarée dans le fichier OPF.
+OPF_016=L'élément \"rootfile\" n'a pas son attribut obligatoire \"full-path\".
+OPF_017=L'attribut \"full-path\" sur l'élément \"rootfile\" ne doit pas être vide.
+OPF_018=La propriété 'remote-resources' a été déclaré dans l'OPF, mais aucune référence de ressource à distance n'a été trouvée. Assurez-vous que cette propriété est valable.
+OPF_019=L'élément 'spine' est introuvable dans le fichier OPF.
+OPF_020=Nombre excessif d'items du spine.
+OPF_021=Type de protocole URI non-autorisé trouvé dans 'href' : '%1$s'.
+OPF_022=Chemin incorrect : '%1$s'.
+OPF_024=Version ePub inconnue trouvée '%1$s'.
+OPF_025=La propriété '%1$s' ne peut prendre qu'une seule valeur.
+OPF_026=Valeur de la propriété malformée trouvée : '%1$s'.
+OPF_027=Propriété non-définie : '%1$s'.
+OPF_028=Préfixe non-déclaré : '%1$s'.
+OPF_029=Le fichier '%1$s' ne semble pas correspondre au media-type %2$s, comme spécifié dans le fichier OPF.
+OPF_030=Le 'unique-identifier' '%1$s' est introuvable.
+OPF_031=Le fichier déclaré dans l'élément 'reference' dans le guide n'a pas été déclaré dans le manifest de l'OPF : %1$s.
+OPF_032=Le guide référence '%1$s' qui n'est pas un 'OPS Content Document' valide.
+OPF_033=Le spine des ressources non linéaires.
+OPF_034=Le spine contient de multiples références à l'item du manifest avec l'id '%1$s'.
+OPF_035=Le media type 'text/html' ne convient pas pour XHTML/OPS.
+OPF_035_SUG=Utilisez 'application/xhtml+xml' à la place.
+OPF_036=le type de vidéo '%1$s' pourrait ne pas être supporté par les systèmes de lecture.
+OPF_036_SUG=Utilisez 'video/mp4', 'video/h264' ou 'video/webm' à la place.
+OPF_037=Media-type obsolète '%1$s' trouvé.
+OPF_038=Le media type '%1$s' ne convient pas pour un contexte OEBPS 1.2; utilisez 'text/x-oeb1-document' à la place.
+OPF_039=Le media type '%1$s' ne convient pas pour un contexte OEBPS 1.2; utilisez 'text/x-oeb1-css' à la place.
+OPF_040=l'item de repli (fallback) n'a pu être trouvé.
+OPF_041=L'item de repli de style (fallback-style) n'a pu être trouvé.
+OPF_042='%1$s' n'est pas un media-type du spine permis.
+OPF_043=L'item du spine avec un media-type '%1$s' non-standard n'a pas de repli (fallback).
+OPF_044=L'item du spine avec un media-type '%1$s' non-standard a un repli (fallback) pour un media-type non-standard.
+OPF_045=Référence bouclée rencontrée dans la chaîne de repli (fallback).
+OPF_046=La propriété scripted n'est pas définie sur le mediaType handler.
+OPF_047=Le fichier OPF utilise une syntaxe OEBPS 1.2 permettant la rétrocompatibilité.
+OPF_048=L'élément 'package' n'a pas son attribut unique-identifier obligatoire.
+OPF_049=L'id de l'élément '%1$s' est introuvable dans le manifest.
+OPF_050=L'attribut TOC désigne une ressource avec un mimetype non-NCX : ''application/x-dtbncx+xml'' est attendu.
+OPF_051=Les dimensions de l'image dépassent la taille recommandée.
+OPF_052=La valeur de 'role' '%1$s' n'est pas correcte.
+OPF_053=La valeur de la date ne suit pas la syntaxe recommandé selon http://www.w3.org/TR/NOTE-datetime : %2$s.
+OPF_054=La valeur de la date n'est pas correcte selon http://www.w3.org/TR/NOTE-datetime : %2$s.
+OPF_055=L'élément %1$s est vide.
+OPF_056=Le media type '%1$s' n'est pas un mimetype audio convenable.
+OPF_056_SUG=Utilisez 'audio/mp3', 'audio/mp4' ou 'audio/ogg' à la place.
+OPF_057=La longueur du fichier image dépasse la taille recommandée.
+OPF_058=L'élément du spine n'a pas de référence d'entrée de TOC.
+OPF_058_SUG=Chaque élément du spine dans le manifest devrait être référencé par au moins une entrée de TOC.
+OPF_059=L'élément du spine n'a pas de référence d'entrée de NAV.
+OPF_059_SUG=Chaque élément du spine dans le manifest devrait être référencé par au moins une entrée de NAV.
+OPF_060=Double entrée dans le fichier ZIP : '%1$f'.
+OPF_061=Double entrée dans le fichier ZIP (après normalisation Unicode NFC) : '%1$f'.
+OPF_062=L'attribut Adobe 'page-map' a été trouvé sur l'élément spine dans le fichier OPF.
+OPF_063=L'élément '%1$s' référencé par Adobe 'page-map' est introuvable dans le manifest.
+
+#Package
+#Paquet
+PKG_001=Validation de l'ePub selon la version %1$s mais version %2$s détectée.
+PKG_003=Impossible de lire l'en-tête du fichier ePub. C'est probablement un fichier ePub corrompu.
+PKG_004=En-tête ePub ZIP corrompu.
+PKG_005=Le fichier mimetype a une extension de longueur %1$s. Aucune extension de nom de fichier n'est autorisée pour le fichier mimetype.
+PKG_006=Le fichier mimetype est manquante ou n'est pas le premier fichier de l'archive.
+PKG_007=Le fichier mimetype ne devrait contenir que la chaîne de caractères 'application/epub+zip'.
+PKG_008=Impossible de lire le fichier '%1$s'.
+PKG_009=Le nom de fichier contient des caractères qui ne sont pas autorisés dans les noms de fichier OCF : '%1$s'.
+PKG_010=Le nom de fichier contient des espaces, par conséquent l'échappement de l'URI est nécessaire. Envisagez de supprimer les espaces des noms de fichier.
+PKG_011=Le nom de fichier ne peut pas se terminer par '.'.
+PKG_012=Le nom de fichier contient les caractères non-ascii suivants : %1$s. Envisagez de changer le nom de fichier.
+PKG_013=Le fichier ePub inclut plusieurs représentations OPS (OPS renditions).
+PKG_014=L'ePub contient le répertoire vide '%1$s'.
+PKG_015=Impossible de lire les contenus ePub : %1$s.
+PKG_016=Utilisez seulement des caractères minuscules pour l'extension du fichier ePub pour une compatibilité maximale.
+PKG_016_SUG=Pour une compatibilité maximale, utilisez '.epub'.
+PKG_017=Extension du fichier ePub inhabituelle.
+PKG_017_SUG=Pour une compatibilité maximale, utilisez '.epub'.
+PKG_018=Le fichier ePub est introuvable.
+PKG_020=Le fichier OPF '%1$s' est introuvable.
+PKG_021=Fichier image corrompu rencontré.
+PKG_022=Extension de fichier incorrecte pour une image. L'image est un fichier '%1$s' mais a l'extension de fichier '%2$s'.
+
+#Resources
+#Ressources
+RSC_001=Le fichier '%1$s'est introuvable.
+RSC_002=La ressource obligatoire META-INF/container.xml est introuvable.
+RSC_003=Aucun élément 'rootfile' avec le media type 'application/oebps-package+xml' n'est présent dans le container.
+RSC_004=Le fichier '%1$s' ne peut pas être décrypté.
+RSC_005=Erreur lors de l'analyse du fichier '%1$s'.
+RSC_006=Référence à une ressource externe non-autorisée ; La ressource doit être placée dans l'OCF.
+RSC_006_SUG=Seules les ressources externes audio et vidéo sont autorisées.
+RSC_007=La ressource référencée n'est pas présente dans l'ePub.
+RSC_008=La ressource référencée n'est pas déclarée dans le manifest de l'OPF.
+RSC_009=Un identificateur de fragment ne devrait pas être utilisé avec un attribut 'src' de 'img'.
+RSC_010=Référence à une ressource non-standard présente.
+RSC_011=Une référence à une ressource qui n'est pas un élément du spine a été trouvée.
+RSC_012=L'identificateur de fragment n'est pas défini.
+RSC_013=L'identificateur de fragment est utilisé en référence à une feuille de style.
+RSC_014=L'identificateur de fragment définit un type de ressource incompatible.
+RSC_015=Un identificateur de fragment est obligatoire pour les références aux éléments utilisés dans svg.
+RSC_016=Erreur Fatale lors de l'analyse du fichier '%1$s'.
+RSC_017=Avertissement lors de l'analyse du fichier '%1$s'.
+RSC_018=Le fichier altimg '%1$s' n'a pas été trouvé.
+
+#Scripting
+#Script
+SCP_001=L'utilisation de la fonction JavaScript eval() dans les scripts ePub présente un risque de sécurité.
+SCP_002=L'utilisation de XMLHttpRequest dans les scripts ePub présente un risque de sécurité.
+SCP_003=Local et Session Storage ne sont actuellement pas supportés.
+SCP_004=Le fichier de contenu contient un script ce qui n'est pas supporté dans les ePub v2.
+SCP_005=Le fichier contient un script mais il n'est pas marqué comme 'scripted'.
+SCP_006=Scripts en ligne (inline scripts) présents.
+SCP_007=Le script référence 'innerHtml'.
+SCP_007_SUG=Utilisez un DOM à la place.
+SCP_008=Le script référence 'innerText'.
+SCP_008_SUG=Utilisez 'textContent' à la place.
+SCP_009=Le fichier de contenu utilise des handlers d'événement souris.
+SCP_009_SUG=Assurez-vous que toute fonctionnalité avec la souris sont accessibles à partir de clavier et d'appareils tactiles.
+SCP_010=Le fichier de contenu ePub 3 contient du script.
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_it.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_it.properties
new file mode 100644
index 0000000..1418c7a
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_it.properties
@@ -0,0 +1,300 @@
+# This is the Italian translation of MessageBundle.properties file. | Questa è la traduzione italiana del file MessageBundle.properties.
+
+#Accessibility | Accessibilità
+ACC_001=L'elemento HTML 'img' o 'area' non ha un attributo 'alt'.
+ACC_002=L'elemento HTML 'input' non ha un corrispondente elemento 'label'.
+ACC_003=Gli elementi HTML non testuali dovrebbero avere un attributo 'title'.
+ACC_004=L'elemento HTML 'a' dovrebbe avere una descrizione testuale.
+ACC_005=Le celle dell'intestazione di una tabella dovrebbero essere indicate da elementi 'th'.
+ACC_006=Le tabelle dovrebbero includere un'intestazione indicata da un elemento 'thead'.
+ACC_007=I documenti non hanno attributi 'epub:type' che ne specifichino la semantica.
+ACC_008=Il documento di navigazione (Navigation Document) non ha un elemento 'nav' di tipo 'landmarks'.
+ACC_009=Gli elementi MathML dovrebbero avere un attributo 'alt' o un elemento figlio 'annotation'.
+ACC_010=Gli elementi titolo non dovrebbero essere usati dentro elementi 'blockquote' e 'figure'.
+ACC_011=Gli elementi 'link' in un documento SVG dovrebbero includere un attributo 'xlink:title'.
+ACC_012=Gli elementi 'table' dovrebbero includere un elemento 'caption'.
+ACC_013=Il documento contiene almeno una dichiarazione di stile in linea ('style').
+ACC_013_SUG=Gli stili in linea ('style') possono confliggere con le impostazioni di accessibilità. È preferibile usare regole CSS al loro posto.
+ACC_014=Il valore della proprietà CSS 'font-size' non usa un'unità di misura relativa.
+ACC_014_SUG=Valori accettabili includono percentuali, multipli di em, 'larger', 'smaller', 'normal' o 'inherit'.
+ACC_015=Il valore della proprietà CSS 'line-height' non usa un'unità di misura relativa.
+ACC_015_SUG=Valori accettabili includono percentuali, numeri, multipli di em, 'normal' o 'inherit'.
+ACC_016=Il valore della proprietà CSS 'font-size' dovrebbe usare un'unità di misura relativa.
+ACC_016_SUG=Valori accettabili includono percentuali, numeri, multipli di em, 'larger', 'smaller', 'normal' o 'inherit'.
+ACC_017=Il valore della proprietà CSS 'line-height' dovrebbe usare un'unità di misura relativa.
+ACC_017_SUG=Valori accettabili includono percentuali, numeri, multipli di em, 'normal' o 'inherit'.
+
+#Checker Errors | Errori del validatore
+CHK_001=Il file delle regole personalizzate non è stato trovato.
+CHK_002=La regola personalizzata con ID '%1$s' nel file '%2$s' non è riconosciuta.
+CHK_003=L'impostazione '%1$s' nel file '%2$s' non è riconosciuta.
+CHK_004=La regola personalizzata contiene troppi parametri nel file '%1$s'.
+CHK_005=Il suggerimento personalizzato nel file '%1$s' contiene troppi parametri.
+CHK_006=Impossibile interpretare il parametro formato personalizzato nel file '%1$s'.
+CHK_007=È occorso un errore analizzando il file '%1$s': %2$s.
+
+#CSS
+CSS_001=La proprietà '%1$s' non deve essere inclusa in un CSS per EPUB.
+CSS_002=È stato trovato un riferimento vuoto o NULL.
+CSS_003=Sono consentiti solo gli encoding UTF-8 e UTF-16, invece è stato trovato '%1$s'.
+CSS_004=Sono consentiti solo gli encoding UTF-8 e UTF-16 senza BOM, invece è stato trovato '%1$s' con BOM.
+CSS_005=Sono stati trovati attributi alternativi in conflitto: '%1$s'.
+CSS_006=La proprietà CSS 'position:fixed' non dovrebbe essere utilizzata negli EPUB.
+CSS_007=Il riferimento 'font-face' '%1$s' punta a una font non standard '%2$s'.
+CSS_008=È occorso un errore analizzando il file CSS: %1$s.
+CSS_009=L'uso di certe direttive CSS come 'Columns', 'Transforms', 'Transitions', 'box-sizing' or 'KeyFrames' può causare problemi di paginazione.
+CSS_010=È stato trovato un file foglio di stile (CSS?) non standard.
+CSS_011=È stato trovato un numero di CSS eccessivo.
+CSS_011_SUG=È consigliabile unire più file CSS per ridurne il numero.
+CSS_012=Il documento punta più file CSS.
+CSS_013=La proprietà CSS è dichiarata come '!important'.
+CSS_015=Il foglio di stile alternativo non ha titolo.
+CSS_016=Il foglio di stile alternativo è dichiarato prima del foglio di stile principale.
+CSS_017=La regola CSS specifica una posizione assoluta.
+CSS_019=La regola CSS 'font-face' non ha attributi.
+CSS_020=La regola CSS specifica 'font-size' di valore inatteso '%1$s'.
+CSS_020_SUG=Valori accettabili includono percentuali, numeri, multipli di em, 'larger', 'smaller', 'normal' o 'inherit'.
+CSS_021=La regola CSS 'font-family' specifica una font di sistema non valida.
+CSS_021_SUG=Valori accettabili includono 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar' o 'inherit'.
+CSS_022=La regola CSS specifica un valore per i margini globali.
+CSS_023=La regola CSS specifica una media query.
+CSS_024=La regola CSS 'class' non è usata.
+CSS_024_SUG=È consigliabile rimuovere le regole CSS non usate.
+CSS_025=La regola CSS 'class' non è stata trovata.
+CSS_025_SUG=È consigliabile controllare di non aver compiuto un errore nel nome della classe o definire una 'class' effettivamente usata.
+CSS_027=La regola CSS specifica una posizione assoluta.
+CSS_028=La regola CSS specifica una 'font-face'.
+
+#HTM - XHTML related messages | Messaggi riguardanti i file XHTML
+HTM_001=Le risorse di tipo XML (o derivate da XML) devono essere documenti XML 1.0 validi. È stata trovata la versione XML: '%1$s'.
+HTM_002=Il parser XML installato non supporta la verifica della versione XML. Le risorse di tipo XML (o derivate da XML) devono essere documenti XML 1.0 validi.
+HTM_003=Le entità esterne non sono consentite in EPUB 3. È stata trovata la seguente dichiarazione di entità esterna: '%1$s'.
+HTM_004=È stato trovato un 'DOCTYPE' errato: '%1$s' mentre era atteso '%2$s'.
+HTM_005=È stato trovato un riferimento a una risorsa remota.
+HTM_006=È stata trovata un'entità XHTML con nome (XHTML Named Entity).
+HTM_007=È stato trovato un attributo 'ssml:ph' vuoto o con soli spazii.
+HTM_008=L'attributo 'src' è richiesto.
+HTM_009=L'attributo 'DOCTYPE' fornito è obsoleto e può essere rimosso.
+HTM_010=È stato trovato il namespace URI '%1$s'.
+HTM_011=L'entità con nome non è dichiarata.
+HTM_011_SUG=Dichiarare l'entità con nome o usare un'entità numerica (XHTML Numbered Entity).
+HTM_012=È stato trovato un link a un CFI di una pubblicazione terza.
+HTM_013=È stato trovato un link a un CFI all'interno della medesima pubblicazione.
+HTM_014=È stata trovata un'estensione invalida per il file HTML, era atteso 'html', 'htm' o 'xhtml'.
+HTM_014a=Il file (XHTML Content Document) '%1$s' dovrebbe avere estensione '.xhtml'.
+HTM_015=È stata trovata una definizione 'DOCTYPE' HTML 4 nel file EPUB 3.
+HTM_016=È stata trovata una definizione 'DOCTYPE' HTML 5 nel file EPUB 2.
+HTM_017=Il documento ha due valori differenti per gli attributi 'xml:lang' e 'lang'.
+HTM_018=Il documento ha un valore non valido per l'attributo 'xml:lang'.
+HTM_019=Il documento ha un valore non valido per l'attributo 'lang'.
+HTM_020=Il documento non ha un attributo 'xml:lang'.
+HTM_021=Il documento non ha un attributo 'lang'.
+HTM_022=Il documento potrebbe contenere troppi elementi 'div' o 'span'.
+HTM_022_SUG=È consigliabile unire elementi 'div' o 'span' che siano consecutivi e usino lo stesso stile.
+HTM_023=È stata trovata un'entità XHTML con nome (XHTML Named Entity) non valida: '%1$s'.
+HTM_023_SUG=Controllare che il nome dell'entità sia scritto correttamente o usare un'entità numerica (XHTML Numbered Entity).
+HTM_024=È stata trovata un'entità XHTML con nome (XHTML Named Entity). Solo '&' ''' '"e;' '<' o '>' sono consentite.
+HTM_024_SUG=Controllare che il nome dell'entità sia scritto correttamente o usare un'entità numerica (XHTML Numbered Entity).
+HTM_025=È stato trovato uno schema URI non definito nell'attributo 'href'.
+HTM_027=La lista contiene meno di due elementi.
+HTM_027_SUG=Le liste dovrebbero contenere almeno due elementi per favorirne l'accessibilità.
+HTM_028=Gli elementi HTML 'input' dovrebbero includere un attributo 'id'.
+HTM_029=Gli elementi HTML 'label' dovrebbero includere un attributo 'for' che punti all'elemento 'input' corrispondente.
+HTM_033=L'elemento HTML 'head' non ha un elemento figlio 'title'.
+HTM_036=L'utilizzo di elementi 'iframe' è sconsigliato.
+HTM_038=Controllare che l'utilizzo degli elementi 'b', 'i', 'em' e 'strong' sia in linea con i suggerimenti W3C HTML5.
+HTM_038_SUG=È consigliabile utilizzare stili CSS per il testo corsivo o grassetto.
+HTM_043=Gli elementi SVG dovrebbero includere gli attributi 'xml:lang' e 'lang'.
+HTM_044=Il namespace URI '%1$s' è definito ma mai usato.
+HTM_044_SUG=È consigliabile rimuovere namespace URI non utilizzati.
+HTM_045=È stato trovato un attributo 'href' vuoto.
+HTM_045_SUG=Gli attributi 'href' vuoti sono validi e puntano a se stessi. Controllare che questa sia realmente l'intenzione e non si tratti di un'omissione accidentale del valore.
+HTM_046=Il documento HTML a layout fisso non definisce il 'viewport'.
+HTM_046_SUG=La definizione del 'viewport' è obbligatoria per i documenti HTML a layout fisso.
+HTM_047=L'elemento HTML 'viewport' non specifica entrambi i valori di 'height' e 'width'.
+HTM_047_SUG=La definizione di un 'viewport' deve specificare entrambi i valori di 'height' e 'width'.
+HTM_048=Il documento SVG a layout fisso non definisce il 'ViewBox'.
+HTM_048_SUG=La definizione del 'ViewBox' è obbligatoria per i documenti SVG a layout fisso.
+HTM_049=L'elemento 'html' non ha l'attributo 'xmlns' con valore 'http://www.w3.org/1999/xhtml'.
+HTM_049_SUG=Aggiungere l'attributo 'xmlns="http://www.w3.org/1999/xhtml"' all'elemento 'html'.
+HTM_050=È stato trovato un attributo 'epub:type="pagebreak"' nel documento.
+
+#media | Multimedia
+MED_001=L'immagine 'poster' di un 'video' deve essere di tipo fondamentale (Core Media Type).
+MED_002=L'elemento '%1$s' non fornisce un fallback.
+MED_003=È stata trovata un'immagine di tipo non standard '%1$s'.
+MED_004=L'header dell'immagine potrebbe essere danneggiato.
+MED_005=È stato trovato un file Media Overlay contenente il riferimento '%1$s' a un file audio di tipo non standard %2$s.
+MED_006=Alcuni browser non visualizzano immagini SVG che abbiano un nome di file come valore della proprietà 'xlink:href'.
+
+#NAV ePub v3 Table of contents | EPUB 3 Indice NAV
+NAV_001=EPUB 2 non prevede l'uso di documenti di navigazione 'nav' (Navigation Document).
+NAV_002=È stato trovato un 'epub:type="page-list"' nel documento di navigazione 'nav' (Navigation Document).
+
+#NCX ePub v2 Table of Contents | EPUB 2 Indice NCX
+NCX_001=È occorso un errore eseguendo il test NCX: %1$s.
+NCX_002=L'elemento 'spine' non contiene un attributo 'toc'.
+NCX_003=Un file NCX è richiesto per la navigazione dell'indice in EPUB 2.
+NCX_004=L'identificatore NCX non corrisponde all'identificatore OCF: '%1$s'.
+NCX_005=È stato trovato l'elemento "page-list" nel file NCX.
+
+#OPF
+OPF_001=È occorso un errore analizzando l'attributo 'version' del file OPF: %1$s.
+OPF_002=Impossibile trovare il file OPF '%1$s'.
+OPF_003=L'elemento '%1$s' esiste nel contenitore EPUB ma non è dichiarato nel 'manifest' OPF.
+OPF_004=Dichiarazione 'prefix' non valida: il valore non può contenere spazi all'inizio o alla fine.
+OPF_004a=Dichiarazione 'prefix' non valida: il valore non può essere vuoto.
+OPF_004b=Dichiarazione 'prefix' non valida: il prefisso non può contenere caratteri ':' (e.g., 'NCName'), trovato: '%1$s'.
+OPF_004c=Dichiarazione 'prefix' non valida: il prefisso '%1$s' deve essere seguito immediatamente da un carattere ':'.
+OPF_004d=Dichiarazione 'prefix' non valida: il prefisso '%1$s' deve essere separato dal corrispondente URI da uno spazio.
+OPF_004e=Dichiarazione 'prefix' non valida: non è ammesso uno spazio tra prefisso e URI.
+OPF_004f=Dichiarazione 'prefix' non valida: non è ammesso uno spazio tra le mappe prefisso.
+OPF_005=Dichiarazione 'prefix' non valida: l'URI per il prefisso '%1$s' non esiste.
+OPF_006=Dichiarazione 'prefix' non valida: '%1$s' non è uno URI valido.
+OPF_007=Il prefisso riservato '%1$s' è ridichiarato.
+OPF_007a=Mappa prefisso non valida: il prefisso '_' non deve essere dichiarato.
+OPF_007b=Mappa prefisso non valida: il vocabolario predefinito '%1$s' non deve essere ridichiarato.
+OPF_008=Gestore binding (handler binding) per il tipo fondamentale '%1$s' non consentito.
+OPF_009=È già stato definito il gestore binding '%2$s' per il tipo '%1$s'.
+OPF_010=È occorso un errore tentando di risolvere il riferimento '%1$s'.
+OPF_011=L'elemento 'itemref' non può avere entrambe le proprietà 'page-spread-right' e 'page-spread-left'.
+OPF_012=La proprietà '%1$s' non è definita per il tipo '%2$s'.
+OPF_013=La proprietà tipo '%1$s' dell'elemento non corrisponde al tipo definito dall'attributo 'media-type' '%2$s' nel 'manifest' OPF.
+OPF_014=La proprietà '%1$s' dovrebbe essere dichiarata nel file OPF.
+OPF_015=La proprietà '%1$s' non dovrebbe essere dichiarata nel file OPF.
+OPF_016=L'elemento 'rootfile' non ha l'attributo obbligatorio 'full-path'.
+OPF_017=L'attributo 'full-path' dell'elemento 'rootfile' non può essere vuoto.
+OPF_018=La proprietà 'remote-resources' è stata dichiarata nel file OPF ma non è stato trovato alcun riferimento a risorse remote. Controllare che non sia un'omissione accidentale.
+OPF_019=L'elemento 'spine' non è stato trovato nel file OPF.
+OPF_020=Numero eccessivo di elementi nella 'spine'.
+OPF_021=È stato rilevato l'uso di uno schema URI non registrato nell'attributo 'href': '%1$s'.
+OPF_022=Percorso non valido: '%1$s'.
+OPF_024=È stato rilevato un valore sconosciuto per l'attributo EPUB 'version': '%1$s'.
+OPF_025=La proprietà '%1$s' può assumere solo un valore.
+OPF_026=È stato trovato un valore non valido per la proprietà: '%1$s'.
+OPF_027=Proprietà non definita: '%1$s'.
+OPF_028=Prefisso non definito: '%1$s'.
+OPF_029=Il file '%1$s' non sembra essere di tipo '%2$s' come dichiarato nel file OPF.
+OPF_030=L'identificatore univoco 'unique-identifier' '%1$s' non è stato trovato.
+OPF_031=Il file '%1$s' indicato dall'elemento 'reference' nella 'guide' non è dichiarato nel 'manifest' OPF.
+OPF_032=L'elemento 'guide' contiene un elemento 'reference' '%1$s' che non è un documento OPS valido.
+OPF_033=L'elemento 'spine' non contiene elementi con attributo 'linear' 'yes' (esplicito o omesso).
+OPF_034=L'elemento 'spine' cintiene riferimenti plurimi all'elemento del 'manifest' con ID '%1$s'.
+OPF_035=Il tipo 'text/html' non è consentito per un file XHTML/OPS.
+OPF_035_SUG=Usare invece 'application/xhtml+xml'.
+OPF_036=Il tipo video '%1$s' potrebbe non essere supportato da alcuni sistemi di lettura.
+OPF_036_SUG=Usare invece 'video/mp4', 'video/h264' o 'video/webm'.
+OPF_037=È stato rilevato il tipo deprecato '%1$s'.
+OPF_038=Il tipo '%1$s' non è consentito in un contesto OEBPS 1.2. Usare invece 'text/x-oeb1-document'.
+OPF_039=Il tipo '%1$s' non è consentito in un contesto OEBPS 1.2. Usare invece 'text/x-oeb1-css'.
+OPF_040=Impossibile trovare l'elemento di fallback.
+OPF_041=Impossibile trovare lo stile di fallback.
+OPF_042=Il valore '%1$s' non è un tipo ammesso per un elemento della 'spine'.
+OPF_043=L'elemento con tipo non fondamentale '%1$s' non ha fallback.
+OPF_044=L'elemento con tipo non fondamentale '%1$s' ha un fallback di tipo non fondamentale.
+OPF_045=È stata trovata una sequenza di riferimenti circolari nella catena di fallback.
+OPF_046=La proprietà 'scripted' non è stata dichiarata nel gestore di tipo.
+OPF_047=Il file OPF usa la sintassi OEBPS 1.2 per garantire retrocompatibilità.
+OPF_048=L'elemento 'package' non ha l'attributo obbligatorio 'unique-identifier'.
+OPF_049=L'elemento con ID '%1$s' non è stato dichiarato nel 'manifest'.
+OPF_050=L'attributo 'toc' punta a una risorsa con tipo diverso da 'application/x-dtbncx+xml'.
+OPF_051=Le dimensioni dell'immagine eccedono le misure consigliate.
+OPF_052=Il valore '%1$s' per l'attributo 'role' non è valido.
+OPF_053=La data '%1$s' non segue la sintassi raccomandata da http://www.w3.org/TR/NOTE-datetime: %2$s.
+OPF_054=La data '%1$s' non è valida secondo http://www.w3.org/TR/NOTE-datetime: %2$s.
+OPF_055=L'elemento '%1$s' è vuoto.
+OPF_056=Il tipo '%1$s' non è un tipo audio valido.
+OPF_056_SUG=Usare 'audio/mp3', 'audio/mp4' o 'audio/ogg' instead.
+OPF_057=La dimensione dell'immagine supera la dimensione massima consigliata.
+OPF_058=L'elemento della 'spine' non ha un corrispondente elemento nell'indice (NCX).
+OPF_058_SUG=Ogni elemento della 'spine' dovrebbe avere almeno un corrispondente elemento nell'indice (NCX).
+OPF_059=L'elemento della 'spine' non ha un corrispondente elemento nel documento di navigazione 'nav toc' (Navigation Document).
+OPF_059_SUG=Ogni elemento della 'spine' dovrebbe avere almeno un corrispondente elemento nel documento di navigazione 'nav toc' (Navigation Document).
+OPF_060=Elemento duplicato nel contenitore ZIP: '%1$f'.
+OPF_061=Elemento duplicato nel contenitore ZIP dopo la normalizzazione Unicode NFC dei percorsi: '%1$f'.
+OPF_062=È stato trovato l'attributo Adobe 'page-map' in un elemento della 'spine'.
+OPF_063=L'elemento Adobe 'page-map' '%1$s' non è dichiarato nel 'manifest' OPF.
+
+#Package | Contenitore
+PKG_001=È stato richiesto il controllo EPUB versione '%1$s' ma l'input pare avere versione '%2$s'.
+PKG_003=Impossibile leggere l'header del file EPUB. È probabile che il file sia danneggiato.
+PKG_004=L'header del file EPUB è danneggiato.
+PKG_005=Il file 'mimetype' ha un campo ZIM 'extra' di %1$s bytes. L'uso del campo ZIP 'extra' non è permesso per il file 'mimetype'.
+PKG_006=Il file 'mimetype' manca oppure non è il primo file del contenitore EPUB. Controlla di aver compresso il file correttamente.
+PKG_007=Il file 'mimetype' deve contenere la sola stringa 'application/epub+zip' (20 caratteri). Controlla che non ci siano altri caratteri come ritorni a capo o spazi.
+PKG_008=Impossibile leggere il file '%1$s'.
+PKG_009=Il nome del file contiene caratteri non consentiti dalla specifica OCF: '%1$s'.
+PKG_010=Il nome del file contiene spazi, quindi è richiesto l'escaping. È consigliabile rimuovere gli spazi dai nomi di file.
+PKG_011=Il nome del file non può terminare con il carattere '.'.
+PKG_012=Il nome del file contiene i seguenti caratteri non ASCII: '%1$s'. È consigliabile usare nomi di file contenenti solo caratteri ASCII.
+PKG_013=Il file EPUB contiene più pacchetti OPF (Multiple Renditions).
+PKG_014=Il file EPUB contiene la directory vuota '%1$s'.
+PKG_015=Impossibile leggere i contenuti del file EPUB: '%1$s'.
+PKG_016=L'estensione del file EPUB non usa solamente lettere minuscole.
+PKG_016_SUG=Per la massima compatibilità, è consigliabile usare '.epub'.
+PKG_017=L'estensione del file EPUB è non standard.
+PKG_017_SUG=Per la massima compatibilità, è consigliabile usare '.epub'.
+PKG_018=File EPUB non trovato.
+PKG_020=File OPF '%1$s' non trovato.
+PKG_021=L'immagine è danneggiata.
+PKG_022=L'immagine ha un'estensione non corrispondente al suo formato. L'immagine è un file '%1$s' ma ha estensione '%2$s'.
+
+#Resources | Risorse
+RSC_001=Il file '%1$s' non è stato trovato.
+RSC_002=Il file (obbligatorio) 'META-INF/container.xml' non è stato trovato.
+RSC_003=Non è stato trovato alcun elemento 'rootfile' con 'media-type' di tipo 'application/oebps-package+xml'.
+RSC_004=Il file '%1$s' non può essere decrittato.
+RSC_005=È occorso un errore durante la lettura del file: %1$s.
+RSC_006=Riferimento a risorsa remota non consentito; la risorsa deve essere inclusa nel contenitore EPUB.
+RSC_006_SUG=Solo risorse audio e video possono essere dichiarate remote.
+RSC_007=La risorsa non è stata trovata nel contenitore EPUB.
+RSC_008=La risorsa non è dichiarata nell'elemento 'manifest' del file OPF.
+RSC_009=Un identificatore di frammento non dovrebbe essere usato come attributo 'src' di un elemento 'img'.
+RSC_010=È stato trovato un riferimento a una risorsa di tipo non standard.
+RSC_011=È stato trovato un riferimento a una risorsa non elencata nell'elemento 'spine'.
+RSC_012=L'identificatore di frammento è non definito.
+RSC_013=L'identificatore di frammento è usato in un riferimento a un foglio di stile.
+RSC_014=L'identificatore di frammento definisce una risorsa di tipo incompatibile.
+RSC_015=Un identificatore di frammento è richiesto per i riferimenti a elementi SVG 'use'.
+RSC_016=È occorso un errore fatale durate la lettura del file: %1$s.
+RSC_017=È occorso un potenziale errore durate la lettura del file: %1$s.
+RSC_018=Il file altimg '%1$s' non è stato trovato.
+
+#Scripting | Script
+SCP_001=L'uso della funzione 'eval()' in un file EPUB può comportare problemi di sicurezza.
+SCP_002=L'uso dell'oggetto 'XMLHttpRequest' in un file EPUB può comportare problemi di sicurezza.
+SCP_003=Local e Session Storage non sono attualmente supportati.
+SCP_004=Il documento contiene uno script che non è supportato in EPUB 2.
+SCP_005=Il documento contiene uno script ma non è marcato come 'scripted'.
+SCP_006=È stato trovato uno script in linea ('script').
+SCP_007=Lo script utilizza 'innerHtml'.
+SCP_007_SUG=È consigliabile usare l'oggetto DOM corrispondente.
+SCP_008=Lo script utilizza 'innerText'.
+SCP_008_SUG=È consigliabile usare 'textContent'.
+SCP_009=Lo script prevede degli handler per eventi del mouse.
+SCP_009_SUG=È consigliabile controllare che tutte le funzioni attivabili tramite il mouse siano accessibili anche tramite la tastiera e gli eventi tocco.
+SCP_010=Il documento EPUB 3 contiene uno o più script.
+
+#
+# Adopted translations for common terms
+#
+# Navigation Document = documento di navigazione 'nav'
+# inline style = stile in linea
+# inline script = script in linea
+# SVG document/file = documento SVG
+# HTML document/file = documento HTML
+# XHTML document/file = documento XHTML
+# Content Document = documento
+# Publication = pubblicazione
+# Media Type = tipo
+# Core Media Type = tipo fondamentale
+# Named Entity = entità con nome
+# Numbered Entity = entità numerica
+# EPUB/ePub v2 = EPUB 2
+# EPUB/ePub v3 = EPUB 3
+# warning = potenziale errore
+# error = errore
+# fatal error = errore fatale
+
+
+
diff --git a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties
index f117624..3cc1504 100644
--- a/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties
+++ b/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties
@@ -129,8 +129,6 @@ MED_006=いくつかのブラウザではxlink:hrefプロパティ内でファ
#NAV ePub v3 Table of contents
NAV_001=navファイルはePub v2ではサポートされていません.
NAV_002=Found epub:type="page-list" in nav document
-NAV_003=Found both epub:type="page-list" in nav document and epub:type="pagebreak" in content document(s)
-NAV_003_SUG=Using multiple paging constructs can cause unpredictable paging behavior in some epub readers.
#NCX ePub v2 Table of Contents
NCX_001=NCX Schematronテストの実行に失敗しました: %1$s.
@@ -138,8 +136,6 @@ NCX_002=spine要素にtoc属性が見つかりませんでした.
NCX_003=ePub v2リーダでのTOCナビゲーションのためには.NCX ファイルが必要です.
NCX_004=NCX識別子がocf識別子: %1$s とマッチしません.
NCX_005=Found ncx "page-list" in .ncx file
-NCX_006=Found both "page-list" construct in ncx document and Adobe page-map attribute on the spine.
-NCX_006_SUG=Using multiple paging constructs can cause unpredictable paging behavior in some readers.
#OPF
OPF_001=ePubバージョン: %1$s の解析時にエラーが発生しました.
@@ -171,8 +167,6 @@ OPF_018=OPFで 'remote-resources' プロパティが宣言されていますが
OPF_019=OPFファイルにspineタグが見当たりません.
OPF_020=spineアイテムの数が多すぎます.
OPF_021=href '%1$s' の中で登録されていないURIスキーマが使われています.
-OPF_022=無効なパス: '%1$s'.
-OPF_024=未知のePubバージョンを発見しまいした: %1$s.
OPF_025='%1$s' プロパティは一つの値しか取ることができません.
OPF_026=プロパティの値が不正です: '%1$s'.
OPF_027=未定義のプロパティ: '%1$s'.
diff --git a/src/main/resources/com/adobe/epubcheck/ops/registeredSchemas.txt b/src/main/resources/com/adobe/epubcheck/ops/registeredSchemas.txt
deleted file mode 100644
index 4ab3299..0000000
--- a/src/main/resources/com/adobe/epubcheck/ops/registeredSchemas.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-aaa://
-aaas://
-acap://
-cap://
-cid:
-crid://
-data:
-dav:
-dict://
-dns://
-fax:
-file://
-ftp://
-go://
-gopher://
-h323:
-http://
-https://
-icap://
-im:
-imap://
-info:
-ipp://
-iris:
-iris.beep:
-iris.xpc:
-iris.xpcs:
-iris.lwz:
-javascript:
-ldap://
-mailto:
-mid:
-modem:
-msrp://
-msrps://
-mtqp://
-mupdate://
-news://
-nfs://
-nntp://
-opaquelocktoken:
-pop://
-pres:
-rtsp://
-service:
-shttp://
-sip:
-sips:
-snmp://
-soap.beep://
-soap.beeps://
-tag:
-tel:
-telnet://
-tftp://
-thismessage:
-tip://
-tv:
-urn:
-vemmi://
-xmlrpc.beep://
-xmlrpc.beeps://
-xmpp://
-z39.50r://
-z39.50s://
-afs:
-dtn:
-iax:
-mailserver:
-pack://
-tn3270:
-prospero://
-snews://
-videotex:
-wais://
diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/dtd/oebdoc12.dtd b/src/main/resources/com/adobe/epubcheck/schema/20/dtd/oebdoc12.dtd
new file mode 100644
index 0000000..0750ad4
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/20/dtd/oebdoc12.dtd
@@ -0,0 +1,555 @@
+<!--
+
+Title:
+
+ The Basic Document Type Definition (DTD) for the Open eBook
+ Publication Structure Version 1.2
+
+
+Version:
+
+ 1.2
+
+
+Revision:
+
+ 20020930-x (supercedes 20020327-x)
+
+
+Revision History Note:
+
+ This revision, 20020930-x, corrects a very minor and subtle error
+ discovered in revision 20020327-x shortly after the as-yet-
+ unannounced release (on 27 August 2002) of OEBPS Version 1.2. The
+ error: the FIXED attribute assignment of the XHTML namespace to
+ the root <html> element using an entity reference was improperly
+ done, thus violating XML 1.0 rules (this error was incorrectly
+ carried over from the modular XHTML 1.1 DTD which this DTD
+ subsets.) Since many XML parsers do not even recognize this
+ subtle error, and it has no impact on the validity of authored
+ Basic OEBPS 1.2 Documents, it was determined that this error
+ could be corrected with the issuance of this revised DTD without
+ needing to update the version or release date of the Publication
+ Structure Specification itself. This revised DTD also includes an
+ email address update in this comment prologue. No other changes
+ were made to the parsed content of this DTD.
+
+
+Authors:
+
+ Jon Noring <jon at noring.name>
+
+
+Usage:
+
+ <?xml version="1.0"?>
+ <!DOCTYPE html PUBLIC
+ "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Document//EN"
+ "http://openebook.org/dtds/oeb-1.2/oebdoc12.dtd">
+ <html>
+ ...
+ </html>
+
+
+Summary:
+
+ This DTD is a pure subset of XHTML 1.1: any document validating
+ to this DTD will also validate to the XHTML 1.1 DTD.
+
+-->
+
+
+<!-- *************************************************** -->
+
+<!-- GENERAL NOTATIONS ................................. -->
+
+<!-- W3C XML 1.0 Recommendation -->
+
+<!NOTATION w3c-xml
+ PUBLIC "ISO 8879//NOTATION Extensible Markup Language (XML) 1.0//EN">
+
+<!-- XML 1.0 CDATA -->
+
+<!NOTATION cdata
+ PUBLIC "-//W3C//NOTATION XML 1.0: CDATA//EN">
+
+<!-- *************************************************** -->
+
+<!-- ENTITIES WITH DATATYPE NOTATIONS .................. -->
+
+<!-- Content type, as per [RFC2045] -->
+
+<!NOTATION contentType
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: ContentType//EN">
+<!ENTITY % ContentType.datatype "CDATA">
+
+<!-- Date and time information. ISO date format -->
+
+<!NOTATION datetime
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: Datetime//EN">
+<!ENTITY % Datetime.datatype "CDATA">
+
+<!-- Language code, as per [RFC3066] -->
+
+<!NOTATION languageCode
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: LanguageCode//EN">
+<!ENTITY % LanguageCode.datatype "NMTOKEN">
+
+<!-- Length defined for cellpadding/cellspacing -->
+<!-- nn for pixels or nn% for percentage length -->
+
+<!NOTATION length
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: Length//EN">
+<!ENTITY % Length.datatype "CDATA">
+
+<!-- Space-separated list of link types -->
+
+<!NOTATION linkTypes
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: LinkTypes//EN">
+<!ENTITY % LinkTypes.datatype "NMTOKENS">
+
+<!-- Single or comma-separated list of media descriptors -->
+
+<!NOTATION mediaDesc
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: MediaDesc//EN">
+<!ENTITY % MediaDesc.datatype "CDATA">
+
+<!-- Pixel, percentage, or relative -->
+
+<!NOTATION multiLength
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: MultiLength//EN">
+<!ENTITY % MultiLength.datatype "CDATA">
+
+<!-- One or more digits (NUMBER) -->
+
+<!NOTATION number
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: Number//EN">
+<!ENTITY % Number.datatype "CDATA">
+
+<!-- Integer representing length in pixels -->
+
+<!NOTATION pixels
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: Pixels//EN">
+<!ENTITY % Pixels.datatype "CDATA">
+
+<!-- Textual content -->
+
+<!NOTATION text
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: Text//EN">
+<!ENTITY % Text.datatype "CDATA">
+
+<!-- Uniform Resource Identifier -->
+
+<!NOTATION uri
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: URI//EN">
+<!ENTITY % URI.datatype "CDATA">
+
+<!-- Space-separated list of Uniform Resource Identifiers -->
+
+<!NOTATION uris
+ PUBLIC "-//W3C//NOTATION XHTML Datatype: URIs//EN">
+<!ENTITY % URIs.datatype "CDATA">
+
+<!-- *************************************************** -->
+
+<!-- ELEMENT ENTITIES .................................. -->
+
+<!ENTITY % Block.class
+ "address | blockquote | div | dl |
+ h1 | h2 | h3 | h4 | h5 | h6 |
+ hr | ol | p | pre | table | ul">
+
+<!ENTITY % Inline.class
+ "a | abbr | acronym | b | big | br |
+ cite | code | dfn | em | i | img | kbd |
+ map | object | q | samp | small | span |
+ strong | sub | sup | tt | var">
+
+<!ENTITY % BlockOrInline.class
+ "del | ins | noscript | script">
+
+<!ENTITY % Block.mix
+ "%Block.class; | %BlockOrInline.class;">
+
+<!ENTITY % Inline.mix
+ "%Inline.class; | %BlockOrInline.class;">
+
+<!ENTITY % Flow.mix
+ "%Block.class; | %Inline.class; | %BlockOrInline.class;">
+
+<!ENTITY % HeadOpts.mix
+ "(link | meta | object | script | style)*">
+
+<!-- *************************************************** -->
+
+<!-- ATTRIBUTE ENTITIES ................................ -->
+
+<!ENTITY % Core.attrib
+ "class NMTOKENS #IMPLIED
+ id ID #IMPLIED
+ style CDATA #IMPLIED
+ title %Text.datatype; #IMPLIED">
+
+<!ENTITY % Common.attrib
+ "%Core.attrib;
+ xml:lang %LanguageCode.datatype; #IMPLIED">
+
+<!ENTITY % CellHAlign
+ "(left | center | right | justify)">
+
+<!ENTITY % CellVAlign
+ "(top | middle | bottom | baseline)">
+
+<!-- *************************************************** -->
+
+<!-- XHTML MNEMONIC CHARACTER ENTITIES ................. -->
+
+<!ENTITY % OEBEntities
+ PUBLIC "+//ISBN 0-9673008-1-9//DTD OEB 1.2 Entities//EN"
+ "http://openebook.org/dtds/oeb-1.2/oeb12.ent">
+
+%OEBEntities;
+
+<!-- *************************************************** -->
+
+<!-- ELEMENTS AND ATTRIBUTES ........................... -->
+
+<!-- TOP LEVEL STRUCTURE ............................... -->
+
+<!ELEMENT html (head, body)>
+<!ATTLIST html
+ xml:lang %LanguageCode.datatype; #IMPLIED
+ xmlns %URI.datatype; #FIXED 'http://www.w3.org/1999/xhtml'>
+
+<!ELEMENT head
+ ( %HeadOpts.mix;,
+ ( (title, %HeadOpts.mix;, (base, %HeadOpts.mix;)?) |
+ (base, %HeadOpts.mix;, (title, %HeadOpts.mix;) ) ) )>
+<!ATTLIST head
+ xml:lang %LanguageCode.datatype; #IMPLIED>
+
+<!ELEMENT body (%Block.mix;)+>
+<!ATTLIST body %Common.attrib;>
+
+<!-- HEAD LEVEL ........................................ -->
+
+<!ELEMENT base EMPTY>
+<!ATTLIST base
+ href %URI.datatype; #REQUIRED>
+
+<!ELEMENT link EMPTY>
+<!ATTLIST link
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ media %MediaDesc.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED>
+
+<!ELEMENT meta EMPTY>
+<!ATTLIST meta
+ content CDATA #REQUIRED
+ name NMTOKEN #IMPLIED
+ scheme CDATA #IMPLIED
+ xml:lang %LanguageCode.datatype; #IMPLIED>
+
+<!ELEMENT style (#PCDATA)>
+<!ATTLIST style
+ title %Text.datatype; #IMPLIED
+ type %ContentType.datatype; #REQUIRED
+ xml:lang %LanguageCode.datatype; #IMPLIED
+ xml:space (preserve) #FIXED 'preserve'>
+
+<!ELEMENT title (#PCDATA)>
+<!ATTLIST title
+ xml:lang %LanguageCode.datatype; #IMPLIED>
+
+<!-- BLOCK LEVEL ....................................... -->
+
+<!ELEMENT address (#PCDATA | %Inline.mix;)*>
+<!ATTLIST address %Common.attrib;>
+
+<!ELEMENT blockquote (%Block.mix;)+>
+<!ATTLIST blockquote
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED>
+
+<!ELEMENT div (#PCDATA | %Flow.mix;)*>
+<!ATTLIST div %Common.attrib;>
+
+<!ELEMENT dl (dt | dd)+>
+<!ATTLIST dl %Common.attrib;>
+
+<!ELEMENT h1 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h1 %Common.attrib;>
+
+<!ELEMENT h2 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h2 %Common.attrib;>
+
+<!ELEMENT h3 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h3 %Common.attrib;>
+
+<!ELEMENT h4 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h4 %Common.attrib;>
+
+<!ELEMENT h5 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h5 %Common.attrib;>
+
+<!ELEMENT h6 (#PCDATA | %Inline.mix;)*>
+<!ATTLIST h6 %Common.attrib;>
+
+<!ELEMENT hr EMPTY>
+<!ATTLIST hr %Common.attrib;>
+
+<!ELEMENT ol (li)+>
+<!ATTLIST ol %Common.attrib;>
+
+<!ELEMENT p (#PCDATA | %Inline.mix;)*>
+<!ATTLIST p %Common.attrib;>
+
+<!ELEMENT pre
+ (#PCDATA |
+ a | abbr | acronym | b | br | cite |
+ code | dfn | em | i | kbd | map | q |
+ samp | span | strong | tt | var |
+ script)*>
+<!ATTLIST pre
+ %Common.attrib;
+ xml:space (preserve) #FIXED 'preserve'>
+
+<!ELEMENT table
+ ( caption?, (col* | colgroup*),
+ ( (thead?, tfoot?, tbody+) | (tr+) ) )>
+<!ATTLIST table
+ %Common.attrib;
+ border %Pixels.datatype; #IMPLIED
+ cellpadding %Length.datatype; #IMPLIED
+ cellspacing %Length.datatype; #IMPLIED
+ summary %Text.datatype; #IMPLIED
+ width %Length.datatype; #IMPLIED>
+
+<!ELEMENT ul (li)+>
+<!ATTLIST ul %Common.attrib;>
+
+<!-- INLINE LEVEL ...................................... -->
+
+<!ELEMENT a (#PCDATA |
+ abbr | acronym | b | big | br | cite |
+ code | dfn | em | i | img | kbd | map |
+ object | q | samp | small | span | strong |
+ sub | sup | tt | var |
+ %BlockOrInline.class;)*>
+<!ATTLIST a
+ %Common.attrib;
+ href %URI.datatype; #IMPLIED
+ rel %LinkTypes.datatype; #IMPLIED
+ rev %LinkTypes.datatype; #IMPLIED>
+
+<!ELEMENT abbr (#PCDATA | %Inline.mix;)*>
+<!ATTLIST abbr %Common.attrib;>
+
+<!ELEMENT acronym (#PCDATA | %Inline.mix;)*>
+<!ATTLIST acronym %Common.attrib;>
+
+<!ELEMENT b (#PCDATA | %Inline.mix;)*>
+<!ATTLIST b %Common.attrib;>
+
+<!ELEMENT big (#PCDATA | %Inline.mix;)*>
+<!ATTLIST big %Common.attrib;>
+
+<!ELEMENT br EMPTY>
+<!ATTLIST br %Core.attrib;>
+
+<!ELEMENT cite (#PCDATA | %Inline.mix;)*>
+<!ATTLIST cite %Common.attrib;>
+
+<!ELEMENT code (#PCDATA | %Inline.mix;)*>
+<!ATTLIST code %Common.attrib;>
+
+<!ELEMENT dfn (#PCDATA | %Inline.mix;)*>
+<!ATTLIST dfn %Common.attrib;>
+
+<!ELEMENT em (#PCDATA | %Inline.mix;)*>
+<!ATTLIST em %Common.attrib;>
+
+<!ELEMENT i (#PCDATA | %Inline.mix;)*>
+<!ATTLIST i %Common.attrib;>
+
+<!ELEMENT img EMPTY>
+<!ATTLIST img
+ %Common.attrib;
+ alt %Text.datatype; #REQUIRED
+ height %Length.datatype; #IMPLIED
+ longdesc %URI.datatype; #IMPLIED
+ src %URI.datatype; #REQUIRED
+ usemap IDREF #IMPLIED
+ width %Length.datatype; #IMPLIED>
+
+<!ELEMENT kbd (#PCDATA | %Inline.mix;)*>
+<!ATTLIST kbd %Common.attrib;>
+
+<!ELEMENT map (%Block.mix; | area)+>
+<!ATTLIST map
+ class NMTOKENS #IMPLIED
+ id ID #REQUIRED
+ style CDATA #IMPLIED
+ title %Text.datatype; #IMPLIED
+ xml:lang %LanguageCode.datatype; #IMPLIED>
+
+<!ELEMENT object (#PCDATA | %Flow.mix; | param)*>
+<!ATTLIST object
+ %Common.attrib;
+ archive %URIs.datatype; #IMPLIED
+ classid %URI.datatype; #IMPLIED
+ codebase %URI.datatype; #IMPLIED
+ codetype %ContentType.datatype; #IMPLIED
+ data %URI.datatype; #IMPLIED
+ height %Length.datatype; #IMPLIED
+ type %ContentType.datatype; #IMPLIED
+ usemap IDREF #IMPLIED
+ width %Length.datatype; #IMPLIED>
+
+<!ELEMENT q (#PCDATA | %Inline.mix;)*>
+<!ATTLIST q
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED>
+
+<!ELEMENT samp (#PCDATA | %Inline.mix;)*>
+<!ATTLIST samp %Common.attrib;>
+
+<!ELEMENT small (#PCDATA | %Inline.mix;)*>
+<!ATTLIST small %Common.attrib;>
+
+<!ELEMENT span (#PCDATA | %Inline.mix;)*>
+<!ATTLIST span %Common.attrib;>
+
+<!ELEMENT strong (#PCDATA | %Inline.mix;)*>
+<!ATTLIST strong %Common.attrib;>
+
+<!ELEMENT sub (#PCDATA | %Inline.mix;)*>
+<!ATTLIST sub %Common.attrib;>
+
+<!ELEMENT sup (#PCDATA | %Inline.mix;)*>
+<!ATTLIST sup %Common.attrib;>
+
+<!ELEMENT tt (#PCDATA | %Inline.mix;)*>
+<!ATTLIST tt %Common.attrib;>
+
+<!ELEMENT var (#PCDATA | %Inline.mix;)*>
+<!ATTLIST var %Common.attrib;>
+
+<!-- BLOCK OR INLINE LEVEL ............................. -->
+
+<!ELEMENT del (#PCDATA | %Flow.mix;)*>
+<!ATTLIST del
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED>
+
+<!ELEMENT ins (#PCDATA | %Flow.mix;)*>
+<!ATTLIST ins
+ %Common.attrib;
+ cite %URI.datatype; #IMPLIED
+ datetime %Datetime.datatype; #IMPLIED>
+
+<!ELEMENT noscript (%Block.mix;)+>
+<!ATTLIST noscript %Common.attrib;>
+
+<!ELEMENT script (#PCDATA)>
+<!ATTLIST script
+ type %ContentType.datatype; #REQUIRED
+ xml:space (preserve) #FIXED 'preserve'>
+
+<!-- TABLE LEVEL ....................................... -->
+
+<!ELEMENT caption (#PCDATA | %Inline.mix;)*>
+<!ATTLIST caption %Common.attrib;>
+
+<!ELEMENT col EMPTY>
+<!ATTLIST col
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ span %Number.datatype; '1'
+ valign %CellVAlign; #IMPLIED
+ width %MultiLength.datatype; #IMPLIED>
+
+<!ELEMENT colgroup (col)*>
+<!ATTLIST colgroup
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ span %Number.datatype; '1'
+ valign %CellVAlign; #IMPLIED
+ width %MultiLength.datatype; #IMPLIED>
+
+<!ELEMENT tbody (tr)+>
+<!ATTLIST tbody
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ valign %CellVAlign; #IMPLIED>
+
+<!ELEMENT td (#PCDATA | %Flow.mix;)*>
+<!ATTLIST td
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ align %CellHAlign; #IMPLIED
+ colspan %Number.datatype; '1'
+ rowspan %Number.datatype; '1'
+ valign %CellVAlign; #IMPLIED>
+
+<!ELEMENT tfoot (tr)+>
+<!ATTLIST tfoot
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ valign %CellVAlign; #IMPLIED>
+
+<!ELEMENT th (#PCDATA | %Flow.mix;)*>
+<!ATTLIST th
+ %Common.attrib;
+ abbr %Text.datatype; #IMPLIED
+ align %CellHAlign; #IMPLIED
+ colspan %Number.datatype; '1'
+ rowspan %Number.datatype; '1'
+ valign %CellVAlign; #IMPLIED>
+
+<!ELEMENT thead (tr)+>
+<!ATTLIST thead
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ valign %CellVAlign; #IMPLIED>
+
+<!ELEMENT tr (th | td)+>
+<!ATTLIST tr
+ %Common.attrib;
+ align %CellHAlign; #IMPLIED
+ valign %CellVAlign; #IMPLIED>
+
+<!-- LIST LEVEL ........................................ -->
+
+<!ELEMENT dd (#PCDATA | %Flow.mix;)*>
+<!ATTLIST dd %Common.attrib;>
+
+<!ELEMENT dt (#PCDATA | %Inline.mix;)*>
+<!ATTLIST dt %Common.attrib;>
+
+<!ELEMENT li (#PCDATA | %Flow.mix;)*>
+<!ATTLIST li %Common.attrib;>
+
+<!-- MISCELLANEOUS ..................................... -->
+
+<!ELEMENT area EMPTY>
+<!ATTLIST area
+ %Common.attrib;
+ alt %Text.datatype; #REQUIRED
+ coords CDATA #IMPLIED
+ href %URI.datatype; #IMPLIED
+ nohref (nohref) #IMPLIED
+ shape (rect | circle |
+ poly | default) 'rect'>
+
+<!ELEMENT param EMPTY>
+<!ATTLIST param
+ id ID #IMPLIED
+ name CDATA #REQUIRED
+ type %ContentType.datatype; #IMPLIED
+ value CDATA #IMPLIED
+ valuetype (data | ref | object) 'data'>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/edit.rng b/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/edit.rng
index ad98c89..b10b2af 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/edit.rng
+++ b/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/edit.rng
@@ -10,11 +10,13 @@
</define>
<define name="del.attlist">
+ <ref name="Common.attrib"/>
<ref name="Edit.attrib"/>
</define>
<define name="ins">
<element name="ins">
+ <ref name="Common.attrib"/>
<ref name="ins.attlist"/>
<ref name="Inline.model"/>
</element>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/sch/id-unique.sch b/src/main/resources/com/adobe/epubcheck/schema/20/sch/id-unique.sch
index 202b6aa..2a024d3 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/20/sch/id-unique.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/20/sch/id-unique.sch
@@ -3,9 +3,9 @@
<pattern id="id-unique" xmlns="http://purl.oclc.org/dsdl/schematron">
<!-- note: assumes that NCName lexical constraints are tested elsewhere -->
<let name="id-set" value="//*[@id]"/>
- <rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1"
- >Duplicate ID '<value-of select="current()/@id"/>'</assert>
- </rule>
+ <rule context="*[@id]">
+ <assert test="count($id-set[normalize-space(@id) = normalize-space(current()/@id)]) = 1"
+ >Duplicate '<value-of select="normalize-space(current()/@id)"/>'</assert>
+ </rule>
</pattern>
</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/sch/ncx.sch b/src/main/resources/com/adobe/epubcheck/schema/20/sch/ncx.sch
index a4f4e5d..b6bd4e3 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/20/sch/ncx.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/20/sch/ncx.sch
@@ -80,7 +80,7 @@
<sch:pattern name="ncx_idAttrUnique" id="ncx_idAttrUnique">
<sch:rule context="//*[@id]">
- <sch:assert test="count(//@id[. = current()/@id]) = 1"
+ <sch:assert test="count(//@id[normalize-space(.) = normalize-space(current()/@id)]) = 1"
>The "id" attribute does not have a unique value</sch:assert>
</sch:rule>
</sch:pattern>
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 a705eec..73a2759 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,14 @@
<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
-
- <sch:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/" />
- <sch:ns prefix="opf" uri="http://www.idpf.org/2007/opf" />
-
+
+ <sch:ns prefix="dc" uri="http://purl.org/dc/elements/1.1/"/>
+ <sch:ns prefix="opf" uri="http://www.idpf.org/2007/opf"/>
+
<sch:pattern name="opf_idAttrUnique" id="opf_idAttrUnique">
- <!-- id attribute value must be unique for any id attribute in opf file-->
- <sch:rule context="//*[@id]">
- <sch:assert test="count(//@id[. = current()/@id]) = 1"
- >The "id" attribute does not have a unique value</sch:assert>
- </sch:rule>
+ <!-- id attribute value must be unique for any id attribute in opf file-->
+ <sch:rule context="//*[@id]">
+ <sch:assert test="count(//@id[normalize-space(.) = normalize-space(current()/@id)]) = 1">The
+ "id" attribute does not have a unique value</sch:assert>
+ </sch:rule>
</sch:pattern>
-
+
</sch:schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/20/sch/xhtml.sch b/src/main/resources/com/adobe/epubcheck/schema/20/sch/xhtml.sch
new file mode 100644
index 0000000..7d70cfa
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/20/sch/xhtml.sch
@@ -0,0 +1,12 @@
+<sch:schema xmlns:sch="http://www.ascc.net/xml/schematron">
+
+ <sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
+
+ <sch:pattern name="nested_hyperlinks">
+ <sch:rule context="h:a">
+ <sch:report test="descendant::h:a">The a element cannot contain any nested a
+ elements.</sch:report>
+ </sch:rule>
+ </sch:pattern>
+
+</sch:schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/datanav/datanav-xhtml.sch b/src/main/resources/com/adobe/epubcheck/schema/30/datanav/datanav-xhtml.sch
new file mode 100644
index 0000000..80ce704
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/datanav/datanav-xhtml.sch
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+
+ <pattern>
+ <rule context="h:nav[empty(ancestor::h:nav)]">
+ <assert test="normalize-space(@epub:type)">A 'nav' element in a Data Navigation Document
+ must have an 'epub:type' attribute (to identify the nature of the navigation
+ component it contains).</assert>
+ </rule>
+ </pattern>
+
+ <pattern>
+ <rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']">
+ <assert test="count(*) = 1 and h:ol">A region-based nav element must contain exactly one
+ child ol element. </assert>
+ </rule>
+ </pattern>
+ <pattern>
+ <rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:li">
+ <assert test="h:*[1]/(self::h:a | self::h:span)">The first child of a region-based nav
+ list item must be either an 'a' or 'span' element.</assert>
+ <assert test="if (count(h:*) > 1) then count(h:*) = 2 and h:*[2]/self::h:ol else true()">The first child of
+ a region-based nav list item can only be followed by a single 'ol' element.</assert>
+ </rule>
+ </pattern>
+ <pattern>
+ <rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:a">
+ <assert test="normalize-space(.)=''">WARNING: 'a' elements in region-based navs should not contain text labels.</assert>
+ </rule>
+ </pattern>
+ <pattern>
+ <rule context="h:nav[tokenize(@epub:type, '\s+') = 'region-based']//h:span">
+ <assert test="count(h:*)=2 and count(h:a) = 2">'span'elements in region-base navs must contain exactly two 'a' elements.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-collection.sch b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-collection.sch
new file mode 100644
index 0000000..864cbd6
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-collection.sch
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="dict.collection">
+ <rule context="opf:collection[tokenize(@role, '\s+') = 'dictionary']">
+ <report test="exists(opf:collection)">An EPUB Dictionary collection must not have
+ sub-collections.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="dict.collection.lang">
+ <rule context="opf:collection[tokenize(@role, '\s+') = 'dictionary']">
+ <assert
+ test="
+ exists(/opf:package/opf:metadata/opf:meta[normalize-space(@property) = 'source-language']
+ | opf:metadata/opf:meta[normalize-space(@property) = 'source-language'])"
+ >An EPUB Dictionary must declare its source language using a 'source-language'
+ metadata.</assert>
+ <assert
+ test="
+ exists(/opf:package/opf:metadata/opf:meta[normalize-space(@property) = 'target-language']
+ | opf:metadata/opf:meta[normalize-space(@property) = 'target-language'])"
+ >An EPUB Dictionary must declare its source language using a 'target-language'
+ metadata.</assert>
+ <report
+ test="count(opf:metadata/opf:meta[normalize-space(@property)='source-language'])>1"
+ >An EPUB Dictionary must not declare more than one source language.</report>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-opf.sch b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-opf.sch
new file mode 100644
index 0000000..1ba19b7
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-opf.sch
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+
+ <pattern id="dict.dctype">
+ <rule context="/opf:package/opf:metadata">
+ <assert test="child::dc:type[normalize-space(.) = 'dictionary']">The dc:type identifier
+ 'dictionary' is required.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="dict.single-dict">
+ <rule
+ context="opf:package[count(opf:collection[tokenize(@role, '\s+') = 'dictionary']) lt 2]">
+ <assert
+ test="
+ count(opf:manifest/opf:item[
+ tokenize(@properties, '\s+') = 'search-key-map'
+ and tokenize(@properties, '\s+') = 'dictionary'
+ ]) = 1"
+ >An EPUB Publication consisting of a single EPUB Dictionary must contain exactly one
+ Search Key Map document for this dictionary (i.e. exactly one item with properties
+ 'search-key-map' and 'dictionary').</assert>
+ </rule>
+ </pattern>
+ <pattern id="dict.single-dict.lang">
+ <rule context="opf:package[empty(opf:collection[tokenize(@role, '\s+') = 'dictionary'])]">
+ <assert
+ test="exists(opf:metadata/opf:meta[normalize-space(@property) = 'source-language'])"
+ >An EPUB Dictionary must declare its source language using a 'source-language'
+ metadata.</assert>
+ <assert
+ test="exists(opf:metadata/opf:meta[normalize-space(@property) = 'target-language'])"
+ >An EPUB Dictionary must declare its source language using a 'target-language'
+ metadata.</assert>
+ <report
+ test="count(opf:metadata/opf:meta[normalize-space(@property)='source-language'])>1"
+ >An EPUB Dictionary must not declare more than one source language.</report>
+ </rule>
+ </pattern>
+ <pattern id="dict.skm">
+ <rule context="opf:item[tokenize(@properties, '\s+') = 'search-key-map']">
+ <let name="skm" value="normalize-space(@href)"/>
+ <report
+ test="count(/opf:package/opf:collection[tokenize(@role,'\s+')='dictionary']
+ /opf:link[normalize-space(@href)=$skm]) > 1"
+ >Search Key Map Document '<value-of select="$skm"/>' is referenced in more than one
+ dictionary collection.</report>
+ </rule>
+ </pattern>
+ <pattern id="dict.lang">
+ <rule
+ context="
+ opf:meta[normalize-space(@property) = ('source-language',
+ 'target-language')]">
+ <let name="lang" value="normalize-space(.)"/>
+ <assert test="exists(/opf:package/opf:metadata/dc:language[normalize-space(.) = $lang])"
+ >EPUB Dictionaries 'source-language' and 'target-language' must also be declared as
+ 'dc:language' in package-level metadata.</assert>
+ </rule>
+ </pattern>
+ <pattern id="dict.type">
+ <rule context="
+ opf:meta[normalize-space(@property) = 'dictionary-type']">
+ <assert
+ test="
+ normalize-space(.) = ('monolingual',
+ 'bilingual',
+ 'multilingual',
+ 'thesaurus',
+ 'encyclopedia',
+ 'spelling',
+ 'pronouncing',
+ 'etymological')"
+ >EPUB Dictionaries 'dictionary-type' metadata must be one of 'monolingual',
+ 'bilingual', 'multilingual', 'thesaurus', 'encyclopedia', 'spelling', 'pronouncing',
+ or 'etymological'.</assert>
+ </rule>
+ </pattern>
+
+
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-xhtml.sch b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-xhtml.sch
new file mode 100644
index 0000000..200c549
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/dict/dict-xhtml.sch
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding="xslt2">
+
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+
+ <!--
+ Note: Currently untested
+ - terms ancestor context (for future extensibility)
+ -->
+
+ <pattern id="dictionary">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='dictionary']">
+ <assert test="self::h:body|self::h:section">The 'dictionary' type is only allowed on 'body' or
+ 'section' elements.</assert>
+ <assert test="exists(h:article)">A 'dictionary' must have at least one article child.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="dictionary-entry">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='dictionary']/h:article | h:*[tokenize(@epub:type,'\s+')='dictentry']">
+ <assert test="self::h:article">The 'dictentry' type is only allowed on 'article'
+ elements.</assert>
+ <assert
+ test="exists(.//h:dfn except .//h:dfn[ancestor::h:*[tokenize(@epub:type,'\s+')='condensed-entry']])"
+ >A dictionary entry must have at least one 'dfn' descendant (outside of the optional
+ condensed entry 'aside').</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="condensed-entry">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='condensed-entry']">
+ <assert test="self::h:aside">The 'condensed-entry' type is only allowed on 'aside'
+ elements.</assert>
+ <assert test="parent::h:article[parent::h:*[tokenize(@epub:type,'\s+')='dictionary']]">The
+ 'condensed-entry' type is only allowed on a child element of an 'article' dictionary
+ entry.</assert>
+ <assert test="exists(@hidden[lower-case(.)=('','hidden')])">A 'condensed-entry' must have a
+ 'hidden' attribute with its value set to 'hidden' or the empty string.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="part-of-speech-list">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='part-of-speech-list']">
+ <assert test="self::h:ol">The 'part-of-speech-list' type is only allowed on 'ol'
+ elements.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="part-of-speech-group">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='part-of-speech-group'] | h:ol[tokenize(@epub:type,'\s+')='part-of-speech-list']/h:li">
+ <let name="semchilds"
+ value="descendant::h:*[ancestor::h:*[@epub:type or self::h:li][1] is current()]"/>
+ <assert test="exists($semchilds[tokenize(@epub:type,'\s+')='part-of-speech'])">A
+ 'part-of-speech-group' must contain an element of type 'part-of-speech'.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="sense-list">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='sense-list']">
+ <assert test="self::h:ol">The 'sense-list' type is only allowed on 'ol' elements.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="tran-info">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='tran-info']">
+ <assert test="exists(../h:*[tokenize(@epub:type,'\s+')='tran'])">An element of type
+ 'tran-info' must have a sibling element of type 'tran'.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="idiom">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='idiom']">
+ <assert test="self::h:dfn">The 'idiom' type is only allowed on 'dfn' elements.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="phrase-list">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='phrase-list']">
+ <assert test="self::h:ol | self::h:ul">The 'phrase-list' type is only allowed on 'ol' or 'ul'
+ elements.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="phrase-group">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='phrase-group'] | h:*[tokenize(@epub:type,'\s+')='phrase-list']/h:li">
+ <assert test="exists(.//h:*[tokenize(@epub:type,'\s+')=('example','idiom')])">A 'phrase-group'
+ must contain an element of type 'idiom' or 'example'.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/dict/search-key-map.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/dict/search-key-map.rnc
new file mode 100644
index 0000000..3a6487f
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/dict/search-key-map.rnc
@@ -0,0 +1,25 @@
+default namespace = "http://www.idpf.org/2007/ops"
+
+start = element search-key-map {skm.search-key-map.attlist & skm.search-key-map.content }
+skm.search-key-map.attlist &= skm.xml-lang.attr & skm.id.attr? & skm.dir.attr?
+skm.search-key-map.content = skm.search-key-group+
+
+skm.search-key-group = element search-key-group {skm.search-key-group.attlist & skm.search-key-group.content}
+skm.search-key-group.attlist &= skm.href.attr & skm.id.attr?
+skm.search-key-group.content = skm.match+
+
+skm.match = element match {skm.match.attlist & skm.match.content}
+skm.match.attlist &= skm.href.attr? & skm.value.attr? & skm.title.attr? & skm.phonogram.attr? & skm.id.attr? & skm.xml-lang.attr?
+skm.match.content = skm.value*
+
+skm.value = element value {skm.value.attlist}
+skm.value.attlist &= skm.value.attr
+
+# Attributes
+skm.dir.attr = attribute dir {"ltr"|"rtl"}
+skm.id.attr = attribute id {xsd:ID}
+skm.href.attr = attribute href { xsd:anyURI }
+skm.phonogram.attr = attribute phonogram { text }
+skm.title.attr = attribute title { text }
+skm.value.attr = attribute value { text }
+skm.xml-lang.attr = attribute xml:lang { xsd:language { pattern = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*" } }
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-headings.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-headings.sch
deleted file mode 100644
index f0d7c92..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-headings.sch
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
- <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
- <ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
-
- <pattern id="edupub.headings">
- <rule context="html:body[exists(html:* except (html:section|html:aside|html:article|html:nav))]">
- <let name="arialabel-len" value="string-length(normalize-space(@aria-label))"/>
- <let name="headings" value="//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[empty(ancestor::html:section|ancestor::html:aside|ancestor::html:article|ancestor::html:nav)]"/>
-
- <report test="@aria-label and $arialabel-len = 0">Empty aria-label attribute found.</report>
-
- <assert test="$arialabel-len > 0 or count($headings) > 0">The body element requires a heading when it is used as an implied section.</assert>
-
- <!-- <report test="$arialabel-len > 0 and count($headings) > 0">The aria-label attribute must not be mixed with ranked headings.</report> -->
-
- <report test="count($headings) > 1">More than one ranked heading found as direct descendant of body.</report>
-
- <report test="count($headings) = 1 and string-length(normalize-space($headings)) = 0">Empty ranked heading detected.</report>
- </rule>
-
-
- <rule context="html:section">
- <let name="arialabel-len" value="string-length(normalize-space(@aria-label))"/>
- <let name="headings" value=".//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[(ancestor::html:section|ancestor::html:article|ancestor::html:aside|ancestor::html:nav)[1]=current()]"/>
-
- <report test="@aria-label and $arialabel-len = 0">Empty aria-label attribute found.</report>
-
- <assert test="$arialabel-len > 0 or count($headings) > 0">Section does not have a heading.</assert>
-
- <!-- <report test="$arialabel-len > 0 and count($headings) > 0">The aria-label attribute must not be mixed with ranked headings.</report> -->
-
- <report test="count($headings) > 1">More than one ranked heading found as direct descendant of section.</report>
-
- <report test="count($headings) = 1 and string-length(normalize-space($headings)) = 0">Empty ranked heading detected.</report>
- </rule>
-
-
- <rule context="html:article">
- <let name="arialabel-len" value="string-length(normalize-space(@aria-label))"/>
- <let name="headings" value=".//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[(ancestor::html:section|ancestor::html:article|ancestor::html:aside|ancestor::html:nav)[1]=current()]"/>
-
- <report test="@aria-label and $arialabel-len = 0">Empty aria-label attribute found.</report>
-
- <assert test="$arialabel-len > 0 or count($headings) > 0">Article does not have a heading.</assert>
-
- <!-- <report test="$arialabel-len > 0 and count($headings) > 0">The aria-label attribute must not be mixed with ranked headings.</report> -->
-
- <report test="count($headings) > 1">More than one ranked heading found as direct descendant of article.</report>
-
- <report test="count($headings) = 1 and string-length(normalize-space($headings)) = 0">Empty ranked heading detected.</report>
- </rule>
-
-
- <rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6">
- <let name="current-rank" value="number(substring(name(current()),2))"/>
- <let name="topmost-heading" value="ancestor::html:body//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[1]"/>
- <let name="topmost-rank" value="number(substring(name($topmost-heading[1]),2))"/>
- <let name="topmost-nest" value="number(empty($topmost-heading[1]/(ancestor::html:section|ancestor::html:article|ancestor::html:nav)))"/>
- <let name="current-nesting" value="count(ancestor::html:section|ancestor::html:article|ancestor::html:aside|ancestor::html:nav)"/>
- <let name="expected-rank" value="$topmost-rank - $topmost-nest + $current-nesting"/>
-
- <report test="$expected-rank < 7 and not($current-rank = $expected-rank)">The heading rank h<value-of select="$current-rank"/> does match the current nesting level (<value-of select="$expected-rank"/>).</report>
-
- <report test="$expected-rank > 5 and $current-rank < 6">The current heading rank should be h6.</report>
- </rule>
- </pattern>
-</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-ocf-metadata.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-ocf-metadata.sch
new file mode 100644
index 0000000..adf0638
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-ocf-metadata.sch
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+
+ <ns uri="http://www.idpf.org/2013/metadata" prefix="ocf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="dc.type">
+ <rule context="ocf:metadata">
+ <assert test="dc:type[normalize-space(.)='edupub']">A dc:type element with the value 'edupub' is required.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch
index 907e7be..4995d3d 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch
@@ -1,12 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <let name="audienceType" value="opf:package/opf:metadata/opf:meta[normalize-space(@property)='schema:audienceType'][lower-case(normalize-space(.))='schools']"/>
+
+ <pattern id="edu.dctype">
+ <rule context="opf:metadata">
+ <assert test="child::dc:type[normalize-space(.)='edupub']">The dc:type identifier 'edupub' is required.</assert>
+ </rule>
+ </pattern>
<pattern id="edu.a11y">
<rule context="opf:metadata">
- <assert test="child::opf:meta[@property='schema:accessibilityFeature']">At least one
+ <assert test="child::opf:meta[normalize-space(@property)='schema:accessibilityFeature']">At least one
schema:accessibilityFeature declaration is required.</assert>
+ <report test="child::opf:meta[normalize-space(@property)='schema:accessibilityFeature'][normalize-space(.)='none']">The
+ schema:accessibilityFeature property value 'none' is not valid in edupub. Use 'tableOfContents'
+ if no other values are applicable.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="edu.teacher.edition">
+ <rule context="dc:type[normalize-space(.)='teacher-edition']">
+ <report test="parent::opf:metadata/not(child::dc:source)">WARNING: A teacher's edition
+ should identify the corresponding student edition in a dc:source element.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="edu.schools">
+ <rule context="opf:metadata[$audienceType='schools']">
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalAlignment'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalAlignment property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalRole'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalRole property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalUse'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalUse property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:interactivityType'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:interactivityType property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:isBasedOnUrl'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:isBasedOnUrlUse property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:learningResourceType'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:learningResourceType property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:typicalAgeRange'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:typicalAgeRange property is recommended.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="edu.highered">
+ <rule context="opf:metadata[$audienceType='higher-ed']">
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalAlignment'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalAlignment property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalRole'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalRole property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalUse'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalUse property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:interactivityType'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:interactivityType property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:isBasedOnUrl'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:isBasedOnUrlUse property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:learningResourceType'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:learningResourceType property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:typicalAgeRange'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:typicalAgeRange property is recommended.</report>
</rule>
</pattern>
-
+
+ <pattern id="edu.pro-corp">
+ <rule context="opf:metadata[$audienceType='professional' or $audienceType='corporate']">
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:educationalRole'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:educationalRole property is strongly recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:interactivityType'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:interactivityType property is recommended.</report>
+ <report test="not(child::opf:meta[normalize-space(@property)='schema:isBasedOnUrl'])">WARNING: When targeting <value-of select="$audienceType"/>, including a schema:isBasedOnUrlUse property is recommended.</report>
+ </rule>
+ </pattern>
+
</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-semantics.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-semantics.sch
index 15cbe60..ca3873d 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-semantics.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-semantics.sch
@@ -5,23 +5,23 @@
<pattern id="edupub.structure.answers">
<rule context="*[@epub:type='answers']">
- <assert test="child::html:li or descendant::*[@epub:type='answer']">If the answers term
- is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the answer term.</assert>
+ <assert test="descendant::*[@epub:type='answer']">An element that carries the
+ answers term requires at least one descendant element that carries the
+ answer term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.assessments">
<rule context="*[@epub:type='assessments']">
- <assert test="child::html:li or descendant::*[@epub:type='assessment']">If the
- assessments term is not defined on an HTML ol or ul element, the element requires at
- least one descendant element that carries the assessment term.</assert>
+ <assert test="descendant::*[@epub:type='assessment']">An element that carries the
+ assessments term requires at least one descendant element that carries the
+ assessment term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.biblio">
<rule context="*[@epub:type='bibliography']">
- <assert test="descendant::*[@epub:type='biblioentry']">An element carrying the
+ <assert test="descendant::*[@epub:type='biblioentry']">An element that carries the
bibliography term requires at least one descendant element that carries the
biblioentry term.</assert>
</rule>
@@ -29,18 +29,18 @@
<pattern id="edupub.structure.credits">
<rule context="*[@epub:type='credits']">
- <assert test="child::html:li or descendant::*[@epub:type='credit']">If the credits term
- is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the credit term.</assert>
+ <assert test="descendant::*[@epub:type='credit']">An element that carries the
+ the credits term requires at least one descendant element that carries the
+ credit term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.fill-in-the-blank-problem">
<rule context="*[@epub:type='fill-in-the-blank-problem']">
- <assert test="count(descendant::*[@epub:type='question'])=1">An element carrying the
+ <assert test="descendant::*[@epub:type='question']">An element that carries the
fill-in-the-blank-problem term requires at least one descendant element that carries
the question term.</assert>
- <assert test="count(descendant::*[@epub:type='answer']) < 2">An element carrying the
+ <assert test="count(descendant::*[@epub:type='answer']) < 2">An element that carries the
fill-in-the-blank-problem term must not contain more than one descendant element
that carries the answer term.</assert>
</rule>
@@ -48,18 +48,18 @@
<pattern id="edupub.structure.footnotes">
<rule context="*[@epub:type='footnotes']">
- <assert test="child::html:li or descendant::*[@epub:type='footnote']">If the footnotes
- term is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the footnote term.</assert>
+ <assert test="descendant::*[@epub:type='footnote']">An element that carries the
+ footnotes term requires at least one descendant element that carries the
+ footnote term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.general-problem">
<rule context="*[@epub:type='general-problem']">
- <assert test="count(descendant::*[@epub:type='question'])=1">An element carrying the
+ <assert test="descendant::*[@epub:type='question']">An element that carries the
general-problem term requires at least one descendant element that carries the
question term.</assert>
- <assert test="count(descendant::*[@epub:type='answer']) < 2">An element carrying the
+ <assert test="count(descendant::*[@epub:type='answer']) < 2">An element that carries the
general-problem term must not contain more than one descendant element that carries
the answer term.</assert>
</rule>
@@ -67,54 +67,50 @@
<pattern id="edupub.structure.keywords">
<rule context="*[@epub:type='keywords']">
- <assert test="child::html:li or descendant::*[@epub:type='keyword']">If the keywords
- term is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the keyword term.</assert>
+ <assert test="descendant::*[@epub:type='keyword']">An element that carries the
+ keywords term requires at least one descendant element that carries the
+ keyword term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.learning-objectives">
<rule context="*[@epub:type='learning-objectives']">
- <assert test="child::html:li or descendant::*[@epub:type='learning-objective']">If the
- learning-objectives term is not defined on an HTML ol or ul element, the element
- requires at least one descendant element that carries the learning-objective
- term.</assert>
+ <assert test="descendant::*[@epub:type='learning-objective']">An element that carries the
+ learning-objectives term requires at least one descendant element that carries the
+ learning-objective term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.learning-outcomes">
<rule context="*[@epub:type='learning-outcomes']">
- <assert test="child::html:li or descendant::*[@epub:type='learning-outcome']">If the
- learning-outcomes term is not defined on an HTML ol or ul element, the element
- requires at least one descendant element that carries the learning-outcome
- term.</assert>
+ <assert test="descendant::*[@epub:type='learning-outcome']">An element that carries the
+ learning-outcomes term requires at least one descendant element that carries the
+ learning-outcome term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.learning-resources">
<rule context="*[@epub:type='learning-resources']">
- <assert test="child::html:li or descendant::*[@epub:type='learning-resource']">If the
- learning-resources term is not defined on an HTML ol or ul element, the element
- requires at least one descendant element that carries the learning-resource
- term.</assert>
+ <assert test="descendant::*[@epub:type='learning-resource']">An element that carries the
+ learning-resources term requires at least one descendant element that carries the
+ learning-resource term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.learning-standards">
<rule context="*[@epub:type='learning-standards']">
- <assert test="child::html:li or descendant::*[@epub:type='learning-standard']">If the
- learning-standards term is not defined on an HTML ol or ul element, the element
- requires at least one descendant element that carries the learning-standard
- term.</assert>
+ <assert test="descendant::*[@epub:type='learning-standard']">An element that carries the
+ learning-standards term requires at least one descendant element that carries the
+ learning-standard term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.match-problem">
<rule context="*[@epub:type='match-problem']">
- <assert test="count(descendant::*[@epub:type='question'])=1">An element carrying the
+ <assert test="descendant::*[@epub:type='question']">An element that carries the
match-problem term requires at least one descendant element that carries the
question term.</assert>
- <assert test="count(descendant::*[@epub:type='answer']) < 2">An element carrying the
+ <assert test="count(descendant::*[@epub:type='answer']) < 2">An element that carries the
match-problem term must not contain more than one descendant element that carries
the answer term.</assert>
</rule>
@@ -122,10 +118,10 @@
<pattern id="edupub.structure.multiple-choice-problem">
<rule context="*[@epub:type='multiple-choice']">
- <assert test="count(descendant::*[@epub:type='question'])=1">An element carrying the
+ <assert test="descendant::*[@epub:type='question']">An element that carries the
multiple-choice-problem term requires at least one descendant element that carries
the question term.</assert>
- <assert test="count(descendant::*[@epub:type='answer']) < 2">An element carrying the
+ <assert test="count(descendant::*[@epub:type='answer']) < 2">An element that carries the
multiple-choice-problem term must not contain more than one descendant element that
carries the answer term.</assert>
</rule>
@@ -140,26 +136,26 @@
<pattern id="edupub.structure.practices">
<rule context="*[@epub:type='practices']">
- <assert test="child::html:li or descendant::*[@epub:type='practice']">If the practies
- term is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the practice term.</assert>
+ <assert test="descendant::*[@epub:type='practice']">An element that carries the
+ practies term requires at least one descendant element that carries
+ the practice term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.rearnotes">
<rule context="*[@epub:type='rearnotes']">
- <assert test="child::html:li or descendant::*[@epub:type='rearnote']">If the rearnotes
- term is not defined on an HTML ol or ul element, the element requires at least one
- descendant element that carries the rearnote term.</assert>
+ <assert test="descendant::*[@epub:type='rearnote']">An element that carries the
+ rearnotes term requires at least one descendant element that carries
+ the rearnote term.</assert>
</rule>
</pattern>
<pattern id="edupub.structure.true-false-problem">
<rule context="*[@epub:type='true-false-problem']">
- <assert test="count(descendant::*[@epub:type='question'])=1">An element carrying the
+ <assert test="descendant::*[@epub:type='question']">An element that carries the
true-false-problem term requires at least one descendant element that carries the
question term.</assert>
- <assert test="count(descendant::*[@epub:type='answer']) < 2">An element carrying the
+ <assert test="count(descendant::*[@epub:type='answer']) < 2">An element that carries the
true-false-problem term must not contain more than one descendant element that
carries the answer term.</assert>
</rule>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch
new file mode 100644
index 0000000..50428eb
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
+
+ <!-- following variable declarations are used to test h# nesting depth -->
+ <!-- checks if the body contains anything other than a single section or article - i.e., is it an implied section
+ - previously tested if >1 article/section children with : or count(//html:body/child::html:*[self::html:article or self::html:section]) > 1
+ but ambiguous whether multiple section elements is an implied body or just a weird breakup of the file
+ -->
+ <let name="body-is-section" value="exists(//html:body/(html:* except (html:article|html:section)))"/>
+
+ <!-- check if implied heading -->
+ <let name="body-label-len" value="string-length(normalize-space(//html:body/@aria-label))"/>
+
+ <!-- finds the topmost heading in the file that is the descendant of the body (not sectioning element ancestors) or the first descendant of a section or article -->
+ <let name="topmost-heading" value="//html:body//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[not(ancestor::html:aside|ancestor::html:nav) and count(ancestor::html:section|ancestor::html:article) le 1]"/>
+
+ <!-- extract the starting rank from the topmost-heading -->
+ <let name="topmost-heading-rank" value="if ($body-label-len > 0) then 1 else if (exists($topmost-heading)) then number(substring(name($topmost-heading[1]),2)) else 1"/>
+
+ <!-- find the nesting depth of the topmost heading (0 if body, 1 if a section or article around it) -->
+ <let name="topmost-heading-nest" value="if ($body-label-len > 0) then 0 else if (empty($topmost-heading[1]/(ancestor::html:section|ancestor::html:article|ancestor::html:nav))) then 0 else 1"/>
+
+
+ <pattern id="edupub.headings">
+ <rule context="html:body[html:* except (html:article|html:section|html:aside|html:nav)]">
+ <let name="headings" value=".//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[empty(ancestor::html:section|ancestor::html:aside|ancestor::html:article|ancestor::html:nav)]"/>
+
+ <report test="@aria-label and $body-label-len = 0">Empty aria-label attribute found.</report>
+
+ <assert test="$body-label-len > 0 or count($headings) > 0">The body element requires a heading when it is used as an implied section.</assert>
+
+ <!-- <report test="$arialabel-len > 0 and count($headings) > 0">The aria-label attribute must not be mixed with ranked headings.</report> -->
+
+ <report test="count($headings) > 1">More than one ranked heading found as direct descendant of body.</report>
+
+ <report test="count($headings) = 1 and string-length(normalize-space(concat($headings,$headings/html:img/@alt,$headings//@aria-label))) = 0">Empty ranked heading detected.</report>
+
+ <report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the 'aria-label' attribute must not be the same as the content of the heading.</report>
+ </rule>
+
+
+ <rule context="html:section|html:article">
+ <let name="arialabel-len" value="string-length(normalize-space(@aria-label))"/>
+ <let name="headings" value=".//(html:h1|html:h2|html:h3|html:h4|html:h5|html:h6)[(ancestor::html:section|ancestor::html:article|ancestor::html:aside|ancestor::html:nav)[last()] = current()]"/>
+
+ <report test="@aria-label and $arialabel-len = 0">Empty aria-label attribute found.</report>
+
+ <assert test="$arialabel-len > 0 or count($headings) > 0"><value-of select="name()"/> does not have a heading.</assert>
+
+ <!-- <report test="$arialabel-len > 0 and count($headings) > 0">The aria-label attribute must not be mixed with ranked headings.</report> -->
+
+ <report test="count($headings) > 1">More than one ranked heading found as direct descendant of <value-of select="name()"/>.</report>
+
+ <report test="count($headings) = 1 and string-length(normalize-space(concat($headings,$headings/html:img/@alt,$headings//@aria-label))) = 0">Empty ranked heading detected.</report>
+
+ <report test="@aria-label and (normalize-space($headings) = normalize-space(@aria-label))">The value of the 'aria-label' attribute must not be the same as the content of the heading.</report>
+ </rule>
+
+ <rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6">
+ <!-- get the # from the h# tag found -->
+ <let name="current-rank" value="number(substring(name(current()),2))"/>
+
+ <!-- find nesting depth -->
+ <let name="current-nesting" value="count(ancestor::html:section|ancestor::html:article|ancestor::html:aside|ancestor::html:nav)"/>
+
+ <!-- derive the expected rank of this heading from the implied body or sectioning -->
+ <let name="expected-rank" value="if ($body-is-section) then $topmost-heading-rank - $topmost-heading-nest + $current-nesting else $topmost-heading-rank + $current-nesting - 1"/>
+
+ <!-- report ranked headings in sectioning roots -->
+ <report test="ancestor::html:figure or ancestor::html:blockquote">Ranked headings are not valid in figure or blockquote</report>
+
+ <!-- if the expected rank is below 6, check that it matches what is expected -->
+ <report test="$expected-rank < 6 and not($current-rank = $expected-rank)">The heading rank h<value-of select="$current-rank"/> does not match the current nesting level (<value-of select="$expected-rank"/>).</report>
+
+ <!-- otherwise, just stop testing after 5 and report any headings that aren't six, since no higher exist -->
+ <report test="$expected-rank > 5 and $current-rank < 6">The current heading rank should be h6.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="edupub.sectioning">
+ <rule context="*[parent::html:body or parent::html:section][not(self::html:section)]">
+ <report test="preceding-sibling::html:section">Non-section elements not allowed between or after section elements.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="edupub.subtitles">
+ <rule context="html:p[@epub:type='subtitle'][preceding-sibling::*[self::html:h1|self::html:h2|self::html:h3|self::html:h4|self::html:h5|self::html:h6]]">
+ <assert test="ancestor::html:header">Section subtitles must be wrapped in a header element.</assert>
+ </rule>
+ </pattern>
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30-PREP.sch b/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30-PREP.sch
deleted file mode 100644
index 060f823..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30-PREP.sch
+++ /dev/null
@@ -1,70 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron">
-
- <ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
- <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
-
- <pattern id="nav-ocurrence">
- <rule context="html:body">
- <assert test="count(.//html:nav[@epub:type='toc']) = 1">Exactly one 'toc' nav element
- must be present</assert>
- <assert test="count(.//html:nav[@epub:type='page-list']) < 2">Multiple occurrences of
- the 'page-list' nav element</assert>
- <assert test="count(.//html:nav[@epub:type='landmarks']) < 2">Multiple occurrences of
- the 'landmarks' nav element</assert>
- </rule>
- </pattern>
-
- <pattern id="span-no-sublist">
- <rule context="html:body//html:nav//html:span">
- <assert test="count(.//ol) = 0"> The span element must only be used as heading for flat
- sublists (not hierarchical navigation structures) </assert>
- </rule>
- </pattern>
-
- <pattern id="landmarks">
- <rule context="html:nav[@epub:type='landmarks']//html:ol//html:a">
- <assert test="@epub:type">Missing epub:type attribute on anchor inside 'landmarks' nav
- element</assert>
- </rule>
- </pattern>
-
- <pattern id="link-labels">
- <rule context="html:nav//html:ol//html:a">
- <assert test="string-length(normalize-space(string(.))) > 0">Anchors within nav elements
- must contain text</assert>
- </rule>
- </pattern>
-
- <pattern id="span-labels">
- <rule context="html:nav//html:ol//html:span">
- <assert test="string-length(normalize-space(string(.))) > 0">Spans within nav elements
- must contain text</assert>
- </rule>
- </pattern>
-
- <pattern id="req-heading">
- <rule context="html:nav[not(@epub:type = 'toc') and not (@epub:type = 'page-list') and not (@epub:type = 'landmarks')]">
- <let name="fc" value="local-name(./*[1])"/>
- <assert test="(starts-with($fc,'h') and string-length($fc) = 2) or ($fc = 'hgroup')">nav
- elements other than 'toc', 'page-list' and 'landmarks' must contain a heading as the
- first child</assert>
- </rule>
- </pattern>
-
- <pattern id="heading-content">
- <rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6|html:hgroup">
- <assert test="string-length(normalize-space(string(.))) > 0">Heading elements must
- contain text</assert>
- </rule>
- </pattern>
-
-
- <!-- warnings mode <pattern id="page-list-flat">
- <rule context="html:body//html:nav[@epub:type='page-list']">
- <assert test="count(.//html:ol) = 1">The page-list navigation structure should be a
- list, not a nested hierarchy</assert>
- </rule>
- </pattern>
- -->
-
-</schema>
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch b/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch
index a06a22d..646d97f 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch
@@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
-<schema xmlns="http://purl.oclc.org/dsdl/schematron">
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
<ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
<pattern id="nav-ocurrence">
<rule context="html:body">
- <assert test="count(.//html:nav[@epub:type='toc']) = 1">Exactly one 'toc' nav element
+ <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='toc']) = 1">Exactly one 'toc' nav element
must be present</assert>
- <assert test="count(.//html:nav[@epub:type='page-list']) < 2">Multiple occurrences of
+ <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='page-list']) < 2">Multiple occurrences of
the 'page-list' nav element</assert>
- <assert test="count(.//html:nav[@epub:type='landmarks']) < 2">Multiple occurrences of
+ <assert test="count(.//html:nav[tokenize(@epub:type,'\s+')='landmarks']) < 2">Multiple occurrences of
the 'landmarks' nav element</assert>
</rule>
</pattern>
@@ -23,7 +23,7 @@
</pattern>
<pattern id="landmarks">
- <rule context="html:nav[@epub:type='landmarks']//html:ol//html:a">
+ <rule context="html:nav[tokenize(@epub:type,'\s+')='landmarks']//html:ol//html:a">
<assert test="@epub:type">Missing epub:type attribute on anchor inside 'landmarks' nav
element</assert>
</rule>
@@ -31,21 +31,23 @@
<pattern id="link-labels">
<rule context="html:nav//html:ol//html:a">
- <assert test="string-length(normalize-space(string(.))) > 0">Anchors within nav elements
- must contain text</assert>
+ <assert
+ test="string-length(normalize-space(concat(.,./html:img/@alt,.//@aria-label))) > 0"
+ >Anchors within nav elements must contain text</assert>
</rule>
</pattern>
<pattern id="span-labels">
<rule context="html:nav//html:ol//html:span">
- <assert test="string-length(normalize-space(string(.))) > 0">Spans within nav elements
- must contain text</assert>
+ <assert
+ test="string-length(normalize-space(concat(.,./html:img/@alt,.//@aria-label))) > 0"
+ >Spans within nav elements must contain text</assert>
</rule>
</pattern>
<pattern id="req-heading">
<rule
- context="html:nav[not(@epub:type = 'toc') and not (@epub:type = 'page-list') and not (@epub:type = 'landmarks')]">
+ context="html:nav[not(tokenize(@epub:type,'\s+') = ('toc','page-list','landmarks'))]">
<let name="fc" value="local-name(./*[1])"/>
<assert test="(starts-with($fc,'h') and string-length($fc) = 2) or ($fc = 'hgroup')">nav
elements other than 'toc', 'page-list' and 'landmarks' must contain a heading as the
@@ -55,8 +57,9 @@
<pattern id="heading-content">
<rule context="html:h1|html:h2|html:h3|html:h4|html:h5|html:h6|html:hgroup">
- <assert test="string-length(normalize-space(string(.))) > 0">Heading elements must
- contain text</assert>
+ <assert
+ test="string-length(normalize-space(concat(.,./html:img/@alt,.//@aria-label))) > 0"
+ >Heading elements must contain text</assert>
</rule>
</pattern>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-PREP.sch b/src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-PREP.sch
deleted file mode 100644
index d57baad..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/epub-svg-30-PREP.sch
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron">
-
- <ns uri="http://www.w3.org/2000/svg" prefix="svg"/>
-
- <pattern id="id-unique">
- <!-- note: assumes that NCName lexical constraints are tested elsewhere -->
- <let name="id-set" value="//*[@id]"/>
- <rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of select="current()/@id"/>'</assert>
- </rule>
-</pattern>
- <pattern id="svg-fo-re">
- <rule context="svg:foreignObject[@requiredExtensions]">
- <assert test="@requiredExtensions = 'http://www.idpf.org/2007/ops'">Invalid value (expecting: 'http://www.idpf.org/2007/ops')</assert>
- </rule>
-</pattern>
-
-</schema>
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30-PREP.sch b/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30-PREP.sch
deleted file mode 100644
index 1ac573d..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30-PREP.sch
+++ /dev/null
@@ -1,354 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
-
- <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
- <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
- <ns uri="http://www.w3.org/1998/Math/MathML" prefix="math"/>
- <ns uri="http://www.w3.org/2001/10/synthesis" prefix="ssml"/>
- <ns uri="http://www.w3.org/2001/xml-events" prefix="ev"/>
- <ns uri="http://www.w3.org/2000/svg" prefix="svg"/>
-
- <let name="id-set" value="//*[@id]"/>
-
- <pattern id="ancestor-area-map">
- <rule context="h:area">
- <assert test="ancestor::h:map">The <value-of select="replace('h:area','h:','')"/> element must have an ancestor <value-of select="replace('h:map','h:','')"/> element.</assert>
- </rule>
- </pattern>
-
- <pattern id="ancestor-imgismap-ahref">
- <rule context="h:img[@ismap]">
- <assert test="ancestor::h:a[@href]">The <value-of select="replace('h:img[@ismap]','h:','')"/> element must have an ancestor <value-of select="replace('h:a[@href]','h:','')"/> element.</assert>
- </rule>
- </pattern>
-
- <pattern id="descendant-a-interactive">
- <rule context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')] |h:keygen|h:label|h:menu[@type='toolbar']|h:object[@usemap]|h:select|h:textarea|h:video[@controls]">
- <report test="ancestor::h:a">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:a)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-button-interactive">
- <rule context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')] |h:keygen|h:label|h:menu[@type='toolbar']|h:object[@usemap]|h:select|h:textarea|h:video[@controls]">
- <report test="ancestor::h:button">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:button)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-audio-audio">
- <rule context="h:audio">
- <report test="ancestor::h:audio">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:audio)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-audio-video">
- <rule context="h:video">
- <report test="ancestor::h:audio">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:audio)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-video-video">
- <rule context="h:video">
- <report test="ancestor::h:video">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:video)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-video-audio">
- <rule context="h:audio">
- <report test="ancestor::h:video">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:video)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-address-address">
- <rule context="h:address">
- <report test="ancestor::h:address">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:address)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-address-header">
- <rule context="h:header">
- <report test="ancestor::h:address">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:address)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-address-footer">
- <rule context="h:footer">
- <report test="ancestor::h:address">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:address)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-form-form">
- <rule context="h:form">
- <report test="ancestor::h:form">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:form)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-progress-progress">
- <rule context="h:progress">
- <report test="ancestor::h:progress">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:progress)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-meter-meter">
- <rule context="h:meter">
- <report test="ancestor::h:meter">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:meter)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-dfn-dfn">
- <rule context="h:dfn">
- <report test="ancestor::h:dfn">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:dfn)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-time-time">
- <rule context="h:time">
- <report test="ancestor::h:time">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:time)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-caption-table">
- <rule context="h:table">
- <report test="ancestor::h:caption">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:caption)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-header-header">
- <rule context="h:header">
- <report test="ancestor::h:header">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:header)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-header-footer">
- <rule context="h:footer">
- <report test="ancestor::h:header">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:header)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-footer-footer">
- <rule context="h:footer">
- <report test="ancestor::h:footer">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:footer)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-footer-header">
- <rule context="h:header">
- <report test="ancestor::h:footer">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:footer)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-label-label">
- <rule context="h:label">
- <report test="ancestor::h:label">The <name/> element must not appear inside <value-of select="local-name(ancestor::h:label)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-annotation-xml-math">
- <rule context="math:*">
- <report test="ancestor::math:annotation-xml[@encoding='application/xhtml+xml' and @name='alternate-representation']">The <name/> element must not appear inside <value-of select="local-name(ancestor::math:annotation-xml[@encoding='application/xhtml+xml' and @name='alternate-representation'])"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="descendant-svgtitle-svg">
- <rule context="svg:*">
- <report test="ancestor::svg:title">The <name/> element must not appear inside <value-of select="local-name(ancestor::svg:title)"/> elements.</report>
- </rule>
- </pattern>
-
- <pattern id="bdo-dir">
- <rule context="h:bdo">
- <assert test="@dir">The <name/> element must have a <value-of select="'dir'"/> attribute.</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-aria-describedby">
- <rule context="*[@aria-describedby]">
- <assert test="every $idref in tokenize(@aria-describedby,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@aria-describedby"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-output-for">
- <rule context="h:output[@for]">
- <assert test="every $idref in tokenize(@for,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@for"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-aria-flowto">
- <rule context="*[@aria-flowto]">
- <assert test="every $idref in tokenize(@aria-flowto,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@aria-flowto"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-aria-labelledby">
- <rule context="*[@aria-labelledby]">
- <assert test="every $idref in tokenize(@aria-labelledby,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@aria-labelledby"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-aria-owns">
- <rule context="*[@aria-owns]">
- <assert test="every $idref in tokenize(@aria-owns,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@aria-owns"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idrefs-aria-controls">
- <rule context="*[@aria-controls]">
- <assert test="every $idref in tokenize(@aria-controls,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))">The <name path="@aria-controls"/> attribute must refer to elements in the same document (target ID missing)</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-mathml-xref">
- <rule context="math:*[@xref]">
- <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@xref">The <name path="@xref"/> attribute must refer to an element in the same document (the ID '<value-of select="current()/@xref"/>' does not exist).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-mathml-indenttarget">
- <rule context="math:*[@indenttarget]">
- <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@indenttarget">The <name path="@indenttarget"/> attribute must refer to an element in the same document (the ID '<value-of select="current()/@indenttarget"/>' does not exist).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-contextmenu">
- <rule context="h:*[@contextmenu]">
- <assert test="//h:menu[@id = current()/@contextmenu]">The <name path="@contextmenu"/> attribute does not refer to an allowed target element (expecting: <value-of select="replace('h:menu','h:','')"/>).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-input-list">
- <rule context="h:input[@list]">
- <assert test="//h:datalist[@id = current()/@list]">The <name path="@list"/> attribute does not refer to an allowed target element (expecting: <value-of select="replace('h:datalist','h:','')"/>).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-forms-form">
- <rule context="h:*[@form]">
- <assert test="//h:form[@id = current()/@form]">The <name path="@form"/> attribute does not refer to an allowed target element (expecting: <value-of select="replace('h:form','h:','')"/>).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-aria-activedescendant">
- <rule context="*[@aria-activedescendant]">
- <assert test="descendant::*[@id = current()/@aria-activedescendant]">The aria-activedescendant attribute must refer to a descendant element.</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-label-for">
- <rule context="h:label[@for]">
- <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@for and (local-name($elem) eq 'button' or (local-name($elem) eq 'input' and not($elem/@type='hidden')) or local-name($elem) eq 'keygen' or local-name($elem) eq 'meter' or local-name($elem) eq 'output' or local-name($elem) eq 'progress' or local-name($elem) eq 'select' [...]
- </rule>
- </pattern>
-
- <pattern id="idrefs-headers">
- <rule context="h:*[@headers]">
- <let name="table" value="ancestor::h:table"/>
- <assert test="every $idref in tokenize(@headers, '\s+') satisfies (some $elem in $table//h:th satisfies ($elem/@id eq $idref))">The headers attribute must refer to th elements in the same table.</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-trigger-observer">
- <rule context="epub:trigger[@ev:observer]">
- <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@ev:observer">The <name path="@ev:observer"/> attribute must refer to an element in the same document (the ID '<value-of select="current()/@ev:observer"/>' does not exist).</assert>
- </rule>
- </pattern>
-
- <pattern id="idref-trigger-ref">
- <rule context="epub:trigger[@ref]">
- <assert test="some $elem in $id-set satisfies $elem/@id eq current()/@ref">The <name path="@ref"/> attribute must refer to an element in the same document (the ID '<value-of select="current()/@ref"/>' does not exist).</assert>
- </rule>
- </pattern>
-
- <pattern id="map.name">
- <rule context="h:map[@name]">
- <let name="name-set" value="//h:map[@name]"/>
- <assert test="count($name-set[@name = current()/@name]) = 1">Duplicate map name '<value-of select="current()/@name"/>'</assert>
- </rule>
- </pattern>
-
- <pattern id="map.id">
- <rule context="h:map[@id and @name]">
- <assert test="@id = @name">The id attribute on the map element must have the same value as the name attribute.</assert>
- </rule>
- </pattern>
-
- <pattern id="lang-xmllang">
- <rule context="h:*[@lang and @xml:lang]">
- <assert test="lower-case(@xml:lang) = lower-case(@lang)">The lang and xml:lang attributes must have the same value.</assert>
- </rule>
- </pattern>
-
- <pattern id="id-unique">
- <rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of select="current()/@id"/>'</assert>
- </rule>
- </pattern>
-
- <pattern id="select-multiple">
- <rule context="h:select[not(@multiple)]">
- <report test="count(descendant::h:option[@selected]) > 1">A select element whose multiple attribute is not specified must not have more than one descendant option element with its selected attribute set.</report>
- </rule>
- </pattern>
-
- <pattern id="track">
- <rule context="h:track">
- <report test="@label and normalize-space(@label) = ''">The track element label attribute value must not be the empty string.</report>
- <report test="@default and preceding-sibling::h:track[@default]">There must not be more than one track child of a media element element with the default attribute specified.</report>
- </rule>
- </pattern>
-
- <pattern id="ssml-ph">
- <rule context="*[@ssml:ph]">
- <report test="ancestor::*[@ssml:ph]">The ssml:ph attribute must not be specified on a descendant of an element that also carries this attribute.</report>
- </rule>
- </pattern>
-
- <pattern id="style-scoped">
- <rule context="h:style[ancestor::h:body]">
- <assert test="every $elem in preceding-sibling::* satisfies local-name($elem) eq 'style'">The scoped style element must occur before any other flow content other than other style elements and inter-element whitespace.</assert>
- </rule>
- </pattern>
-
- <pattern id="link-sizes">
- <rule context="h:link[@sizes]">
- <assert test="@rel='icon'">The sizes attribute must not be specified on link elements that do not have a rel attribute that specifies the icon keyword.</assert>
- </rule>
- </pattern>
-
- <pattern id="meta-charset">
- <rule context="h:meta[@charset]">
- <assert test="count(preceding-sibling::h:meta[@charset]) = 0">There must not be more than one meta element with a charset attribute per document.</assert>
- </rule>
- </pattern>
-
- <pattern id="article-pubdate">
- <rule context="h:article[h:time]">
- <assert test="count(./h:time[@pubdate]) < 2">For each article element, there must be no more than one time element child with a pubdate attribute</assert>
- </rule>
- </pattern>
-
- <pattern id="document-pubdate">
- <rule context="h:time[not (ancestor::h:article)]">
- <assert test="count(//h:time[@pubdate and not (ancestor::h:article)]) < 2">For each Document, there must be no more than one time element with a pubdate
- attribute that does not have an ancestor article element.</assert>
- </rule>
- </pattern>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <pattern id="svg-fo-re">
- <rule context="svg:foreignObject[@requiredExtensions]">
- <assert test="@requiredExtensions = 'http://www.idpf.org/2007/ops'">Invalid value (expecting: 'http://www.idpf.org/2007/ops')</assert>
- </rule>
-</pattern>
-
-</schema>
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30.sch b/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30.sch
index 240672a..9169edc 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/epub-xhtml-30.sch
@@ -1,133 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
-
+
<ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
<ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
<ns uri="http://www.w3.org/1998/Math/MathML" prefix="math"/>
<ns uri="http://www.w3.org/2001/10/synthesis" prefix="ssml"/>
<ns uri="http://www.w3.org/2001/xml-events" prefix="ev"/>
- <ns uri="http://www.w3.org/2000/svg" prefix="svg" />
-
+ <ns uri="http://www.w3.org/2000/svg" prefix="svg"/>
+
<let name="id-set" value="//*[@id]"/>
-
- <pattern id="ancestor-area-map" is-a="required-ancestor">
+
+ <pattern id="encoding.decl.state">
+ <rule context="h:meta[lower-case(@http-equiv)='content-type']">
+ <assert test="matches(normalize-space(@content),'text/html;\s*charset=utf-8',i)">The
+ meta element in encoding declaration state (http-equiv='content-type') must have the
+ value 'text/html; charset=utf-8'</assert>
+ <assert test="empty(../h:meta[@charset])">A document must not contain both a meta element
+ in encoding declaration state (http-equiv='content-type') and a meta element with
+ the charset attribute present.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ancestor-area-map" is-a="required-ancestor">
<param name="descendant" value="h:area"/>
- <param name="ancestor" value="h:map"/>
+ <param name="ancestor" value="h:map"/>
</pattern>
- <pattern id="ancestor-imgismap-ahref" is-a="required-ancestor">
+ <pattern id="ancestor-imgismap-ahref" is-a="required-ancestor">
<param name="descendant" value="h:img[@ismap]"/>
- <param name="ancestor" value="h:a[@href]"/>
+ <param name="ancestor" value="h:a[@href]"/>
</pattern>
-
- <pattern id="descendant-a-interactive" is-a="no-interactive-content-descendants">
- <param name="ancestor" value="h:a"/>
+
+ <pattern id="descendant-a-interactive" is-a="no-interactive-content-descendants">
+ <param name="ancestor" value="h:a"/>
</pattern>
-
- <pattern id="descendant-button-interactive" is-a="no-interactive-content-descendants">
- <param name="ancestor" value="h:button"/>
+
+ <pattern id="descendant-button-interactive" is-a="no-interactive-content-descendants">
+ <param name="ancestor" value="h:button"/>
</pattern>
-
- <pattern id="descendant-audio-audio" is-a="disallowed-descendants">
+
+ <pattern id="descendant-audio-audio" is-a="disallowed-descendants">
<param name="ancestor" value="h:audio"/>
- <param name="descendant" value="h:audio"/>
+ <param name="descendant" value="h:audio"/>
</pattern>
-
- <pattern id="descendant-audio-video" is-a="disallowed-descendants">
+
+ <pattern id="descendant-audio-video" is-a="disallowed-descendants">
<param name="ancestor" value="h:audio"/>
- <param name="descendant" value="h:video"/>
+ <param name="descendant" value="h:video"/>
</pattern>
-
- <pattern id="descendant-video-video" is-a="disallowed-descendants">
+
+ <pattern id="descendant-video-video" is-a="disallowed-descendants">
<param name="ancestor" value="h:video"/>
- <param name="descendant" value="h:video"/>
+ <param name="descendant" value="h:video"/>
</pattern>
-
- <pattern id="descendant-video-audio" is-a="disallowed-descendants">
+
+ <pattern id="descendant-video-audio" is-a="disallowed-descendants">
<param name="ancestor" value="h:video"/>
- <param name="descendant" value="h:audio"/>
+ <param name="descendant" value="h:audio"/>
</pattern>
-
- <pattern id="descendant-address-address" is-a="disallowed-descendants">
+
+ <pattern id="descendant-address-address" is-a="disallowed-descendants">
<param name="ancestor" value="h:address"/>
- <param name="descendant" value="h:address"/>
+ <param name="descendant" value="h:address"/>
</pattern>
-
- <pattern id="descendant-address-header" is-a="disallowed-descendants">
+
+ <pattern id="descendant-address-header" is-a="disallowed-descendants">
<param name="ancestor" value="h:address"/>
- <param name="descendant" value="h:header"/>
+ <param name="descendant" value="h:header"/>
</pattern>
-
- <pattern id="descendant-address-footer" is-a="disallowed-descendants">
+
+ <pattern id="descendant-address-footer" is-a="disallowed-descendants">
<param name="ancestor" value="h:address"/>
- <param name="descendant" value="h:footer"/>
+ <param name="descendant" value="h:footer"/>
</pattern>
- <pattern id="descendant-form-form" is-a="disallowed-descendants">
+ <pattern id="descendant-form-form" is-a="disallowed-descendants">
<param name="ancestor" value="h:form"/>
- <param name="descendant" value="h:form"/>
+ <param name="descendant" value="h:form"/>
</pattern>
- <pattern id="descendant-progress-progress" is-a="disallowed-descendants">
+ <pattern id="descendant-progress-progress" is-a="disallowed-descendants">
<param name="ancestor" value="h:progress"/>
- <param name="descendant" value="h:progress"/>
+ <param name="descendant" value="h:progress"/>
</pattern>
- <pattern id="descendant-meter-meter" is-a="disallowed-descendants">
+ <pattern id="descendant-meter-meter" is-a="disallowed-descendants">
<param name="ancestor" value="h:meter"/>
- <param name="descendant" value="h:meter"/>
+ <param name="descendant" value="h:meter"/>
</pattern>
- <pattern id="descendant-dfn-dfn" is-a="disallowed-descendants">
+ <pattern id="descendant-dfn-dfn" is-a="disallowed-descendants">
<param name="ancestor" value="h:dfn"/>
- <param name="descendant" value="h:dfn"/>
+ <param name="descendant" value="h:dfn"/>
</pattern>
- <pattern id="descendant-time-time" is-a="disallowed-descendants">
+ <pattern id="descendant-time-time" is-a="disallowed-descendants">
<param name="ancestor" value="h:time"/>
- <param name="descendant" value="h:time"/>
+ <param name="descendant" value="h:time"/>
</pattern>
- <pattern id="descendant-caption-table" is-a="disallowed-descendants">
+ <pattern id="descendant-caption-table" is-a="disallowed-descendants">
<param name="ancestor" value="h:caption"/>
- <param name="descendant" value="h:table"/>
+ <param name="descendant" value="h:table"/>
</pattern>
-
- <pattern id="descendant-header-header" is-a="disallowed-descendants">
+
+ <pattern id="descendant-header-header" is-a="disallowed-descendants">
<param name="ancestor" value="h:header"/>
- <param name="descendant" value="h:header"/>
+ <param name="descendant" value="h:header"/>
</pattern>
-
- <pattern id="descendant-header-footer" is-a="disallowed-descendants">
+
+ <pattern id="descendant-header-footer" is-a="disallowed-descendants">
<param name="ancestor" value="h:header"/>
- <param name="descendant" value="h:footer"/>
+ <param name="descendant" value="h:footer"/>
</pattern>
-
- <pattern id="descendant-footer-footer" is-a="disallowed-descendants">
+
+ <pattern id="descendant-footer-footer" is-a="disallowed-descendants">
<param name="ancestor" value="h:footer"/>
- <param name="descendant" value="h:footer"/>
+ <param name="descendant" value="h:footer"/>
</pattern>
-
- <pattern id="descendant-footer-header" is-a="disallowed-descendants">
+
+ <pattern id="descendant-footer-header" is-a="disallowed-descendants">
<param name="ancestor" value="h:footer"/>
- <param name="descendant" value="h:header"/>
+ <param name="descendant" value="h:header"/>
</pattern>
-
- <pattern id="descendant-label-label" is-a="disallowed-descendants">
+
+ <pattern id="descendant-label-label" is-a="disallowed-descendants">
<param name="ancestor" value="h:label"/>
- <param name="descendant" value="h:label"/>
+ <param name="descendant" value="h:label"/>
</pattern>
-
- <pattern id="descendant-annotation-xml-math" is-a="disallowed-descendants">
- <param name="ancestor" value="math:annotation-xml[@encoding='application/xhtml+xml' and @name='alternate-representation']"/>
- <param name="descendant" value="math:*"/>
+
+ <pattern id="descendant-annotation-xml-math" is-a="disallowed-descendants">
+ <param name="ancestor"
+ value="math:annotation-xml[@encoding='application/xhtml+xml' and @name='alternate-representation']"/>
+ <param name="descendant" value="math:*"/>
</pattern>
-
- <pattern id="descendant-svgtitle-svg" is-a="disallowed-descendants">
+
+ <pattern id="descendant-svgtitle-svg" is-a="disallowed-descendants">
<param name="ancestor" value="svg:title"/>
- <param name="descendant" value="svg:*"/>
+ <param name="descendant" value="svg:*"/>
</pattern>
-
+
<pattern id="bdo-dir" is-a="required-attr">
<param name="elem" value="h:bdo"/>
<param name="attr" value="dir"/>
@@ -162,7 +174,7 @@
<param name="element" value="*"/>
<param name="idrefs-attr-name" value="aria-controls"/>
</pattern>
-
+
<pattern id="idref-mathml-xref" is-a="idref-any">
<param name="element" value="math:*"/>
<param name="idref-attr-name" value="xref"/>
@@ -178,13 +190,13 @@
<param name="idref-attr-name" value="contextmenu"/>
<param name="target-name" value="h:menu"/>
</pattern>
-
+
<pattern id="idref-input-list" is-a="idref-named">
<param name="element" value="h:input"/>
<param name="idref-attr-name" value="list"/>
<param name="target-name" value="h:datalist"/>
</pattern>
-
+
<pattern id="idref-forms-form" is-a="idref-named">
<param name="element" value="h:*"/>
<param name="idref-attr-name" value="form"/>
@@ -193,12 +205,12 @@
<pattern id="idref-aria-activedescendant">
<rule context="*[@aria-activedescendant]">
- <assert test="descendant::*[@id = current()/@aria-activedescendant]"
- >The aria-activedescendant attribute must refer to a descendant element.</assert>
+ <assert test="descendant::*[@id = current()/@aria-activedescendant]">The
+ aria-activedescendant attribute must refer to a descendant element.</assert>
</rule>
</pattern>
- <pattern id="idref-label-for">
+ <pattern id="idref-label-for">
<rule context="h:label[@for]">
<assert
test="some $elem in $id-set satisfies $elem/@id eq current()/@for and
@@ -210,192 +222,203 @@
or local-name($elem) eq 'progress'
or local-name($elem) eq 'select'
or local-name($elem) eq 'textarea')"
- >The for attribute does not refer to an allowed target element (expecting: button|keygen|meter|output|progress|select|textarea|input[not(@type='hidden')]).</assert>
+ >The for attribute does not refer to an allowed target element (expecting:
+ button|keygen|meter|output|progress|select|textarea|input[not(@type='hidden')]).</assert>
</rule>
</pattern>
-
- <pattern id="idrefs-headers">
- <rule context="h:*[@headers]">
+
+ <pattern id="idrefs-headers">
+ <rule context="h:*[@headers]">
<let name="table" value="ancestor::h:table"/>
- <assert test="every $idref in tokenize(@headers, '\s+') satisfies (some $elem in $table//h:th satisfies ($elem/@id eq $idref))"
- >The headers attribute must refer to th elements in the same table.</assert>
+ <assert
+ test="every $idref in tokenize(@headers, '\s+') satisfies (some $elem in $table//h:th satisfies ($elem/@id eq $idref))"
+ >The headers attribute must refer to th elements in the same table.</assert>
</rule>
- </pattern>
-
+ </pattern>
+
<pattern id="idref-trigger-observer" is-a="idref-any">
<param name="element" value="epub:trigger"/>
<param name="idref-attr-name" value="ev:observer"/>
</pattern>
-
+
<pattern id="idref-trigger-ref" is-a="idref-any">
<param name="element" value="epub:trigger"/>
<param name="idref-attr-name" value="ref"/>
</pattern>
-
- <pattern id="map.name" >
- <rule context='h:map[@name]'>
+
+ <pattern id="map.name">
+ <rule context="h:map[@name]">
<let name="name-set" value="//h:map[@name]"/>
- <assert test="count($name-set[@name = current()/@name]) = 1">Duplicate map name '<value-of
- select="current()/@name"/>'</assert>
+ <assert test="count($name-set[@name = current()/@name]) = 1">Duplicate map name
+ '<value-of select="current()/@name"/>'</assert>
</rule>
</pattern>
-
- <pattern id="map.id" >
- <rule context='h:map[@id and @name]'>
- <assert test='@id = @name'
- >The id attribute on the map element must have the same value as the name attribute.</assert>
- </rule>
- </pattern>
-
- <pattern id='lang-xmllang'>
- <rule context='h:*[@lang and @xml:lang]'>
- <assert test="lower-case(@xml:lang) = lower-case(@lang)"
- >The lang and xml:lang attributes must have the same value.</assert>
+
+ <pattern id="map.id">
+ <rule context="h:map[@id and @name]">
+ <assert test="@id = @name">The id attribute on the map element must have the same value
+ as the name attribute.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="lang-xmllang">
+ <rule context="h:*[@lang and @xml:lang]">
+ <assert test="lower-case(@xml:lang) = lower-case(@lang)">The lang and xml:lang
+ attributes must have the same value.</assert>
</rule>
</pattern>
-
+
<pattern id="id-unique">
<rule context="*[@id]">
<assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of
- select="current()/@id"/>'</assert>
+ select="current()/@id"/>'</assert>
</rule>
</pattern>
-
+
<pattern id="select-multiple">
<rule context="h:select[not(@multiple)]">
- <report test='count(descendant::h:option[@selected]) > 1'
- >A select element whose multiple attribute is not specified must not have more than one descendant option element with its selected attribute set.</report>
+ <report test="count(descendant::h:option[@selected]) > 1">A select element whose
+ multiple attribute is not specified must not have more than one descendant option
+ element with its selected attribute set.</report>
</rule>
- </pattern>
-
- <pattern id="track">
+ </pattern>
+
+ <pattern id="track">
<rule context="h:track">
- <report test="@label and normalize-space(@label) = ''"
- >The track element label attribute value must not be the empty string.</report>
- <report test="@default and preceding-sibling::h:track[@default]"
- >There must not be more than one track child of a media element element with the default attribute specified.</report>
+ <report test="@label and normalize-space(@label) = ''">The track element label attribute
+ value must not be the empty string.</report>
+ <report test="@default and preceding-sibling::h:track[@default]">There must not be more
+ than one track child of a media element element with the default attribute
+ specified.</report>
</rule>
</pattern>
-
- <pattern id="ssml-ph">
+
+ <pattern id="ssml-ph">
<rule context="*[@ssml:ph]">
- <report test="ancestor::*[@ssml:ph]"
- >The ssml:ph attribute must not be specified on a descendant of an element that also carries this attribute.</report>
- </rule>
+ <report test="ancestor::*[@ssml:ph]">The ssml:ph attribute must not be specified on a
+ descendant of an element that also carries this attribute.</report>
+ </rule>
</pattern>
-
+
<pattern id="style-scoped">
<rule context="h:style[ancestor::h:body]">
<!-- Note: this sch test is at risk as it is fragile and doesnt fully cover the
rules of http://dev.w3.org/html5/spec/single-page.html#attr-style-scoped.
See also https://www.w3.org/Bugs/Public/show_bug.cgi?id=13102 -->
- <assert test="every $elem in preceding-sibling::* satisfies (local-name($elem) eq 'style') or (local-name($elem) eq 'figcaption') "
- >The scoped style element must occur before any other flow content other than other style elements and inter-element whitespace.</assert>
+ <assert
+ test="every $elem in preceding-sibling::* satisfies (local-name($elem) eq 'style') or (local-name($elem) eq 'figcaption') "
+ >The scoped style element must occur before any other flow content other than other
+ style elements and inter-element whitespace.</assert>
</rule>
</pattern>
-
+
<pattern id="link-sizes">
<rule context="h:link[@sizes]">
- <assert test="@rel='icon'"
- >The sizes attribute must not be specified on link elements that do not have a rel attribute that specifies the icon keyword.</assert>
+ <assert test="@rel='icon'">The sizes attribute must not be specified on link elements
+ that do not have a rel attribute that specifies the icon keyword.</assert>
</rule>
- </pattern>
-
+ </pattern>
+
<pattern id="meta-charset">
<rule context="h:meta[@charset]">
- <assert test="count(preceding-sibling::h:meta[@charset]) = 0"
- >There must not be more than one meta element with a charset attribute per document.</assert>
+ <assert test="count(preceding-sibling::h:meta[@charset]) = 0">There must not be more
+ than one meta element with a charset attribute per document.</assert>
</rule>
</pattern>
-
+
<pattern id="article-pubdate">
<rule context="h:article[h:time]">
- <assert test="count(./h:time[@pubdate]) < 2"
- >For each article element, there must be no more than one time element child with a pubdate attribute</assert>
+ <assert test="count(./h:time[@pubdate]) < 2">For each article element, there must be
+ no more than one time element child with a pubdate attribute</assert>
</rule>
</pattern>
-
+
<pattern id="document-pubdate">
<rule context="h:time[not (ancestor::h:article)]">
- <assert test="count(//h:time[@pubdate and not (ancestor::h:article)]) < 2"
- >For each Document, there must be no more than one time element with a pubdate
- attribute that does not have an ancestor article element.</assert>
+ <assert test="count(//h:time[@pubdate and not (ancestor::h:article)]) < 2">For each
+ Document, there must be no more than one time element with a pubdate attribute that
+ does not have an ancestor article element.</assert>
</rule>
</pattern>
- <pattern id="md-a-area">
+ <pattern id="md-a-area">
<rule context="h:a[@itemprop] | h:area[@itemprop]">
- <assert test="@href"
- >If the itemprop is specified on an a element, then the href attribute must also be specified.</assert>
+ <assert test="@href">If the itemprop is specified on an a element, then the href
+ attribute must also be specified.</assert>
</rule>
</pattern>
- <pattern id="md-iframe-embed-object">
+ <pattern id="md-iframe-embed-object">
<rule context="h:iframe[@itemprop] | h:embed[@itemprop] | h:object[@itemprop]">
- <assert test="@data"
- >If the itemprop is specified on an iframe, embed or object element, then the data attribute must also be specified.</assert>
+ <assert test="@data">If the itemprop is specified on an iframe, embed or object element,
+ then the data attribute must also be specified.</assert>
</rule>
</pattern>
-
+
<pattern id="md-media">
<rule context="h:audio[@itemprop] | h:video[@itemprop]">
- <assert test="@src"
- >If the itemprop is specified on an video or audio element, then the src attribute must also be specified.</assert>
+ <assert test="@src">If the itemprop is specified on an video or audio element, then the
+ src attribute must also be specified.</assert>
</rule>
</pattern>
<pattern abstract="true" id="idref-any">
<rule context="$element[@$idref-attr-name]">
<assert test="some $elem in $id-set satisfies $elem/@id eq current()/@$idref-attr-name"
- >The <name path="@$idref-attr-name"/> attribute must refer to an element in the same document (the ID '<value-of
- select="current()/@$idref-attr-name"/>' does not exist).</assert>
+ >The <name path="@$idref-attr-name"/> attribute must refer to an element in the same
+ document (the ID '<value-of select="current()/@$idref-attr-name"/>' does not
+ exist).</assert>
</rule>
</pattern>
<pattern abstract="true" id="idrefs-any">
- <rule context="$element[@$idrefs-attr-name]">
- <assert test="every $idref in tokenize(@$idrefs-attr-name,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))"
- >The <name path="@$idrefs-attr-name"/> attribute must refer to elements in the same document (target ID missing)</assert>
+ <rule context="$element[@$idrefs-attr-name]">
+ <assert
+ test="every $idref in tokenize(@$idrefs-attr-name,'\s+') satisfies (some $elem in $id-set satisfies ($elem/@id eq $idref))"
+ >The <name path="@$idrefs-attr-name"/> attribute must refer to elements in the same
+ document (target ID missing)</assert>
</rule>
</pattern>
<pattern abstract="true" id="idref-named">
- <rule context="$element[@$idref-attr-name]">
+ <rule context="$element[@$idref-attr-name]">
<assert test="//$target-name[@id = current()/@$idref-attr-name]">The <name
- path="@$idref-attr-name"/> attribute does not refer to an allowed target element (expecting: <value-of
- select="replace('$target-name','h:','')"/>).</assert>
+ path="@$idref-attr-name"/> attribute does not refer to an allowed target element
+ (expecting: <value-of select="replace('$target-name','h:','')"/>).</assert>
</rule>
</pattern>
<pattern abstract="true" id="required-attr">
<rule context="$elem">
- <assert test="@$attr"
- >The <name/> element must have a <value-of select="'$attr'"/> attribute.</assert>
+ <assert test="@$attr">The <name/> element must have a <value-of select="'$attr'"/>
+ attribute.</assert>
</rule>
</pattern>
<pattern abstract="true" id="disallowed-descendants">
<rule context="$descendant">
- <report test="ancestor::$ancestor"
- >The <name/> element must not appear inside <value-of select="local-name(ancestor::$ancestor)"/> elements.</report>
+ <report test="ancestor::$ancestor">The <name/> element must not appear inside <value-of
+ select="local-name(ancestor::$ancestor)"/> elements.</report>
</rule>
</pattern>
-
+
<pattern abstract="true" id="required-ancestor">
- <rule context='$descendant'>
- <assert test='ancestor::$ancestor'
- >The <value-of select="replace('$descendant','h:','')"/> element must have an ancestor <value-of select="replace('$ancestor','h:','')"/> element.</assert>
+ <rule context="$descendant">
+ <assert test="ancestor::$ancestor">The <value-of select="replace('$descendant','h:','')"
+ /> element must have an ancestor <value-of select="replace('$ancestor','h:','')"/>
+ element.</assert>
</rule>
</pattern>
-
+
<pattern abstract="true" id="no-interactive-content-descendants">
- <rule context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')]
+ <rule
+ context="h:a|h:audio[@controls]|h:button|h:details|h:embed|h:iframe|h:img[@usemap]|h:input[not(@type='hidden')]
|h:keygen|h:label|h:menu[@type='toolbar']|h:object[@usemap]|h:select|h:textarea|h:video[@controls]">
- <report test="ancestor::$ancestor"
- >The <name/> element must not appear inside <value-of select="local-name(ancestor::$ancestor)"/> elements.</report>
+ <report test="ancestor::$ancestor">The <name/> element must not appear inside <value-of
+ select="local-name(ancestor::$ancestor)"/> elements.</report>
</rule>
</pattern>
-
+
<include href="./mod/epub-svg11-re.sch"/>
-
+
</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-collection.sch b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-collection.sch
new file mode 100644
index 0000000..d914a31
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-collection.sch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="idx.collection">
+ <rule context="opf:collection[tokenize(@role,'\s+')='index']">
+ <report test="exists(opf:collection[not(tokenize(@role,'\s+')='index-group')])">An
+ 'index' collection must not have sub-collections other than 'index-group'
+ collections.</report>
+ </rule>
+ <rule context="opf:collection[tokenize(@role,'\s+')='index-group']">
+ <assert test="parent::opf:collection[tokenize(@role,'\s+')='index']">An 'index-group'
+ collection must be a child of an 'index' collection.</assert>
+ <assert test="empty(opf:collection)">An 'index-group' collection must not have child
+ collections.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml-index.sch b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml-index.sch
new file mode 100644
index 0000000..292e608
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml-index.sch
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding="xslt2">
+
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+
+ <!--EPUB Indexes constraint checks, must be applied only to Indexes XHTML -->
+
+ <pattern id="index-ocurrence">
+ <rule context="h:html">
+ <assert test="exists(.//*[tokenize(@epub:type,'\s+')='index'])">At least one 'index'
+ element must be present in a document declared as an index in the OPF.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-only">
+ <rule
+ context="h:html/h:body[empty(.//h:*[normalize-space(text())
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index'])])]">
+ <assert test="tokenize(@epub:type,'/s+')='index'">The document containins only index
+ content, its 'body' element must have the epub:type 'index'</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml.sch b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml.sch
new file mode 100644
index 0000000..651ae89
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml.sch
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding="xslt2">
+
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="h"/>
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+
+ <!--EPUB Indexes constraint checks, can be applied to any XHTML -->
+
+ <pattern id="index">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index']">
+ <let name="semchilds"
+ value="descendant::h:*[ancestor::h:*[@epub:type or self::h:ul][1] is current()]"/>
+ <assert test="self::h:body|self::h:section|self::h:article|self::h:aside|self::h:nav">The
+ 'index' type is only allowed on 'body' or sectioning elements.</assert>
+ <assert
+ test="count($semchilds[self::h:h1|self::h:h2|self::h:h3|self::h:h4|self::h:h5|self::h:h6]) le 1"
+ >At most one heading element child must be present.</assert>
+ <assert test="count($semchilds[tokenize(@epub:type,'\s+')='index-headnotes']) le 1">At most
+ one 'index-headnotes' child must be present.</assert>
+ <assert
+ test="if ($semchilds[tokenize(@epub:type,'\s+')='index-group'])
+ then empty($semchilds[self::h:ul or tokenize(@epub:type,'\s+')='index-entry-list'])
+ else count($semchilds[self::h:ul or tokenize(@epub:type,'\s+')='index-entry-list'])=1"
+ >An 'index' must contain one and only one 'index-entry-list' (possibly implied) OR one or
+ more 'index-group's.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-headnotes">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-headnotes']">
+ <assert test="self::h:header|self::h:section|self::h:article|self::h:aside|self::h:nav">The
+ 'index-headnotes' type is only allowed on 'header' or sectioning elements.</assert>
+ <assert test="ancestor::h:*[@epub:type][1][tokenize(@epub:type,'\s+')='index']">The
+ 'index-headnotes' type is only allowed as a child of 'index'.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-legend">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-legend']">
+ <assert test="self::h:dl|self::h:section|self::h:article|self::h:aside|self::h:nav">The
+ 'index-legend' type is only allowed on 'dl' or sectioning elements.</assert>
+ <assert test="ancestor::h:*[@epub:type][1][tokenize(@epub:type,'\s+')='index-headnotes']">The
+ 'index-legend' type is only allowed as a child of 'index-headnotes'.</assert>
+ <!--Note: index-legend should be or contain a 'dl', however this is not a requirement-->
+ </rule>
+ </pattern>
+
+ <pattern id="index-group">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-group']">
+ <assert test="self::h:section|self::h:article|self::h:aside|self::h:nav">The 'index-group'
+ type is only allowed on sectioning elements.</assert>
+ <assert test="ancestor::h:*[@epub:type][1][tokenize(@epub:type,'\s+')='index']">The
+ 'index-group' type is only allowed on children of 'index'.</assert>
+ <assert
+ test="count(descendant::h:*
+ [ancestor::h:*[self::h:ul or @epub:type][1] is current()]
+ [self::h:h1|self::h:h2|self::h:h3|self::h:h4|self::h:h5|self::h:h6]
+ ) le 1"
+ >'index-group' must not have more than one heading child.</assert>
+ <assert
+ test="count(descendant::h:ul
+ [ancestor::h:*[self::h:ul or @epub:type][1] is current()]
+ [not(@epub-type) or tokenize(@epub:type,'\s+')='index-entry-list']
+ ) = 1"
+ >'index-group' must have exactly one 'index-entry-list' child.</assert>
+ </rule>
+ </pattern>
+
+
+ <pattern id="index-entry-list">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='index-entry-list']
+ |h:ul[not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes'])]">
+ <assert test="self::h:ul">The 'index-entry-list' type is only allowed on 'ul'
+ elements.</assert>
+ <assert
+ test="ancestor::h:*[@epub:type][1][tokenize(@epub:type,'\s+')=('index','index-group','index-entry')]
+ |ancestor::h:*[self::h:li][self::h:li]
+ [parent::h:ul
+ [tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]"
+ >The 'index-entry-list' type is only allowed on children of 'index', 'index-group' or
+ 'index-entry'.</assert>
+ <assert test="exists(h:li)">At least one 'index-entry' child.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-entry">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='index-entry']
+ |h:li[parent::h:ul
+ [tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]">
+ <let name="semchilds"
+ value="descendant::h:*[ancestor::h:*[@epub:type or self::h:li][1] is current()]"/>
+ <assert test="self::h:li">The 'index-entry' type is only allowed on 'li' elements.</assert>
+ <assert
+ test="parent::h:ul[tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]"
+ >The 'index-entry' type is only allowed on children of (possibly-implied)
+ 'index-entry-list'.</assert>
+ <assert
+ test="count($semchilds
+ [tokenize(@epub:type,'\s+')='index-term'
+ and not(tokenize(@epub:type,'\s+')=('index-xref-related','index-xref-preferred'))])
+ =1"
+ >An 'index-entry' must have one and only one 'index-term' child.</assert>
+ <assert
+ test="exists($semchilds
+ [self::h:ul[not(@epub:type)]
+ or tokenize(@epub:type,'\s+')=('index-entry-list','index-editor-note','index-locator-list',
+ 'index-locator','index-locator-range','index-xref-preferred','index-xref-related')])"
+ >An 'index-entry' must have at least one child with the type 'index-entry-list' or
+ 'index-locator-list' or 'index-locator', 'index-locator-range' or 'index-editor-note' or
+ 'index-xref-preferred' or 'index-xref-related'.</assert>
+ <assert
+ test="count($semchilds
+ [self::h:ul[not(@epub:type)] or
+ tokenize(@epub:type,'\s+')=('index-entry-list')])
+ le 1"
+ >An 'index-entry' must have at most one child with the (possibly implied) type
+ 'index-entry-list'.</assert>
+ <assert
+ test="if ($semchilds[tokenize(@epub:type,'\s+')='index-locator-list'])
+ then empty($semchilds[tokenize(@epub:type,'\s+')=('index-locator','index-locator-range')])
+ else true()"
+ >An 'index-entry' must not have both 'index-locator-list' and 'index-locator' or
+ 'index-locator-range' children.</assert>
+ <assert
+ test="count($semchilds
+ [tokenize(@epub:type,'\s+')='index-locator-list'])
+ le 1"
+ >An 'index-entry' must have at most one child with the type 'index-locator-list'.</assert>
+ <assert
+ test="count($semchilds
+ [tokenize(@epub:type,'\s+')='index-editor-note'])
+ le 1"
+ >An 'index-entry' must have at most one child with the type 'index-editor-note'.</assert>
+ <assert
+ test="if ($semchilds
+ [tokenize(@epub:type,'\s+')='index-xref-preferred'])
+ then empty($semchilds[tokenize(@epub:type,'\s+')='index-xref-related'])
+ else true()"
+ >An 'index-entry' must not have both 'index-xref-preferred' and 'index-xref-related'
+ children.</assert>
+ </rule>
+ </pattern>
+
+ <pattern abstract="true" id="index-entry-child">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='$type']">
+ <assert
+ test="ancestor::h:*[self::h:li or @epub:type][1]
+ [tokenize(@epub:type,'\s+')='index-entry'
+ or self::h:li and parent::h:ul[
+ tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]"
+ >The '<xsl:value-of select="'$type'"/>' type is only allowed on children of elements with
+ the (possibly implied) type 'index-entry'.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-term">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-term']">
+ <assert
+ test="self::h:a|self::h:abbr|self::h:area|self::h:audio|self::h:b|self::h:bdi|self::h:bdo|self::h:br
+ |self::h:button|self::h:canvas|self::h:cite|self::h:code|self::h:data|self::h:datalist|self::h:del
+ |self::h:dfn|self::h:em|self::h:embed|self::h:i|self::h:iframe|self::h:img|self::h:input|self::h:ins
+ |self::h:kbd|self::h:keygen|self::h:label|self::h:map|self::h:mark|self::h:math|self::h:meter
+ |self::h:noscript|self::h:object|self::h:output|self::h:progress|self::h:q|self::h:ruby|self::h:s
+ |self::h:samp|self::h:script|self::h:select|self::h:small|self::h:span|self::h:strong|self::h:sub
+ |self::h:sup|self::h:svg|self::h:textarea|self::h:time|self::h:u|self::h:var|self::h:video"
+ >The 'index-term' type is only allowed on phrasing content elements.</assert>
+ <assert
+ test="parent::h:*[tokenize(@epub:type,'\s+')=('index-entry','index-xref-related','index-xref-preferred')]
+ |ancestor::h:*[self::h:li or @epub:type][1][self::h:li]
+ [parent::h:ul[tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]"
+ >The 'index-term' type is only allowed on children of elements with the type 'index-entry'
+ (possibly implied), 'index-xref-preferred' or 'index-xref-related'.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-editor-note" is-a="index-entry-child">
+ <param name="type" value="index-editor-note"/>
+ </pattern>
+
+
+ <pattern id="index-locator-list">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-locator-list']">
+ <assert test="self::h:ul">The 'index-locator-list' type is only allowed on 'ul'
+ elements.</assert>
+ <assert
+ test="exists(descendant::h:*[tokenize(@epub:type,'\s+')='index-locator']|descendant::h:a[not(@epub:type)])"
+ >An 'index-entry-list' must have at least one descendant with the (possibly implied)
+ 'index-locator' type.</assert>
+ </rule>
+ </pattern>
+ <pattern id="index-locator-list-2" is-a="index-entry-child">
+ <param name="type" value="index-locator-list"/>
+ </pattern>
+
+ <pattern id="index-locator">
+ <rule
+ context="h:*[tokenize(@epub:type,'\s+')='index-locator']
+ |h:a[ancestor::h:*[tokenize(@epub:type,'\s+')=('index-locator-list','index-locator-range')]]">
+ <assert test="self::h:a">The 'index-locator' type is only allowed on 'a' elements.</assert>
+ <assert
+ test="ancestor::h:*[tokenize(@epub:type,'\s+')=('index-locator-list','index-locator-range')]
+ | ancestor::h:*[self::h:li or @epub:type][1][self::h:li]
+ [parent::h:ul[tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]"
+ >The 'index-locator' type is only allowed on children of elements with the (possibly
+ implied) type 'index-entry' or descendants of 'index-locator-list' or 'index-range'.
+ </assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-locator-range">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-locator-range']">
+ <assert
+ test="ancestor::h:*[tokenize(@epub:type,'\s+')=('index-locator-list')]
+ | ancestor::h:*[self::h:li or @epub:type][1][self::h:li]
+ [parent::h:ul[tokenize(@epub:type,'\s+')='index-entry-list'
+ or (not(@epub:type)
+ and ancestor::h:*[tokenize(@epub:type,'\s+')='index']
+ and empty(ancestor::h:*[tokenize(@epub:type,'\s+')='index-headnotes']))]]"
+ >The 'index-locator-range' type is only allowed on children of elements with the (possibly
+ implied) type 'index-entry' or descendants of 'index-locator-list'.</assert>
+ <assert test="exists(descendant::h:a) and count(descendant::h:a) le 2">Must contain one or two
+ 'index-locator' child.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="index-xref">
+ <rule context="h:*[tokenize(@epub:type,'\s+')=('index-xref-preferred','index-xref-related')]">
+ <assert
+ test="exists(descendant-or-self::h:*[tokenize(@epub:type,'\s+')=('index-term','index-term-category')])"
+ >An 'index-xref-preferred' or 'index-xref-related' must have at least one child with the
+ type 'index-term' or 'index-term-category'.</assert>
+ </rule>
+ </pattern>
+ <pattern id="index-xref-related" is-a="index-entry-child">
+ <param name="type" value="index-xref-related"/>
+ </pattern>
+ <pattern id="index-xref-preferred" is-a="index-entry-child">
+ <param name="type" value="index-xref-preferred"/>
+ </pattern>
+
+ <pattern id="index-term-category">
+ <rule context="h:*[tokenize(@epub:type,'\s+')='index-term-category']">
+ <assert test="self::h:a">The 'index-term-category' type is only allowed on 'a'
+ elements.</assert>
+ <assert
+ test="ancestor-or-self::h:*[tokenize(@epub:type,'\s+')=('index-xref-related','index-xref-preferred')]"
+ >The 'index-term-category' type is only allowed on elements (or descendants of elements)
+ with the type 'index-xref-preferred' or 'index-xref-related'.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/media-overlay-30-PREP.sch b/src/main/resources/com/adobe/epubcheck/schema/30/media-overlay-30-PREP.sch
deleted file mode 100644
index 9b12873..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/media-overlay-30-PREP.sch
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron">
-
- <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
- <ns uri="http://www.w3.org/ns/SMIL" prefix="s"/>
-
- <pattern id="id-unique">
- <!-- note: assumes that NCName lexical constraints are tested elsewhere -->
- <let name="id-set" value="//*[@id]"/>
- <rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of select="current()/@id"/>'</assert>
- </rule>
-</pattern>
-
-</schema>
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc
index 151992a..f90a81c 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc
@@ -113,7 +113,7 @@ div {
datatype.html5.datetime.global = xsd:token { pattern = '([0-9]{4,})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(:[0-9]{2}(\.[0-9]+)?)?(Z|((\+|-)([0-9]{2}):([0-9]{2})))' }
datatype.html5.datetime = datatype.html5.datetime.global
# http://www.w3.org/TR/html5/common-microsyntaxes.html#vaguer-moments-in-time
- datatype.html5.date.or.time = datatype.html5.date | datatype.html5.time | datatype.html5.datetime.global
+ datatype.html5.date.or.time = datatype.html5.date | datatype.html5.month | datatype.html5.time | datatype.html5.datetime.global
# http://www.w3.org/TR/html5/common-microsyntaxes.html#vaguer-moments-in-time
datatype.html5.date.optional.time = datatype.html5.date | datatype.html5.datetime.global
datatype.html5.week = xsd:token { pattern ='([0-9]{4,})-W([0-9]{2})' }
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc
index ce3cfd8..e18a99a 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc
@@ -12,7 +12,7 @@
html5.lang.attr = attribute lang { datatype.languagecode }
html5.xml.lang.attr = attribute xml:lang { datatype.languagecode }
html5.dir.attr = attribute dir { 'ltr' | 'rtl' | 'auto' }
- html5.id.attr = attribute id { datatype.ID }
+ html5.id.attr = attribute id { datatype.html5.token }
html5.title.attr = attribute title { string }
html5.class.attr = attribute class { datatype.html5.space.separated.tokens }
html5.xml.base.attr = attribute xml:base { datatype.LEIRI }
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-document-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-document-30.rnc
index 5644eba..c7faf31 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-document-30.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-document-30.rnc
@@ -34,7 +34,7 @@
| html5.charset.attr
html5.meta.name.attr = attribute name { datatype.string }
html5.meta.http-equiv.attr = attribute http-equiv { html5.meta.http-equiv.attr.content }
- html5.meta.http-equiv.attr.content = xsd:string { pattern = "([Dd][Ee][Ff][Aa][Uu][Ll][Tt]\-[Ss][Tt][Yy][Ll][Ee])|([Rr][Ee][Ff][Rr][Ee][Ss][Hh])" }
+ html5.meta.http-equiv.attr.content = xsd:string { pattern = "([Dd][Ee][Ff][Aa][Uu][Ll][Tt]\-[Ss][Tt][Yy][Ll][Ee])|([Rr][Ee][Ff][Rr][Ee][Ss][Hh])|([Cc][Oo][Nn][Tt][Ee][Nn][Tt]\-[Tt][Yy][Pp][Ee])" }
html5.meta.content.attr = attribute content { datatype.string }
html5.title = element title { html5.title.attlist & html5.title.content }
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc
index 7e193b7..53d793c 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc
@@ -69,9 +69,10 @@
html5.object.flow = element object { html5.object.flow.content & html5.object.attlist }
html5.object.phrasing = element object { html5.object.phrasing.content & html5.object.attlist }
- html5.object.attlist &= html5.global.attrs & (( html5.object.data.attr & html5.type.mime.attr? ) | html5.type.mime.attr )
+ html5.object.attlist &= html5.global.attrs & (( html5.object.data.attr & html5.type.mime.attr? & html5.object.typemustmatch.attr?) | html5.type.mime.attr )
& html5.dimension.attrs & html5.usemap.attr? & html5.name.context.attr? & html5.forms.form.attr?
html5.object.data.attr = attribute data { datatype.html5.URL.spaces }
+ html5.object.typemustmatch.attr = attribute typemustmatch { 'typemustmatch' | '' }
html5.object.flow.content = html5.param*, html5.flow.model
html5.object.phrasing.content = html5.param*, html5.phrasing.model
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-sections-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-sections-30.rnc
index 1605182..5bc05a8 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-sections-30.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-sections-30.rnc
@@ -2,7 +2,7 @@
html5.flow.class |= html5.sections.class | html5.headings.class
- html5.sections.class |= html5.section | html5.article | html5.nav | html5.aside | html5.header | html5.footer | html5.address
+ html5.sections.class |= html5.section | html5.article | html5.nav | html5.aside | html5.header | html5.footer | html5.address | html5.main
html5.headings.class |= html5.hgroup | html5.h1 | html5.h2 | html5.h3 | html5.h4 | html5.h5 | html5.h6
html5.headings.attrs &= html5.global.attrs
@@ -55,4 +55,8 @@
html5.address = element address { html5.address.attlist & html5.address.content }
html5.address.attlist &= html5.sections.attrs
- html5.address.content = html5.flow.model
\ No newline at end of file
+ html5.address.content = html5.flow.model
+
+ html5.main = element main { html5.main.attlist & html5.main.content }
+ html5.main.attlist &= html5.sections.attrs
+ html5.main.content = html5.flow.model
\ No newline at end of file
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/id-unique.sch b/src/main/resources/com/adobe/epubcheck/schema/30/mod/id-unique.sch
index b7a0c55..1ca1305 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/id-unique.sch
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/id-unique.sch
@@ -3,8 +3,7 @@
<!-- note: assumes that NCName lexical constraints are tested elsewhere -->
<let name="id-set" value="//*[@id]"/>
<rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1"
- >Duplicate ID '<value-of select="current()/@id"/>'</assert>
+ <assert test="count($id-set[normalize-space(@id) = normalize-space(current()/@id)]) = 1"
+ >Duplicate '<value-of select="normalize-space(current()/@id)"/>'</assert>
</rule>
</pattern>
-
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-common.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-common.rnc
index 3d18ae1..719f190 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-common.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-common.rnc
@@ -2,7 +2,7 @@
# application for describing mathematical notation and capturing
# both its structure and content.
#
-# Copyright 1998-2009 W3C (MIT, ERCIM, Keio)
+# Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
#
# Use and distribution of this code are permitted under the terms
# W3C Software Notice and License
@@ -79,6 +79,6 @@ semantics.attributes = CommonAtt,DefEncAtt,cd?,name?
length = xsd:string {
- pattern = '\s*((-?[0-9]*(\.[0-9]*)?(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*'
+ pattern = '\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*'
}
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-content.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-content.rnc
index 3facbfd..9603ed4 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-content.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-content.rnc
@@ -3,7 +3,7 @@
# application for describing mathematical notation and capturing
# both its structure and content.
#
-# Copyright 1998-2010 W3C (MIT, ERCIM, Keio)
+# Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
#
# Use and distribution of this code are permitted under the terms
# W3C Software Notice and License
@@ -20,7 +20,7 @@ include "mathml3-strict-content.rnc"{
csymbol.attributes = CommonAtt, DefEncAtt, attribute type {text}?,cd?
csymbol.content = (text | mglyph | PresentationExpression)*
- bvar = element bvar { (ci | semantics-ci) & degree?}
+ bvar = element bvar {CommonAtt, ((ci | semantics-ci) & degree?)}
cbytes.attributes = CommonAtt, DefEncAtt
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-presentation.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-presentation.rnc
index 5fa56e7..7606d90 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-presentation.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-presentation.rnc
@@ -3,7 +3,7 @@
# application for describing mathematical notation and capturing
# both its structure and content.
#
-# Copyright 1998-2010 W3C (MIT, ERCIM, Keio)
+# Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
#
# Use and distribution of this code are permitted under the terms
# W3C Software Notice and License
@@ -26,7 +26,7 @@ MsrowExpression = MathExpression|none
MultiScriptExpression = (MathExpression|none),(MathExpression|none)
mpadded-length = xsd:string {
- pattern = '\s*([\+\-]?[0-9]*(\.[0-9]*)?\s*((%?\s*(height|depth|width)?)|e[mx]|in|cm|mm|p[xtc]|((negative)?((very){0,2}thi(n|ck)|medium)mathspace)))\s*' }
+ pattern = '\s*([\+\-]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*\s*((%?\s*(height|depth|width)?)|e[mx]|in|cm|mm|p[xtc]|((negative)?((very){0,2}thi(n|ck)|medium)mathspace))?)\s*' }
linestyle = "none" | "solid" | "dashed"
@@ -138,7 +138,14 @@ mspace.attributes =
attribute width {length}?,
attribute height {length}?,
attribute depth {length}?,
- attribute linebreak {"auto" | "newline" | "nobreak" | "goodbreak" | "badbreak" | "indentingnewline"}?
+ attribute linebreak {"auto" | "newline" | "nobreak" | "goodbreak" | "badbreak" | "indentingnewline"}?,
+ attribute indentalign {"left" | "center" | "right" | "auto" | "id"}?,
+ attribute indentshift {length}?,
+ attribute indenttarget {idref}?,
+ attribute indentalignfirst {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+ attribute indentshiftfirst {length | "indentshift"}?,
+ attribute indentalignlast {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+ attribute indentshiftlast {length | "indentshift"}?
ms = element ms {ms.attributes, token.content*}
@@ -441,7 +448,7 @@ mtable = element mtable {mtable.attributes, TableRowExpression*}
mtable.attributes =
CommonAtt, CommonPresAtt,
attribute align {xsd:string {
- pattern ='\s*(top|bottom|center|baseline|axis)\s*[0-9]*'}}?,
+ pattern ='\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*'}}?,
attribute rowalign {list {verticalalign+} }?,
attribute columnalign {list {columnalignstyle+} }?,
attribute groupalign {group-alignment-list-list}?,
@@ -488,7 +495,7 @@ mstack = element mstack {mstack.attributes, MstackExpression*}
mstack.attributes =
CommonAtt, CommonPresAtt,
attribute align {xsd:string {
- pattern ='\s*(top|bottom|center|baseline|axis)\s*[0-9]*'}}?,
+ pattern ='\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*'}}?,
attribute stackalign {"left" | "center" | "right" | "decimalpoint"}?,
attribute charalign {"left" | "center" | "right"}?,
attribute charspacing {length | "loose" | "medium" | "tight"}?
@@ -532,5 +539,5 @@ mscarry.attributes =
maction = element maction {maction.attributes, MathExpression+}
maction.attributes =
CommonAtt, CommonPresAtt,
- attribute actiontype {text}?,
+ attribute actiontype {text},
attribute selection {positive-integer}?
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-strict-content.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-strict-content.rnc
index e854b1c..b88e498 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-strict-content.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/mod/mathml/mathml3-strict-content.rnc
@@ -2,7 +2,7 @@
# application for describing mathematical notation and capturing
# both its structure and content.
#
-# Copyright 1998-2009 W3C (MIT, ERCIM, Keio)
+# Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
#
# Use and distribution of this code are permitted under the terms
# W3C Software Notice and License
@@ -15,7 +15,7 @@ ContExp = semantics-contexp | cn | ci | csymbol | apply | bind | share | cerror
cn = element cn {cn.attributes,cn.content}
cn.content = text
-cn.attributes = attribute type {"integer" | "real" | "double" | "hexdouble"}
+cn.attributes = CommonAtt, attribute type {"integer" | "real" | "double" | "hexdouble"}
semantics-ci = element semantics {semantics.attributes,(ci|semantics-ci),
(annotation|annotation-xml)*}
@@ -36,7 +36,7 @@ csymbol.attributes = CommonAtt, cd
csymbol.content = SymbolName
BvarQ = bvar*
-bvar = element bvar { ci | semantics-ci}
+bvar = element bvar {CommonAtt, (ci | semantics-ci)}
apply = element apply {CommonAtt,apply.content}
apply.content = ContExp+
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.rnc
new file mode 100644
index 0000000..1cee0b0
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.rnc
@@ -0,0 +1,14 @@
+namespace rendition = "http://www.idpf.org/2013/rendition"
+
+ocf.rootfile.attlist &=
+ mr.rendition.attr? &
+ mr.layout.attr? &
+ mr.language.attr? &
+ mr.accessMode.attr? &
+ mr.label.attr?
+
+mr.rendition.attr = attribute rendition:media { xsd:string { pattern='\s*(((only|not)\s+)?all|\([^>)]+\))(\s+and\s+\([^>)]+\))*\s*(,\s*(((only|not)\s+)?all|\([^>)]+\))(\s+and\s+\([^>)]+\))*\s*)*' } }
+mr.layout.attr = attribute rendition:layout { "reflowable" | "pre-paginated" }
+mr.language.attr = attribute rendition:language { datatype.languagecode }
+mr.accessMode.attr = attribute rendition:accessMode { list { ("auditory" | "tactile" | "textual" | "visual")+ } }
+mr.label.attr = attribute rendition:label { text }
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.sch b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.sch
new file mode 100644
index 0000000..35df74a
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/container.sch
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+
+ <ns uri="urn:oasis:names:tc:opendocument:xmlns:container" prefix="ocf"/>
+ <ns uri="http://www.idpf.org/2013/rendition" prefix="rendition"/>
+
+ <pattern id="selection.accessModes">
+ <rule context="ocf:rootfile[@rendition:accessMode]">
+ <report
+ test="some $mode in tokenize(@rendition:accessMode,'\s+') satisfies (count(tokenize(@rendition:accessMode, $mode))=3)"
+ >The accessMode attribute contains a duplicate value.</report>
+ </rule>
+ </pattern>
+
+ <pattern id="selection.mandatingOneSelectionAttribute">
+ <rule context="ocf:rootfile[position() > 1]">
+ <assert test="count(@rendition:*) > 0">WARNING: At least one rendition selection
+ attribute should be specified for each non-first rootfile element, which represents
+ a non-default rendition."</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="mapping.atMostOne">
+ <rule context="ocf:links">
+ <report test="count(ocf:link[normalize-space(@rel)='mapping'])>1">The Container Document
+ must not reference more than one mapping document.</report>
+ </rule>
+ </pattern>
+ <pattern id="mapping.mediaType">
+ <rule context="ocf:link[normalize-space(@rel) = 'mapping']">
+ <assert test="normalize-space(@media-type) = 'application/xhtml+xml'">The media type of
+ Rendition Mapping Documents must be "application/xhtml+xml".</assert>
+ </rule>
+ </pattern>
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.rnc
new file mode 100644
index 0000000..c406a2e
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.rnc
@@ -0,0 +1,32 @@
+default namespace = "http://www.w3.org/1999/xhtml"
+namespace epub = "http://www.idpf.org/2007/ops"
+
+include "../mod/datatypes.rnc"
+start = html
+html =
+ element html {
+ attribute epub:prefix { datatype.prefixdecl }?,
+ head,
+ body
+ }
+head = element head { meta* }
+body = element body { nav+ }
+meta =
+ element meta {
+ (attribute name { xsd:string }
+ & attribute content { xsd:string })
+ | attribute charset { xsd:NMTOKEN }
+ }
+nav =
+ element nav {
+ # presence of epub:type is checked with Schematron for better error message
+ (attribute epub:type { xsd:NMTOKENS })?
+ & ul+
+ }
+ul = element ul { li, li+ }
+li = element li { a }
+a =
+ element a {
+ attribute href { xsd:anyURI }
+ & attribute epub:rendition { xsd:anyURI }?
+ }
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.sch b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.sch
new file mode 100644
index 0000000..56ef99d
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/multiple-renditions/mapping.sch
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.w3.org/1999/xhtml" prefix="html"/>
+ <ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
+ <pattern id="mapping.doc.version">
+ <rule context="html:head">
+ <assert
+ test="html:meta[@name = 'epub.multiple.renditions.version' and @content = '1.0']">A
+ meta tag with the name 'epub.multiple.renditions.version' and value '1.0' is
+ required.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="resourcemap.nav">
+ <rule context="html:body">
+ <assert test="count(html:nav[tokenize(@epub:type, '\s+') = 'resource-map']) = 1">A
+ Rendition Mapping Document must contain exactly one 'resource-map' nav
+ element.</assert>
+ <report test="html:nav[normalize-space(@epub:type) = '']">A nav element of a Rendition
+ Mapping Document must identify its nature in an epub:type attribute.</report>
+ </rule>
+ </pattern>
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.nvdl b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.nvdl
new file mode 100644
index 0000000..ecdf1d0
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.nvdl
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" startMode="package">
+ <mode name="package">
+ <namespace ns="urn:oasis:names:tc:opendocument:xmlns:container">
+ <validate schema="ocf-container-30.rnc" schemaType="application/relax-ng-compact-syntax"/>
+ <validate schema="multiple-renditions/container.sch"/>
+ </namespace>
+ </mode>
+ <mode name="attach">
+ <anyNamespace>
+ <attach/>
+ </anyNamespace>
+ </mode>
+</rules>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.rnc
index 8e0bee0..b5f34fb 100644
--- a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.rnc
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-container-30.rnc
@@ -1,16 +1,37 @@
-
default namespace = "urn:oasis:names:tc:opendocument:xmlns:container"
include "./mod/datatypes.rnc"
+ include "./multiple-renditions/container.rnc"
- start = ocf.container
+ start = ocf.container
- ocf.container = element container {
- attribute version { '1.0' } &
- element rootfiles {
- element rootfile {
- attribute full-path { datatype.URI } &
- attribute media-type { 'application/oebps-package+xml' }
- }+
- }
- }
+ ocf.container =
+ element container { ocf.container.attlist & ocf.container.content }
+ ocf.container.attlist =
+ attribute version { '1.0' }
+ ocf.container.content = ocf.rootfiles, ocf.links?
+
+ ocf.rootfiles =
+ element rootfiles { ocf.rootfiles.attlist & ocf.rootfiles.content }
+ ocf.rootfiles.attlist = empty
+ ocf.rootfiles.content = ocf.rootfile+
+
+ ocf.rootfile =
+ element rootfile {ocf.rootfile.attlist & ocf.rootfile.content }
+ ocf.rootfile.attlist =
+ attribute full-path { datatype.URI } &
+ attribute media-type { 'application/oebps-package+xml' }
+ ocf.rootfile.content = empty
+
+ ocf.links =
+ element links { ocf.links.attlist & ocf.links.content }
+ ocf.links.attlist = empty
+ ocf.links.content = ocf.link+
+ ocf.link =
+ element link { ocf.link.attlist & ocf.link.content }
+ ocf.link.attlist =
+ attribute href { datatype.URI } &
+ attribute rel { datatype.space.separated.tokens } &
+ attribute media-type { datatype.mimetype }?
+ ocf.link.content = empty
+
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.nvdl b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.nvdl
new file mode 100644
index 0000000..1ffd80a
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.nvdl
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rules xmlns="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0" startMode="package">
+ <mode name="package">
+ <namespace ns="http://www.idpf.org/2013/metadata">
+ <validate schema="ocf-metadata-30.rnc" schemaType="application/relax-ng-compact-syntax"/>
+ <validate schema="ocf-metadata-30.sch"/>
+ </namespace>
+ </mode>
+ <mode name="attach">
+ <anyNamespace>
+ <attach/>
+ </anyNamespace>
+ </mode>
+</rules>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.rnc b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.rnc
new file mode 100644
index 0000000..53b0e0b
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.rnc
@@ -0,0 +1,32 @@
+default namespace = "http://www.idpf.org/2013/metadata"
+
+include "./package-30.rnc" {
+ start = element metadata {mr.metadata.attlist & mr.metadata.content }
+ opf.meta = element meta {
+ opf.epub3.meta.content #Obsolete OPF2 meta content disallowed
+ }
+
+ opf.link = element link { opf.href.attr & opf.rel.attr & opf.id.attr? & opf.refines.attr? & opf.media-type.attr? } #Duplicated only for changing the namespace.
+ opf.dc.elems = opf.dc.identifier+
+ & opf.dc.title* #made optional
+ & opf.dc.language* #made optional
+ & opf.dc.date?
+ & opf.dc.source*
+ & opf.dc.type*
+ & opf.dc.format*
+ & opf.dc.creator*
+ & opf.dc.subject*
+ & opf.dc.description*
+ & opf.dc.publisher*
+ & opf.dc.contributor*
+ & opf.dc.relation*
+ & opf.dc.coverage*
+ & opf.dc.rights*
+}
+mr.metadata.attlist = opf.unique.identifier.attr
+ & epub.prefix.attr?
+ & opf.id.attr?
+ & opf.i18n.attrs
+ & opf.version.attr?
+
+mr.metadata.content = opf.metadata.content
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.sch b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.sch
new file mode 100644
index 0000000..b1b617a
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/ocf-metadata-30.sch
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+
+ <ns uri="http://www.idpf.org/2013/metadata" prefix="ocf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="ocf.uid">
+ <rule context="ocf:metadata[@unique-identifier]">
+ <let name="uid" value="./@unique-identifier"/>
+ <assert test="dc:identifier[@id = $uid]"> unique-identifier attribute does not resolve to a dc:identifier element (given reference was '<value-of select="$uid"/>')</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.dcterms.modified">
+ <rule context="ocf:metadata">
+ <assert test="count(ocf:meta[@property='dcterms:modified' and not(@refines)]) = 1">dcterms:modified meta element must occur exactly once</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.dcterms.modified.syntax">
+ <rule context="ocf:meta[@property='dcterms:modified']">
+ <assert test="matches(normalize-space(.), '^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$')">dcterms:modified illegal syntax (expecting: 'CCYY-MM-DDThh:mm:ssZ')</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.refines.relative">
+ <rule context="*[@refines and starts-with(@refines,'#')]">
+ <let name="refines-target-id" value="substring(@refines, 2)"/>
+ <assert test="//*[@id=$refines-target-id]">@refines missing target id: '<value-of select="$refines-target-id"/>'</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.meta.source-of">
+ <rule context="ocf:meta[@property='source-of']">
+ <assert test="normalize-space(.) eq 'pagination'">The 'source-of' property must have the value 'pagination'</assert>
+ <assert test="exists(@refines) and exists(../dc:source[@id=substring(current()/@refines,2)])">The 'source-of' property must refine a 'dc:source' element.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.link.record">
+ <rule context="ocf:link[tokenize(@rel,'\s+')='record']">
+ <assert test="exists(@media-type)">The type of 'record' references must be identifiable from the link element's 'media-type' attribute.</assert>
+ <assert test="empty(@refines)">'record' links only applies to the Publication (must not have a 'refines' attribute).</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.meta.belongs-to-collection">
+ <rule context="ocf:meta[@property='belongs-to-collection']">
+ <assert test="empty(@refines) or exists(../ocf:meta[@id=substring(current()/@refines,2)][@property='belongs-to-collection'])">Property 'belongs-to-collection' can only refine other 'belongs-to-collection' properties.</assert>
+ </rule>
+ </pattern>
+
+ <pattern id="ocf.meta.collection-type">
+ <rule context="ocf:meta[@property='collection-type']">
+ <assert test="exists(../ocf:meta[@id=substring(current()/@refines,2)][@property='belongs-to-collection'])">Property 'collection-type' must refine a 'belongs-to-collection' property.</assert>
+ </rule>
+ </pattern>
+
+
+ <pattern id="ocf.rendition.globals">
+ <rule context="ocf:metadata">
+ <assert test="count(ocf:meta[@property='rendition:flow']) le 1">The 'rendition:flow' property must not occur more than one time in the metadata.</assert>
+ <assert test="count(ocf:meta[@property='rendition:layout']) le 1">The 'rendition:layout' property must not occur more than one time in the metadata.</assert>
+ <assert test="count(ocf:meta[@property='rendition:orientation']) le 1">The 'rendition:orientation' property must not occur more than one time in the metadata.</assert>
+ <assert test="count(ocf:meta[@property='rendition:spread']) le 1">The 'rendition:spread' property must not occur more than one time in the metadata.</assert>
+ <assert test="count(ocf:meta[@property='rendition:viewport'][empty(@refines)]) le 1">The 'rendition:viewport' property must not occur more than one time as a global value in the metadata.</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:flow')]">
+ <assert test="empty(@refines)">The 'rendition:flow' property must not be set on elements with a 'refines' attribute</assert>
+ <assert test="normalize-space()=('paginated','scrolled-continuous','scrolled-doc','auto')">The value of the 'rendition:flow' property must be either 'paginated', 'scrolled-continuous', 'scrolled-doc', or 'auto'</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:layout')]">
+ <assert test="empty(@refines)">The 'rendition:layout' property must not be set on elements with a 'refines' attribute</assert>
+ <assert test="normalize-space()=('reflowable','pre-paginated')">The value of the 'rendition:layout' property must be either 'reflowable' or 'pre-paginated'</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:orientation')]">
+ <assert test="empty(@refines)">The 'rendition:orientation' property must not be set on elements with a 'refines' attribute</assert>
+ <assert test="normalize-space()=('landscape','portrait','auto')">The value of the 'rendition:orientation' property must be either 'landscape', 'portrait' or 'auto'</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:spread')]">
+ <assert test="empty(@refines)">The 'rendition:spread' property must not be set on elements with a 'refines' attribute</assert>
+ <assert test="normalize-space()=('none','landscape','portrait','both','auto')">The value of the 'rendition:spread' property must be either 'none', 'landscape', 'portrait', 'both' or 'auto'</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:spread')]">
+ <assert test="empty(@refines)">The 'rendition:spread' property must not be set on elements with a 'refines' attribute</assert>
+ <assert test="normalize-space()=('none','landscape','portrait','both','auto')">The value of the 'rendition:spread' property must be either 'none', 'landscape', 'portrait', 'both' or 'auto'</assert>
+ </rule>
+ <rule context="ocf:meta[@property=('rendition:viewport')]">
+ <assert test="matches(normalize-space(),'^((width=\d+,\s*height=\d+)|(height=\d+,\s*width=\d+))$')">The value of the 'rendition:viewport' property must be of the form 'width=x, height=y'</assert>
+ </rule>
+ </pattern>
+
+ <include href="./mod/id-unique.sch"/>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/package-30-PREP.sch b/src/main/resources/com/adobe/epubcheck/schema/30/package-30-PREP.sch
deleted file mode 100644
index 3e19a2d..0000000
--- a/src/main/resources/com/adobe/epubcheck/schema/30/package-30-PREP.sch
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
-
- <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
- <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
-
- <pattern id="opf.uid">
- <rule context="opf:package[@unique-identifier]">
- <let name="uid" value="./@unique-identifier"/>
- <assert test="/opf:package/opf:metadata/dc:identifier[@id = $uid]">package element unique-identifier attribute does not resolve to a dc:identifier element (given reference was '<value-of select="$uid"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.dcterms.modified">
- <rule context="opf:metadata">
- <assert test="count(opf:meta[@property='dcterms:modified' and not(@refines)]) = 1">package dcterms:modified meta element must occur exactly once</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.dcterms.modified.syntax">
- <rule context="opf:meta[@property='dcterms:modified']">
- <assert test="matches(normalize-space(.), '^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$')">dcterms:modified illegal syntax (expecting: 'CCYY-MM-DDThh:mm:ssZ')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.refines.relative">
- <rule context="*[@refines and starts-with(@refines,'#')]">
- <let name="refines-target-id" value="substring(@refines, 2)"/>
- <assert test="//*[@id=$refines-target-id]">@refines missing target id: '<value-of select="$refines-target-id"/>'</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.itemref">
- <rule context="opf:spine/opf:itemref[@idref]">
- <let name="ref" value="./@idref"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
- <let name="item-media-type" value="$item/@media-type"/>
- <assert test="$item">itemref element idref attribute does not resolve to a manifest item element</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.fallback.ref">
- <rule context="opf:item[@fallback]">
- <let name="ref" value="./@fallback"/>
- <let name="item" value="/opf:package/opf:manifest/opf:item[@id = $ref]"/>
- <assert test="$item and $item/@id != ./@id">manifest item element fallback attribute must resolve to another manifest item (given reference was '<value-of select="$ref"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.media.overlay">
- <rule context="opf:item[@media-overlay]">
- <let name="ref" value="./@media-overlay"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
- <let name="item-media-type" value="$item/@media-type"/>
- <assert test="$item-media-type = 'application/smil+xml'">media overlay items must be of the 'application/smil+xml' type (given type was '<value-of select="$item-media-type"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.media.overlay.metadata.global">
- <rule context="opf:manifest[opf:item[@media-overlay]]">
- <assert test="//opf:meta[@property='media:duration' and not (@refines)]">global media:duration meta element not set</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.media.overlay.metadata.item">
- <rule context="opf:manifest/opf:item[@media-overlay]">
- <let name="mo-idref" value="@media-overlay"/>
- <let name="mo-item" value="//opf:item[@id = $mo-idref]"/>
- <let name="mo-item-id" value="$mo-item/@id"/>
- <let name="mo-item-uri" value="concat('#', $mo-item-id)"/>
- <assert test="//opf:meta[@property='media:duration' and @refines = $mo-item-uri ]">item media:duration meta element not set (expecting: meta property='media:duration' refines='<value-of select="$mo-item-uri"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.bindings.handler">
- <rule context="opf:bindings/opf:mediaType">
- <let name="ref" value="./@handler"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
- <let name="item-media-type" value="$item/@media-type"/>
- <assert test="$item-media-type = 'application/xhtml+xml'">manifest items referenced from the handler attribute of a bindings mediaType element must be of the 'application/xhtml+xml' type (given type was '<value-of select="$item-media-type"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.toc.ncx">
- <rule context="opf:spine[@toc]">
- <let name="ref" value="./@toc"/>
- <let name="item" value="/opf:package/opf:manifest/opf:item[@id = $ref]"/>
- <let name="item-media-type" value="$item/@media-type"/>
- <assert test="$item-media-type = 'application/x-dtbncx+xml'">spine element toc attribute must reference the NCX manifest item (referenced media type was '<value-of select="$item-media-type"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.toc.ncx.2">
- <rule context="opf:item[@media-type='application/x-dtbncx+xml']">
- <assert test="//opf:spine[@toc]">spine element toc attribute must be set when an NCX is included in the publication</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.nav.prop">
- <rule context="opf:manifest">
- <let name="item" value="//opf:manifest/opf:item[@properties and (some $token in tokenize(@properties,' ') satisfies (normalize-space($token) eq 'nav'))]"/>
- <assert test="count($item) = 1">Exactly one manifest item must declare the 'nav' property (number of 'nav' items: <value-of select="count($item)"/>).</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.nav.type">
- <rule context="opf:manifest/opf:item[@properties and (some $token in tokenize(@properties,' ') satisfies (normalize-space($token) eq 'nav'))]">
- <assert test="@media-type = 'application/xhtml+xml'">The manifest item representing the Navigation Document must be of the 'application/xhtml+xml' type (given type was '<value-of select="@media-type"/>')</assert>
- </rule>
- </pattern>
-
- <pattern id="opf.cover-image">
- <rule context="opf:manifest">
- <let name="item" value="//opf:manifest/opf:item[@properties and (some $token in tokenize(@properties,' ') satisfies (normalize-space($token) eq 'cover-image'))]"/>
- <assert test="count($item) < 2">Multiple occurrences of the 'cover-image' property (number of 'cover-image' items: <value-of select="count($item)"/>).</assert>
- </rule>
- </pattern>
-
- <pattern id="id-unique">
- <!-- note: assumes that NCName lexical constraints are tested elsewhere -->
- <let name="id-set" value="//*[@id]"/>
- <rule context="*[@id]">
- <assert test="count($id-set[@id = current()/@id]) = 1">Duplicate ID '<value-of select="current()/@id"/>'</assert>
- </rule>
-</pattern>
-
-
-</schema>
\ No newline at end of file
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 f85f6b4..af3d66e 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
@@ -31,7 +31,7 @@
<pattern id="opf.refines.relative">
<rule context="*[@refines and starts-with(@refines,'#')][not(ancestor::opf:collection)]">
<let name="refines-target-id" value="substring(@refines, 2)"/>
- <assert test="//*[@id=$refines-target-id]">@refines missing target id: '<value-of
+ <assert test="//*[normalize-space(@id)=$refines-target-id]">@refines missing target id: '<value-of
select="$refines-target-id"/>'</assert>
</rule>
</pattern>
@@ -75,8 +75,8 @@
<pattern id="opf.itemref">
<rule context="opf:spine/opf:itemref[@idref]">
- <let name="ref" value="./@idref"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
+ <let name="ref" value="./normalize-space(@idref)"/>
+ <let name="item" value="//opf:manifest/opf:item[normalize-space(@id) = $ref]"/>
<let name="item-media-type" value="$item/@media-type"/>
<assert test="$item">itemref element idref attribute does not resolve to a manifest item
element</assert>
@@ -85,8 +85,8 @@
<pattern id="opf.fallback.ref">
<rule context="opf:item[@fallback]">
- <let name="ref" value="./@fallback"/>
- <let name="item" value="/opf:package/opf:manifest/opf:item[@id = $ref]"/>
+ <let name="ref" value="./normalize-space(@fallback)"/>
+ <let name="item" value="/opf:package/opf:manifest/opf:item[normalize-space(@id) = $ref]"/>
<assert test="$item and $item/@id != ./@id">manifest item element fallback attribute
must resolve to another manifest item (given reference was '<value-of select="$ref"
/>')</assert>
@@ -95,8 +95,8 @@
<pattern id="opf.media.overlay">
<rule context="opf:item[@media-overlay]">
- <let name="ref" value="./@media-overlay"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
+ <let name="ref" value="./normalize-space(@media-overlay)"/>
+ <let name="item" value="//opf:manifest/opf:item[normalize-space(@id) = $ref]"/>
<let name="item-media-type" value="$item/@media-type"/>
<assert test="$item-media-type = 'application/smil+xml'">media overlay items must be of
the 'application/smil+xml' type (given type was '<value-of select="$item-media-type"
@@ -113,9 +113,9 @@
<pattern id="opf.media.overlay.metadata.item">
<rule context="opf:manifest/opf:item[@media-overlay]">
- <let name="mo-idref" value="@media-overlay"/>
- <let name="mo-item" value="//opf:item[@id = $mo-idref]"/>
- <let name="mo-item-id" value="$mo-item/@id"/>
+ <let name="mo-idref" value="normalize-space(@media-overlay)"/>
+ <let name="mo-item" value="//opf:item[normalize-space(@id) = $mo-idref]"/>
+ <let name="mo-item-id" value="$mo-item/normalize-space(@id)"/>
<let name="mo-item-uri" value="concat('#', $mo-item-id)"/>
<assert test="//opf:meta[@property='media:duration' and @refines = $mo-item-uri ]">item
media:duration meta element not set (expecting: meta property='media:duration'
@@ -125,8 +125,8 @@
<pattern id="opf.bindings.handler">
<rule context="opf:bindings/opf:mediaType">
- <let name="ref" value="./@handler"/>
- <let name="item" value="//opf:manifest/opf:item[@id = $ref]"/>
+ <let name="ref" value="./normalize-space(@handler)"/>
+ <let name="item" value="//opf:manifest/opf:item[normalize-space(@id) = $ref]"/>
<let name="item-media-type" value="$item/@media-type"/>
<assert test="$item-media-type = 'application/xhtml+xml'">manifest items referenced from
the handler attribute of a bindings mediaType element must be of the
@@ -137,8 +137,8 @@
<pattern id="opf.toc.ncx">
<rule context="opf:spine[@toc]">
- <let name="ref" value="./@toc"/>
- <let name="item" value="/opf:package/opf:manifest/opf:item[@id = $ref]"/>
+ <let name="ref" value="./normalize-space(@toc)"/>
+ <let name="item" value="/opf:package/opf:manifest/opf:item[normalize-space(@id) = $ref]"/>
<let name="item-media-type" value="$item/@media-type"/>
<assert test="$item-media-type = 'application/x-dtbncx+xml'">spine element toc attribute
must reference the NCX manifest item (referenced media type was '<value-of
@@ -170,7 +170,14 @@
'<value-of select="@media-type"/>')</assert>
</rule>
</pattern>
-
+
+ <pattern id="opf.datanav.prop">
+ <rule context="opf:manifest">
+ <let name="item" value="opf:item[tokenize(@properties, '\s+') = 'data-nav']"/>
+ <assert test="count($item) le 1">Found <value-of select="count($item)"/> 'data-nav' items. The manifest must not include more than one Data Navigation Document.</assert>
+ </rule>
+ </pattern>
+
<pattern id="opf.cover-image">
<rule context="opf:manifest">
<let name="item"
@@ -269,7 +276,7 @@
<rule context="opf:collection/opf:metadata/*[@refines]">
<let name="refines-target-id" value="substring(@refines, 2)"/>
<assert
- test="starts-with(@refines,'#') and ancestor::opf:collection[not(ancestor::opf:collection)]//*[@id=$refines-target-id]"
+ test="starts-with(@refines,'#') and ancestor::opf:collection[not(ancestor::opf:collection)]//*[normalize-space(@id)=$refines-target-id]"
> @refines must point to an element within the current collection </assert>
</rule>
</pattern>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-collection.sch b/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-collection.sch
new file mode 100644
index 0000000..753da3d
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-collection.sch
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="preview.collection">
+ <rule context="opf:collection[tokenize(@role, '\s+') = 'preview']">
+ <assert test="count(child::opf:collection[@role = 'manifest']) eq 1">A 'preview'
+ collection must include exactly one child 'manifest' collection</assert>
+ <assert test="count(child::opf:link) > 0">A 'preview' collection must include at least
+ one child link element, pointing to an EPUB Content Document.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-pub-opf.sch b/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-pub-opf.sch
new file mode 100644
index 0000000..cb44515
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/schema/30/previews/preview-pub-opf.sch
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
+ <ns uri="http://www.idpf.org/2007/opf" prefix="opf"/>
+ <ns uri="http://purl.org/dc/elements/1.1/" prefix="dc"/>
+
+ <pattern id="preview.dctype">
+ <rule context="opf:metadata">
+ <assert test="dc:type[normalize-space(.)='preview']">An EPUB Preview publication must have a 'preview' dc:type.</assert>
+ </rule>
+ </pattern>
+ <pattern id="preview.source">
+ <rule context="opf:metadata">
+ <assert test="dc:source[empty(@refines)]">WARNING: An EPUB Preview publication should link back to its source Publication using a dc:source element.</assert>
+ </rule>
+ <rule context="dc:source[empty(@refines)]">
+ <assert test="normalize-space() ne normalize-space(//dc:identifier[@id=/opf:package/@unique-identifier])">A Preview Publication must not use the same package identifier as its source Publication.</assert>
+ </rule>
+ </pattern>
+
+</schema>
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages.properties b/src/main/resources/com/adobe/epubcheck/util/messages.properties
index ef7101e..710f8df 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages.properties
@@ -1,4 +1,4 @@
-single_file=File is validated as a single file of type %1$s and version %2$s. Only a subset of the available tests is run.
+single_file=File is validated as a single file of type %1$s, for EPUB version %2$s using the %3$s validation profile. Only a subset of the available tests is run.
opv_version_test=*** Candidate for msg deletion *** Tests are performed only for the OPF version.
mode_version_not_supported=The checker doesn't validate type %1$s and version %2$s.
@@ -12,6 +12,8 @@ display_help=-help displays help
argument_needed=At least one argument expected
version_argument_expected=Version number omitted from the -version argument.
mode_argument_expected=Type omitted from the -mode argument.
+profile_argument_expected=Profile name omitted after the -mode argument.
+profile_unknown=Unknown profile '%1s', using�default validation profile.
no_file_specified=No file specified in the arguments. Exiting.
mode_version_ignored=The mode and version arguments are ignored for epubs. They are retrieved from the files.
mode_required=Mode required for non-epub files. Default version is 3.0.
@@ -25,10 +27,20 @@ expected_message_filename=Expected the Custom message file name, but found '%1$s
unrecognized_argument=Unrecognized argument: '%1$s'
help_text = \
- nookepubcheck v.%1$s\n\
+ EpubCheck v%1$s\n\n\
When running this tool, the first argument should be the name (with the path)\n\
of the file to check.\n\
\n\
+ To specify a validation profile (to run checks against a specific EPUB 3 profile\n\
+ or extension specification), use the -profile option:\n\
+ \n\
+ Validation profiles supported:\n\
+ --profile default // the default validation profile\n\
+ --profile dict // validates against the EPUB Dictionaries and Glossaries specification\n\
+ --profile edupub // validates against the EDUPUB Profile\n\
+ --profile idx // validates against the EPUB Indexes specification\n\
+ --profile preview // validates against the EPUB Previews specification\n\
+ \n\
If checking a non-epub file, the epub version of the file must\n\
be specified using -v and the type of the file using -mode.\n\
The default version is: 3.0.\n\
@@ -46,10 +58,11 @@ help_text = \
\n\
This tool also accepts the following options:\n\
--save = saves the epub created from the expanded epub\n\
- --out <file> = output an assessment XML document file.\n\
- --xmp <file> = output an assessment XMP document file.\n\
- --json <file> = output an assessment JSON document file\n\
+ --out <file> = output an assessment XML document file (use - to output to console)\n\
+ --xmp <file> = output an assessment XMP document file (use - to output to console)\n\
+ --json <file> = output an assessment JSON document file (use - to output to console)\n\
-m <file> = same as --mode\n\
+ -p <profile> = same as --profile\n\
-o <file> = same as --out\n\
-x <file> = same as --xmp\n\
-j <file> = same as --json\n\
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_de.properties b/src/main/resources/com/adobe/epubcheck/util/messages_de.properties
new file mode 100644
index 0000000..cc9174b
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_de.properties
@@ -0,0 +1,74 @@
+single_file=Die Datei wird als Einzeldatei vom Typ %1$s in Version %2$s validiert. Nur ein Bruchteil der verfügbaren Tests wird ausgeführt.
+opv_version_test=*** Candidate for msg deletion *** Tests are performed only for the OPF version.
+mode_version_not_supported=EpubCheck validiert Dateien vom Typ %1$s und Version %2$s nicht.
+
+no_errors__or_warnings=Das EPUB enthält keine Fehler oder Warnungen.\nEs ist valide.
+there_were_errors=\nEpubCheck mit Fehlern abgeschlossen.\n
+there_were_warnings=\nEpubCheck mit Warnungen abgeschlossen.\n
+
+error_processing_unexpanded_epub=\nDiese Prüfung kann entpackte EPUB's nicht validieren!\n
+deleting_archive=\nEPUB-Erstellung abgebrochen, weil Fehler aufgetreten sind.\n
+display_help=-help zeigt die Hilfe zu EpubCheck an.
+argument_needed=Es wird mindestens ein Parameter erwartet!
+version_argument_expected=Dem Versions-Parameter -v fehlt die Versionsnummer!
+mode_argument_expected=Dem --mode Parameter fehlt der Typ!.
+no_file_specified=In den Parametern wurde keine Datei spezifiziert. EpubCheck wird beendet!
+mode_version_ignored=Die Parameter --mode und -v werden für EPUB-Dateien ignoriert. Die Werte werden aus dem EPUB entnommen.
+mode_required=Parameter --mode ist für Dateien die kein EPUB sind zwingend erforderlich. Die Standard-Version zur Validierung ist 3.0
+validating_version_message=Verwendung der EPUB %1$s Prüfungen
+output_type_conflict=Es kann nur ein Ausgabeformat gleichzeitig angegeben werden!
+validating_against_epub_version=Validierung gegen den EPUB-Standard Version %1$s
+file_not_found=Datei wurde nicht gefunden: '%1$s'
+epubcheck_completed=EpubCheck abgeschlossen
+error_creating_config_file=Fehler beim Erstellen der Konfigurationsdatei: '%1$s'
+expected_message_filename=Es wird die benutzerspezifische Datei zum Überschreiben von Warnungen und Fehlermeldungen erwartet, gefunden wurde aber '%1$s'
+unrecognized_argument=Unbekannter Parameter: '%1$s'
+
+help_text = \
+ EpubCheck v%1$s\n\n\
+ Der erste Parameter der an dieses Tool übergeben werden sollte,\n\
+ sollte der Dateipfad der zu prüfenden Datei sein.\n\
+ \n\
+ Wenn eine Datei geprüft wird die kein gezipptes EPUB ist,\n\
+ dann muss die EPUB-Versionsnummer gegen die geprüft werden soll\n\
+ mit dem Parameter -v angegeben werden, sowie der Typ der Datei\n\
+ mit dem Parameter --mode\n\
+ Die Standard-Version zur Validierung ist 3.0\n\
+ \n\
+ Unterstützte Werte für die Parameter --mode und -v:\n\
+ --mode opf -v 2.0 // Für OPF-Dateien der Version 2.0\n\
+ --mode opf -v 3.0 // Für OPF-Dateien der Version 3.0\n\
+ --mode xhtml -v 2.0 // Für XHTML-Dateien der Version 2.0\n\
+ --mode xhtml -v 3.0 // Für XHTML-Dateien der Version 3.0\n\
+ --mode svg -v 2.0 // Für SVG-Dateien der Version 2.0\n\
+ --mode svg -v 3.0 // Für SVG-Dateien der Version 3.0\n\
+ --mode nav -v 3.0 // Für EPUB-Navigationsdokumente der Version 3.0\n\
+ --mode mo -v 3.0 // Für EPUB-MediaOverlays der Version 3.0\n\
+ --mode exp // Für entpackte EPUB-Archive\n\
+ \n\
+ EpubCheck akzeptiert diese weiteren Optionen:\n\
+ --save = generiert ein EPUB aus dem entpackten Ordner\n\
+ --out <datei> = speichert das Ergebnis der Validierung im XML-Format\n\
+ --xmp <datei> = speichert das Ergebnis der Validierung im XMP-Format\n\
+ --json <datei> = speichert das Ergebnis der Validierung im JSON-Format\n\
+ -m <datei> = Synonym zu --mode\n\
+ -o <datei> = Synonym zu --out\n\
+ -x <datei> = Synonym zu --xmp\n\
+ -j <datei> = Synonym zu --json\n\
+ --failonwarnings[+|-] = Standardmäßig endet EpubCheck mit ExitCode 1 falls Fehler im EPUB gefunden wurden\n\
+ \ und mit ExitCode 0, falls keine Fehler gefunden wurden. Bei Nutzung von --failonwarnings\n\
+ \ wird EpubCheck auch bereits bei Auftreten von Warnungen mit ExitCode 1 beendet.\n\
+ -q, --quiet = Nur Fehler werden auf der Konsole ausgegeben\n\
+ -f, --fatal = Nur Fatale Fehler ausgeben\n\
+ -e, --error = Nur Fatale Fehler und Fehler ausgeben\n\
+ -w, --warn = Fatale Fehler, Fehler und Warnungen ausgeben\n\
+ -u, --usage = Informationen zur Nutzung bestimmter EPUB-Features ausgeben (Standardmäßig ausgeschaltet);\n\
+ \ wenn aktiviert, dann werden Informationen immer auch in die Ausgabedatei aufgenommen.\n\
+ \n\
+ -l, --listChecks [<datei>] = Ausgabe aller Message-ID's und Fehler-Level in eine\n\
+ \ benutzerdefinierte Datei <datei> oder auf der Konsole.\n\
+ -c, --customMessages [<datei>] = Überschreibt die Fehler-Level von EpubCheck wie in der\n\
+ \ benutzerdefinierten Datei <datei> angegeben.\n\
+ \n\
+ -h, -? or --help = Zeigt diese Hilfe an\n
+
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_es.properties b/src/main/resources/com/adobe/epubcheck/util/messages_es.properties
new file mode 100644
index 0000000..8bcaa4f
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_es.properties
@@ -0,0 +1,68 @@
+single_file=El archivo se valida como archivo único de tipo %1$s y versión %2$s. Solo se ejecuta una parte de los tests disponibles.
+opv_version_test=*** Candidato para el borrado msg *** Los tests solo se aplican a la versión OPF.
+mode_version_not_supported=El validador no actúa sobre el tipo %1$s y la versión %2$s.
+no_errors__or_warnings=No se han detectado errores o advertencias.
+there_were_errors=\nPrueba finalizada con errores\n
+there_were_warnings=\nPrueba finalizada con advertencias\n
+error_processing_unexpanded_epub=\nLa prueba no puede procesar epubs expandidos\n
+deleting_archive=\nSe ha cancelado la creación del epub porque se han detectado errores.\n
+display_help=-help muestra la ayuda
+argument_needed=Se esperaba al menos un argumento
+version_argument_expected=El número de versión se ha omitido en el argumento -version.
+mode_argument_expected=El tipo se ha omitido en el argumento -mode.
+no_file_specified=No se ha especificado un archivo en el argumento. Saliendo.
+mode_version_ignored=Los argumentos modo y versión se ignoran para epubs. Se extraen de los archivos.
+mode_required=Mode es obligatorio para archivos que no sean epub. La versión actual es 3.0.
+validating_version_message=Validación usando la versión de reglas epub %1$s.
+output_type_conflict=Solo se puede especificar un formato de salida cada vez.
+validating_against_epub_version=Validación con la versión EPUB %1$s - validación personalizada
+file_not_found=No se encuentra el archivo: '%1$s'
+epubcheck_completed=epubcheck completado
+error_creating_config_file=Error al crear el archivo de configuración '%1$s'.
+expected_message_filename=Se esperaba nombre de archivo personalizado, pero se ha mostrado '%1$s'
+unrecognized_argument=Argumento desconocido: '%1$s'
+help_text = \
+ EpubCheck v%1$s\n\n\
+ Para ejecutar epubcheck el primer argumento debe ser el nombre (y la ruta)\n\
+ del archivo que se valida.\n\
+ \n\
+ Si se valida un archivo que no sea epub, la versión epub del archivo\n\
+ debe especificarse con -v y el tipo de archiv con -mode.\n\
+ LA versión por defecto es: 3.0.\n\
+ \n\
+ Modes and versions supported: \n\
+ --mode opf -v 2.0\n\
+ --mode opf -v 3.0\n\
+ --mode xhtml -v 2.0\n\
+ --mode xhtml -v 3.0\n\
+ --mode svg -v 2.0\n\
+ --mode svg -v 3.0\n\
+ --mode nav -v 3.0\n\
+ --mode mo -v 3.0 // Para la validación de Media Overlays\n\
+ --mode exp // Para archivos EPUB expandidos\n\
+ \n\
+ Esta herramientas permite las siguientes opciones:\n\
+ --save = guarda el epub creado a partir del epub expandido\n\
+ --out <file> = extrae un fichero XML de validación (utilice - para salida a la consola)\n\
+ --xmp <file> = extrae un fichero XMP de validación (utilice - para salida a la consola)\n\
+ --json <file> = extrae un fichero JSON de validación (utilice - para salida a la consola)\n\
+ -m <file> = idéntico a --mode\n\
+ -o <file> = idéntico a --out\n\
+ -x <file> = idéntico a --xmp\n\
+ -j <file> = idéntico a --json\n\
+ --failonwarnings[+|-] = Por defecto, la herramienta devuelve 1 si se encuentran errores en el archivo o 0 si no hay errores\n\
+ \ Utilizar --failonwarnings provoca la detención del proceso con un resultado\n\
+ \ de 1 si hay errores o advertencias y 0 cuando no los hay.\n\
+ -q, --quiet = no hay mensajes en la consola; excepto errores, solo en la salida\n\
+ -f, --fatal = incluye solo errores en la salida\n\
+ -e, --error = incluye solo errores y errores graves en la salida\n\
+ -w, --warn = incluye solo errores, errores graves y advertencias en la salida\n\
+ -u, --usage = incluye información sobre el uso de ePub en la salida\n\
+ \ (por defecto es OFF); si está activada, la información de uso será incluida\n\
+ \ en el archivo de salida\n\
+ \n\
+ -l, --listChecks [<file>] = enumera los identificadores de mensaje y los niveles de gravedad en el archivo personalizado de mensajes <file>\n\
+ \ o en la consola\n\
+ -c, --customMessages [<file>] = sobreescribe los niveles de gravedad del mensaje según los parámetros del archivo personalizado de mensajes <file>\n\
+ \n\
+ -h, -? or --help = muestra este texto de ayuda\n
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties b/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties
new file mode 100644
index 0000000..7825e1a
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties
@@ -0,0 +1,71 @@
+single_file=Le fichier est validé comme un simple fichier de type %1$s et de version %2$s. Seulement un sous-ensemble des tests seront passés.
+opv_version_test=*** Candidat à la suppression *** Les tests sont passés uniquement sur la version OPF.
+mode_version_not_supported=Le validateur ne fonctionne que sur le type %1$s et la version %2$s.
+
+no_errors__or_warnings=Aucune erreur ou avertissement détecté.
+there_were_errors=\nVérifications terminés avec des erreurs\n
+there_were_warnings=\nVérifications terminés avec des avertissements\n
+
+error_processing_unexpanded_epub=\nCette vérification ne peut être menée sur des epubs éclatés\n
+deleting_archive=\nLa création de l'epub a été annulée suite aux erreurs détectées.\n
+display_help=-help affiche l'aide
+argument_needed=Un argument au moins est attendu
+version_argument_expected=Le numéro de version a été omis dans l'argument -version.
+mode_argument_expected=Le type a été omis dans l'argument -mode.
+no_file_specified=Aucun fichier n'a été précisé dans les arguments. Sortie.
+mode_version_ignored=Les arguments de mode et de version sont ignorés pour les epubs. Ils sont récupérés dans les fichiers.
+mode_required=Argument mode obligatoire pour les fichiers non-epubs. La version par défault est 3.0.
+validating_version_message=Vérifications faites en utilisant les règles de la version epub %1$s.
+output_type_conflict=Seul un type de format de sortie peut être précisé à la fois.
+validating_against_epub_version=Vérification par rapport à l'epub version %1$s - vérification personnalisée
+file_not_found=Fichier introuvable : '%1$s'
+epubcheck_completed=epubcheck terminé
+error_creating_config_file=Erreur lors de la création du fichier de configuration '%1$s'.
+expected_message_filename=Nom du fichier de configuration personnalisée attendu, mais '%1$s' fourni
+unrecognized_argument=Argument inconnu: '%1$s'
+
+help_text = \
+ EpubCheck v%1$s\n\n\
+ Pour lancer cet outil, le premier argument doit être le nom (avec le chemin)\n\
+ du fichier à vérifier.\n\
+ \n\
+ Si un fichier non-epub est vérifié, la version epub du fichier\n\
+ doit être fournie en utilisant -v et le type du fichier en utilisant -mode.\n\
+ La version par défaut est 3.0.\n\
+ \n\
+ Modes et versions supportés : \n\
+ --mode opf -v 2.0\n\
+ --mode opf -v 3.0\n\
+ --mode xhtml -v 2.0\n\
+ --mode xhtml -v 3.0\n\
+ --mode svg -v 2.0\n\
+ --mode svg -v 3.0\n\
+ --mode nav -v 3.0\n\
+ --mode mo -v 3.0 // Pour la vérification des Media Overlays\n\
+ --mode exp // Pour des archives EPUB éclatés\n\
+ \n\
+ L'outil accepte aussi les options suivantes :\n\
+ --save = sauve l'epub créé depuis l'epub éclaté\n\
+ --out <file> = émet un fichier XML de validation (utilisé - pour émettre dans stdout).\n\
+ --xmp <file> = émet un fichier XMP de validation (utilisé - pour émettre dans stdout).\n\
+ --json <file> = émet un fichier JSON de validation (utilisé - pour émettre dans stdout)\n\
+ -m <file> = identique à --mode\n\
+ -o <file> = identique à --out\n\
+ -x <file> = identique à --xmp\n\
+ -j <file> = identique à --json\n\
+ --failonwarnings[+|-] = Par défautn l'outil renvoie 1 si des erreurs sont trouvées et 0 s'il n'y a pas d'erreur.\n\
+ \ En utilisant --failonwarnings le processus sortira avec un status 1\n\
+ \ si des avertissements ou des erreurs sont trouvés et 0 seulement s'il n'y a ni erreur ni avertissement.\n\
+ -q, --quiet = aucun message émis sur la console, seulement les erreurs, seulement sur la sortie\n\
+ -f, --fatal = n'émet que les erreurs fatales sur le sortie\n\
+ -e, --error = n'émet que les erreurs et les erreurs fatales sur le sortie\n\
+ -w, --warn = émet les erreurs fatales, les erreurs et les avertissements sur la sortie\n\
+ -u, --usage = inclis aussi les message d'utilisation des epub sur la sortie\n\
+ \ (par défaut à OFF); si activé, les messages d'utilisation seront toujours inclus dans la sortie\n\
+ \n\
+ -l, --listChecks [<file>] = listes les identifiants de message et leur degré de sévérité dans un fichier de personnalitation des messages dans le fichier <file>\n\
+ \ ou la console\n\
+ -c, --customMessages [<file>] = remplace les niveaux de sévérité des messages par ceux du fichier de personnalitation des messages défini dans <file>\n\
+ \n\
+ -h, -? ou --help = affiche ce message d'aide\n
+
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_it.properties b/src/main/resources/com/adobe/epubcheck/util/messages_it.properties
new file mode 100644
index 0000000..b7266ae
--- /dev/null
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_it.properties
@@ -0,0 +1,79 @@
+single_file=Il file sarà controllato come singolo file di tipo %1$s e versione %2$s. Solo un sottoinsieme dei test disponibili sarà eseguito.
+opv_version_test=*** Candidato per essere eliminato *** I test sono eseguiti solo per la versione OPF.
+mode_version_not_supported=Questo programma non supporta il tipo %1$s o la versione %1$s.
+
+no_errors__or_warnings=Non sono stati trovati errori o potenziali errori.
+there_were_errors=\nSono stati rilevati errori.\n
+there_were_warnings=\nSono stati rilevati potenziali errori.\n
+
+error_processing_unexpanded_epub=\nI controlli richiesti non possono essere effettuati su file decompressi.\n
+deleting_archive=\nCreazione del file EPUB terminata a causa di errori rilevati.\n
+display_help=-help mosta la guida.
+argument_needed=È richiesto almeno un argomento.
+version_argument_expected=Non è stato specificato un valore per l'argomento -v.
+mode_argument_expected=Non è stato specificato un valore per l'argomento --mode.
+no_file_specified=Non è stato specificato un file.
+mode_version_ignored=I valori degli argomenti --mode e -v sono ignorati per i file EPUB compressi, perché letti dal file stesso.
+mode_required=Il parametro --mode è richiesto se non si indica un file EPUB. Il valore predefinito di -v è 3.0.
+validating_version_message=Controllo secondo le regole per EPUB versione %1$s.
+output_type_conflict=Può essere specificato un solo formato di output.
+validating_against_epub_version=Controllo secondo le regole per EPUB versione %1$s (regole personalizzate).
+file_not_found=File non trovato: '%1$s'.
+epubcheck_completed=Controllo completato.
+error_creating_config_file=Errore durante la creazione del file di regole personalizzate '%1$s'.
+expected_message_filename=Era atteso un file di regole personalizzate, invece è stato trovato '%1$s'.
+unrecognized_argument=Argumento non riconosciuto: '%1$s'.
+
+help_text = \
+ EpubCheck v%1$s\n\n\
+ Il primo argomento è il percorso completo del file da controllare.\n\
+ \n\
+ Se non si controlla un file EPUB, la versione EPUB deve essere specificata\n\
+ usando -v e il tipo di file usando --mode. La versione predefinita è la 3.0.\n\
+ \n\
+ Tipi di controlli e corrispondenti versioni EPUB:\n\
+ --mode exp = controlla file decompressi\n\
+ --mode mo -v 3.0 = controlla Media Overlays\n\
+ --mode nav -v 3.0 = controlla Navigation Document\n\
+ --mode opf -v 2.0 = controlla file OPF\n\
+ --mode opf -v 3.0 = controlla file OPF\n\
+ --mode svg -v 2.0 = controlla file SVG\n\
+ --mode svg -v 3.0 = controlla file SVG\n\
+ --mode xhtml -v 2.0 = controlla file XHTML\n\
+ --mode xhtml -v 3.0 = controlla file XHTML\n\
+ \n\
+ Argomenti opzionali:\n\
+ --save = crea un EPUB compresso alla fine del controllo\n\
+ --out <file> = produci un documento XML coi risultati\n\
+ \ ('-' per l'output in console)\n\
+ --xmp <file> = produci un documento XMP coi risultati\n\
+ \ ('-' per l'output in console)\n\
+ --json <file> = produci un documento JSON coi risultati\n\
+ \ ('-' per l'output in console)\n\
+ -m <tipo> = sinonimo di --mode\n\
+ -o <file> = sinonimo di --out\n\
+ -x <file> = sinonimo di --xmp\n\
+ -j <file> = sinonimo di --json\n\
+ --failonwarnings[+|-] = di norma, ritorna 1 se sono rilevati errori,\n\
+ \ e 0 altrimenti.\n\
+ \ Specificando --failonwarnings, sarà ritornato\n\
+ \ 1 in presenza di errori o potenziali errori\n\
+ \ e 0 altrimenti.\n\
+ -q, --quiet = non stampa messaggi in console, salvo errori\n\
+ -f, --fatal = includi solo gli errori fatali nell'output\n\
+ -e, --error = includi gli errori (fatali e non) nell'output\n\
+ -w, --warn = includi gli errori (fatali e non) e\n\
+ \ i potenziali errori nell'output\n\
+ -u, --usage = includi informazioni sull'uso delle\n\
+ \ varie specifiche EPUB nell'output;\n\
+ \ se abilitate, tali informazioni saranno\n\
+ \ sempre incluse nell'output <file>\n\
+ \n\
+ -l, --listChecks [<file>] = salva gli id e i livelli di errore nel\n\
+ \ file personalizzato <file> o stampali\n\
+ \ nella console (se <file> è omesso)\n\
+ -c, --customMessages [<file>] = ridefinisci i livelli di errore come\n\
+ \ specificato nel file personalizzato <file>\n\
+ \n\
+ -h, -? o --help = stampa questa guida\n
+
diff --git a/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties b/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
index 57a0a2d..13d22ed 100644
--- a/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
+++ b/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties
@@ -25,7 +25,7 @@ expected_message_filename = カスタムメッセージファイル名として
unrecognized_argument = 認識できない引数です: '%1$s'
help_text = \
- nookepubcheck v.%1$s\n\
+ EpubCheck v%1$s\n\n\
このツールを実行するには、最初の引数をチェックしたいファイルの(パスを含んだ)\n\
名前にして下さい.\n\
\n\
diff --git a/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties
new file mode 100755
index 0000000..38c0030
--- /dev/null
+++ b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties
@@ -0,0 +1,71 @@
+# This is German translation of org/thaiopensource/datatype/xsd/resources/Messages.properties file.
+# Translation by Tobias Fischer (https://github.com/tofi86)
+#
+# First block doesn't need to be translated for epubcheck, as @murata0204 noted in
+# https://github.com/IDPF/epubcheck/pull/472#issuecomment-58265808
+#
+# Non-unicode chars (german umlauts, etc..) must be escaped like \u00DF
+# because otherwise Jing can't parse them. Bad UTF8-support
+
+
+# Properties file specifying messages
+enumeration_param=\"enumeration\" facet is not allowed as a parameter: use \"value\" element instead
+whiteSpace_param=\"whiteSpace\" facet is not allowed as a parameter
+unrecognized_param=unrecognized parameter \"{0}\"
+invalid_regex=invalid regular expression: {0}
+not_ordered=parameter can only be applied to ordered datatype
+invalid_limit=\"{0}\" is not allowed by the base type: {1}
+no_length=base datatype does not define a units of length
+scale_not_derived_from_decimal=\"scale\" parameter can only be applied to datatype derived from \"decimal\"
+scale_not_non_negative_integer=\"scale\" parameter must be non negative integer
+length_not_non_negative_integer=\"length\" parameter must be non negative integer
+precision_not_derived_from_decimal=\"precision\" parameter can only be applied to datatype derived from \"decimal\"
+precision_not_positive_integer=\"precision\" parameter must be positive integer
+regex_impl_not_found=cannot find regular expression implementation; use JDK 1.4 or add Xerces2 to your classpath
+regex_internal_error=internal error in regular expression for datatype {0}
+
+# validation errors
+length_violation=es muss {0} sein, mit einer exakten L\u00E4nge von {1} (L\u00E4nge ist derzeit {2})
+max_length_violation=es muss {0} sein, mit einer maximalen L\u00E4nge von {1} (L\u00E4nge ist derzeit {2})
+min_length_violation=es muss {0} sein, mit einer minimalen L\u00E4nge von {1} (L\u00E4nge ist derzeit {2})
+min_inclusive_violation=es muss {0} sein, gr\u00F6\u00DFer gleich {1}
+min_exclusive_violation=es muss {0} sein, gr\u00F6\u00DFer als {1}
+max_inclusive_violation=es muss {0} sein, kleiner gleich {1}
+max_exclusive_violation=es muss {0} sein, kleiner als {1}
+pattern_violation=es muss {0} sein, der auf folgenden regul\u00E4ren Ausdruck zutrifft: \"{1}\"
+entity_violation=es muss ein Name sein, der in der DTD als 'unparsed entity' deklariert ist
+undeclared_prefix=es muss ein QName sein, dessen Pr\u00E4fix deklariert ist, falls vorhanden (Pr\u00E4fix \"{0}\" ist nicht deklariert)
+precision_violation=es muss {0} sein, mit mindestens {1} signifikanten Stellen (gefundene Stellen: {2})
+precision_1_violation=es muss {0} sein, mit genau einer signifikanten Stelle (gefundene Stellen: {1})
+# part of the point is to avoid ugly "digit(s)" in the error message
+scale_violation=es muss eine Dezimalzahl mit mindestens {0} Nachkommastellen sein (gefundene Stellen: {1})
+scale_0_violation=es muss eine Dezimalzahl ohne Nachkommastellen sein
+scale_1_violation=es muss eine Dezimalzahl mit maximal einer Nachkommastelle sein (gefundene Stellen: {1})
+lexical_violation=es muss {0} sein
+
+# fragments substituted in above
+lexical_space_string=ein String
+lexical_space_uri=eine URI
+lexical_space_boolean=ein Boolean
+lexical_space_decimal=eine Dezimalzahl
+lexical_space_float=eine Flie\u00DFkommazahl
+lexical_space_duration=eine Zeitangabe
+lexical_space_hex=ein hexadezimaler String
+lexical_space_base64=ein Base64-String
+lexical_space_integer=ein Integer-Wert
+lexical_space_name=ein XML-Name
+lexical_space_ncname=ein XML-Name ohne Doppelpunkt
+lexical_space_nmtoken=ein XML-NMTOKEN
+lexical_space_qname=ein XML-QName
+lexical_space_list=eine Leerzeichen-separierte Liste
+lexical_space_list_ncname=eine Liste von XML-Namen ohne Doppelpunkt
+lexical_space_list_nmtoken=eine Liste von XML-NMTOKENs
+lexical_space_date_y_m_d_time=ein Datums- und Zeitangabe im ISO-Format
+lexical_space_time=eine Zeitangabe im ISO-Format
+lexical_space_date_y_m_d=ein Datum im ISO-Format
+lexical_space_date_y_m=Jahr und Monat im ISO-Format
+lexical_space_date_y=eine Jahresangabe
+lexical_space_date_m_d=eine Datumsangabe im ISO-Format f\u00FCr Monat und Tag (in der Form --MM-DD)
+lexical_space_date_m=ein Monat im ISO-Format (in der Form --MM)
+lexical_space_date_d=ein Tage im Monat im ISO-Format (in der Form ---DD)
+lexical_space_language=eine Sprachangabe im RFC-3066-Format
diff --git a/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_it.properties b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_it.properties
new file mode 100644
index 0000000..18578f0
--- /dev/null
+++ b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_it.properties
@@ -0,0 +1,71 @@
+# This is the Italian translation of org/thaiopensource/datatype/xsd/resources/Messages.properties file.
+# Translation by Alberto Pettarin (https://github.com/pettarin)
+#
+# The first block doesn't need to be translated for epubcheck, as @murata0204 noted in
+# https://github.com/IDPF/epubcheck/pull/472#issuecomment-58265808
+#
+# Non-unicode chars (german umlauts, etc..) must be escaped like \u00DF
+# because otherwise Jing can't parse them. (Bad UTF-8 support.)
+
+
+# Properties file specifying messages
+enumeration_param=\"enumeration\" facet is not allowed as a parameter: use \"value\" element instead
+whiteSpace_param=\"whiteSpace\" facet is not allowed as a parameter
+unrecognized_param=unrecognized parameter \"{0}\"
+invalid_regex=invalid regular expression: {0}
+not_ordered=parameter can only be applied to ordered datatype
+invalid_limit=\"{0}\" is not allowed by the base type: {1}
+no_length=base datatype does not define a units of length
+scale_not_derived_from_decimal=\"scale\" parameter can only be applied to datatype derived from \"decimal\"
+scale_not_non_negative_integer=\"scale\" parameter must be non negative integer
+length_not_non_negative_integer=\"length\" parameter must be non negative integer
+precision_not_derived_from_decimal=\"precision\" parameter can only be applied to datatype derived from \"decimal\"
+precision_not_positive_integer=\"precision\" parameter must be positive integer
+regex_impl_not_found=cannot find regular expression implementation; use JDK 1.4 or add Xerces2 to your classpath
+regex_internal_error=internal error in regular expression for datatype {0}
+
+# validation errors
+length_violation=espressione non valida: {0} deve avere lunghezza {1} (ora: {2})
+max_length_violation=espressione non valida: {0} deve avere una lunghezza massima di {0} (ora: {2})
+min_length_violation=espressione non valida: {0} deve avere una lunghezza minima di {0} (ora: {2})
+min_inclusive_violation=espressione non valida: {0} deve essere maggiore o uguale a {1}
+min_exclusive_violation=espressione non valida: {0} deve essere maggiore di {1}
+max_inclusive_violation=espressione non valida: {0} deve essere minore o uguale a {1}
+max_exclusive_violation=espressione non valida: {0} deve essere minore di {1}
+pattern_violation=espressione non valida: {0} non soddisfa l''espressione regolare {1}
+entity_violation=espressione non valida: {0} deve essere un nome dichiarato nel DTD come \"unparsed entity\"
+undeclared_prefix=espressione non valida: {0} deve essere un nome qualificato dichiarato
+precision_violation=espressione non valida: {0} deve avere almeno {1} cifre decimali (ora: {2})
+precision_1_violation=espressione non valida: {0} deve avere al massimo una cifra decimale (ora: {1})
+# part of the point is to avoid ugly "digit(s)" in the error message
+scale_violation=espressione non valida: deve essere un numero con almeno {0} cifre decimali (ora: {1})
+scale_0_violation=espressione non valida: deve essere un numero senza cifre decimali
+scale_1_violation=espressione non valida: deve essere un numero con al massimo una cifra decimale (ora: {1})
+lexical_violation=espressione non valida: {0} costrutto non riconosciuto
+
+# fragments substituted in above
+lexical_space_string=una stringa
+lexical_space_uri=uno URI
+lexical_space_boolean=un booleano
+lexical_space_decimal=un numero decimale
+lexical_space_float=un numero decimale (float)
+lexical_space_duration=una durata temporale
+lexical_space_hex=una stringa esadecimale
+lexical_space_base64=una stringa in Base64
+lexical_space_integer=un intero
+lexical_space_name=un nome XML
+lexical_space_ncname=un nome XML senza due punti (ncname)
+lexical_space_nmtoken=un token XML (nmtoken)
+lexical_space_qname=un nome XML qualificato (qname)
+lexical_space_list=una lista di nomi XML separati da uno spazio
+lexical_space_list_ncname=una lista di nomi XML senza due punti (ncname)
+lexical_space_list_nmtoken=una lista di token XML (nmtoken)
+lexical_space_date_y_m_d_time=una data e ora in formato ISO
+lexical_space_time=una ora in formato ISO
+lexical_space_date_y_m_d=una data (YYYY-MM-DD) in formato ISO
+lexical_space_date_y_m=una data (YYYY-MM) in formato ISO
+lexical_space_date_y=una data (YYYY) in formato ISO
+lexical_space_date_m_d=una data (MM-DD) in formato ISO
+lexical_space_date_m=una data (MM) in formato ISO
+lexical_space_date_d=una data (DD) in formato ISO
+lexical_space_language=un codice lingua in formato RFC 3066
diff --git a/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties
index 8218b0b..322c92d 100755
--- a/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties
+++ b/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties
@@ -1,6 +1,6 @@
# Copyright (c) 2013 JEPA (Japan Electronic Publishing Association).
#
-# This is Japanese translation of org/thaiopensource/relaxng/pattern/resources/Messages.propeerties file.
+# This is Japanese translation of org/thaiopensource/datatype/xsd/resources/Messages.properties file.
# Original resources: http://info.jepa.or.jp/document/epubcheckj
# Properties file specifying messages
diff --git a/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_de.properties b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_de.properties
new file mode 100644
index 0000000..17563ff
--- /dev/null
+++ b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_de.properties
@@ -0,0 +1,148 @@
+# This is German translation of org/thaiopensource/relaxng/pattern/resources/Messages.properties file.
+# Translation by Tobias Fischer (https://github.com/tofi86)
+#
+# First two blocks doesn't need to be translated for epubcheck, as @murata0204 noted in
+# https://github.com/IDPF/epubcheck/pull/472#issuecomment-58265808
+#
+# Non-unicode chars (german umlauts, etc..) must be escaped like \u00DF
+# because otherwise Jing can't parse them. Bad UTF8-support
+
+
+# Properties file specifying messages
+illegal_href_attribute=illegal \"href\" attribute
+ns_attribute_ignored=\"ns\" attribute ignored
+reference_to_undefined=reference to undefined pattern \"{0}\"
+missing_start_element=missing \"start\" element
+recursive_reference=bad recursive reference to pattern \"{0}\"
+recursive_include=recursive inclusion of URL \"{0}\"
+duplicate_define=multiple definitions of \"{0}\" without \"combine\" attribute
+duplicate_start=multiple definitions of start without \"combine\" attribute
+conflict_combine_define=conflicting values of \"combine\" attribute for definition of \"{0}\"
+conflict_combine_start=conflicting values of \"combine\" attribute for definition of start
+missing_start_replacement=\"start\" in \"include\" does not override anything
+missing_define_replacement=definition of \"{0}\" in \"include\" does not override anything
+interleave_string=interleave of \"string\" or \"data\" element
+group_string=group of \"string\" or \"data\" element
+one_or_more_string=repeat of \"string\" or \"data\" element
+unrecognized_datatype=datatype \"{1}\" from library \"{0}\" not recognized
+unsupported_datatype_detail=datatype \"{1}\" from library \"{0}\" not supported: {2}
+unrecognized_datatype_library=datatype library \"{0}\" not recognized
+unrecognized_builtin_datatype=no such builtin datatype \"{0}\": must be \"string\" or \"token\"
+invalid_value=\"{0}\" is not a valid value of the datatype
+parent_ref_outside_grammar=reference to non-existent parent grammar
+ref_outside_grammar=reference to non-existent grammar
+expected_one_name_class=found \"{0}\" element but expected no further content
+builtin_param=builtin datatypes do not have any parameters
+invalid_param_display=invalid parameter:\n{0}
+invalid_param_detail_display=invalid parameter: {0}:\n{1}
+display_param={0}>>>>{1}
+invalid_param_detail=invalid parameter: {0}
+invalid_param=invalid parameter
+invalid_params_detail=invalid parameters: {0}
+invalid_params=invalid parameters
+datatype_requires_parameter=datatype cannot be used without parameters
+datatype_requires_parameter_detail=datatype cannot be used without parameters: {0}
+
+attribute_contains_attribute=an attribute pattern must not contain an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path attribute//attribute)
+attribute_contains_element=an attribute pattern must not contain an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path attribute//ref)
+data_except_contains_attribute=a data pattern must not exclude an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//attribute)
+data_except_contains_element=a data pattern must not exclude an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//ref)
+data_except_contains_empty=a data pattern must not exclude an empty pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//empty)
+data_except_contains_group=a data pattern must not exclude a group (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//group)
+data_except_contains_interleave=a data pattern must not exclude an interleaved group (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//interleave)
+data_except_contains_list=a data pattern must not exclude a list pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//list)
+data_except_contains_one_or_more=a data pattern must not exclude a repetition (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//oneOrMore)
+data_except_contains_text=a data pattern must not exclude a text pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//text)
+list_contains_attribute=a list pattern must not contain an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//attribute)
+list_contains_element=a list pattern must not contain an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//ref)
+list_contains_list=a list pattern must not contain a list pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//list)
+list_contains_text=a list pattern must not contain a text pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//text)
+list_contains_interleave=a list pattern must not contain an interleave pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//interleave)
+one_or_more_contains_group_contains_attribute=a group of attributes must not be repeatable (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path oneOrMore//group//attribute)
+one_or_more_contains_interleave_contains_attribute=an interleaved group of attributes must not be repeatable (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path oneOrMore//interleave//attribute)
+start_contains_attribute=found element matching the prohibited path start//attribute in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_data=found element matching the prohibited path start//data in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_empty=found element matching the prohibited path start//empty in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_group=found element matching the prohibited path start//group in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_interleave=found element matching the prohibited path start//interleave in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_list=found element matching the prohibited path start//list in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_one_or_more=found element matching the prohibited path start//oneOrMore in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_text=found element matching the prohibited path start//text in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_value=found element matching the prohibited path start//value in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+duplicate_attribute=duplicate attribute
+duplicate_attribute_name=duplicate attribute {0}
+duplicate_attribute_ns=attributes from namespace \"{0}\" can occur more than once
+interleave_element_overlap=overlapping element names in operands of \"interleave\"
+interleave_element_overlap_name=the element {0} can occur in more than one operand of \"interleave\"
+interleave_element_overlap_ns=elements from namespace \"{0}\" can occur in more than one operand of \"interleave\"
+interleave_text_overlap=both operands of \"interleave\" contain \"text\"
+open_name_class_not_repeated=attribute using \"nsName\" or \"anyName\" must be in \"oneOrMore\"
+xmlns_uri_attribute=attribute must not have namespace URI \"http://www.w3.org/2000/xmlns\"
+xmlns_attribute=attribute must not be named \"xmlns\"
+
+# Validation errors
+unknown_element=Element {0} ist nicht erlaubt{1}
+unexpected_element_required_element_missing=Das Element {0} ist an dieser Stelle noch nicht erlaubt. Es fehlt das Element {1}
+unexpected_element_required_elements_missing=Das Element {0} ist an dieser Stelle noch nicht erlaubt. Es fehlen die Elemente {1}
+element_not_allowed_yet=Element {0} ist an dieser Stelle noch nicht erlaubt{1}
+out_of_context_element=Element {0} ist an dieser Stelle nicht erlaubt{1}
+no_attributes_allowed=Attribut {0} vorhanden. Attribute sind an dieser Stelle jedoch nicht erlaubt!
+invalid_attribute_name=Attribut {0} ist an diesem Element nicht erlaubt{1}
+invalid_attribute_value=Der Wert des Attributs {0} ist ung\u00FCltig{1}
+required_attributes_missing_expected=Dem Element {0} fehlen ein oder mehrere erforderliche Attribute{1}
+required_attribute_missing=Dem Element {0} fehlt das erforderliche {1} Attribut
+required_attributes_missing=Dem Element {0} fehlen die folgenden erforderlichen Attribute: {1}
+incomplete_element_required_elements_missing_expected=Das Element {0} ist nicht vollst\u00E4ndig{1}
+incomplete_element_required_element_missing=Das Element {0} ist nicht vollst\u00E4ndig. Es fehlt das erforderliche Kind-Element {1}
+incomplete_element_required_elements_missing=Das Element {0} ist nicht vollst\u00E4ndig. Es fehlen die erforderlichen Kind-Elemente {1}
+text_not_allowed=Text ist an dieser Stelle nicht erlaubt{0}
+document_incomplete=Dokument scheint unvollst\u00E4ndig zu sein
+invalid_element_value=Der Inhalt des Elements {0} ist ung\u00FCltig{1}
+blank_not_allowed=Das Element {0} muss Inhalt besitzen{1}
+schema_allows_nothing=Das Schema erlaubt an dieser Stelle keine Elemente: <notAllowed/>
+
+# ID correctness errors
+id_element_name_class=an \"element\" pattern containing an \"attribute\" pattern with a non-null ID-type must have a name class that contains only \"choice\" and \"name\" elements
+id_attribute_name_class=an \"attribute\" pattern with a non-null ID-type must have a name class that is a single name
+id_parent=a \"data\" or \"value\" pattern with non-null ID-type must occur as the child of an \"attribute\" pattern
+id_type_conflict=conflicting ID-types for attribute {1} of element {0}
+
+# ID soundness errors
+id_no_tokens=Attributwert enth\u00E4lt keinen ID-Aufruf
+id_multiple_tokens=Attributwert enth\u00E4lt mehrere ID-Aufrufe
+idref_no_tokens=Attributwert enth\u00E4lt keinen IDREF-Aufruf
+idref_multiple_tokens=Attributwert enth\u00E4lt mehrere IDREF-Aufrufe
+idrefs_no_tokens=Attributwert enth\u00E4lt keine IDREF-Aufrufe
+missing_id=IDREF \"{0}\" ohne zugeh\u00F6rige ID
+duplicate_id=die ID \"{0}\" wurde bereits definiert
+first_id=erste Fundstelle der ID \"{0}\"
+
+# Fragments
+name_absent_namespace=\"{0}\"
+name_with_namespace=\"{1}\" aus dem Namespace \"{0}\"
+qname=\"{0}\"
+qnames_nsdecls={0} (mit {1})
+or_list_pair={0} oder {1}
+or_list_many_first={0}
+or_list_many_middle={0}, {1}
+or_list_many_last={0} oder {1}
+and_list_pair={0} und {1}
+and_list_many_first={0}
+and_list_many_middle={0}, {1}
+and_list_many_last={0} und {1}
+
+expected=. Erwartet wird {0}
+element_end_tag=das Element-Ende-Tag
+text=Text
+data=Daten
+element_list=Element {0}
+element_other_ns=ein Element aus einem anderen Namespace
+expected_attribute=. Erlaubt ist nur das Attribut {0}
+expected_attribute_or_other_ns=. Erlaubte Attribute sind {0} oder Attribute aus einem anderen Namespace
+data_failures=; {0}
+token_failures=; Ausdruck {0} ist ung\u00FCltig; {1}
+missing_token=; fehlender Ausdruck; {0}
+expected_data=; erwartet werden Daten
+require_values=muss {0} gleichen
+require_qnames=muss ein QName sein, der {0} gleicht
+require_datatype=muss ein valider Datentyp vom Typ {0} sein
diff --git a/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_it.properties b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_it.properties
new file mode 100644
index 0000000..b3669e5
--- /dev/null
+++ b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_it.properties
@@ -0,0 +1,148 @@
+# This is the Italian translation of org/thaiopensource/relaxng/pattern/resources/Messages.properties file.
+# Translation by Alberto Pettarin (https://github.com/pettarin)
+#
+# The first block doesn't need to be translated for epubcheck, as @murata0204 noted in
+# https://github.com/IDPF/epubcheck/pull/472#issuecomment-58265808
+#
+# Non-unicode chars (german umlauts, etc..) must be escaped like \u00DF
+# because otherwise Jing can't parse them. (Bad UTF-8 support.)
+
+
+# Properties file specifying messages
+illegal_href_attribute=illegal \"href\" attribute
+ns_attribute_ignored=\"ns\" attribute ignored
+reference_to_undefined=reference to undefined pattern \"{0}\"
+missing_start_element=missing \"start\" element
+recursive_reference=bad recursive reference to pattern \"{0}\"
+recursive_include=recursive inclusion of URL \"{0}\"
+duplicate_define=multiple definitions of \"{0}\" without \"combine\" attribute
+duplicate_start=multiple definitions of start without \"combine\" attribute
+conflict_combine_define=conflicting values of \"combine\" attribute for definition of \"{0}\"
+conflict_combine_start=conflicting values of \"combine\" attribute for definition of start
+missing_start_replacement=\"start\" in \"include\" does not override anything
+missing_define_replacement=definition of \"{0}\" in \"include\" does not override anything
+interleave_string=interleave of \"string\" or \"data\" element
+group_string=group of \"string\" or \"data\" element
+one_or_more_string=repeat of \"string\" or \"data\" element
+unrecognized_datatype=datatype \"{1}\" from library \"{0}\" not recognized
+unsupported_datatype_detail=datatype \"{1}\" from library \"{0}\" not supported: {2}
+unrecognized_datatype_library=datatype library \"{0}\" not recognized
+unrecognized_builtin_datatype=no such builtin datatype \"{0}\": must be \"string\" or \"token\"
+invalid_value=\"{0}\" is not a valid value of the datatype
+parent_ref_outside_grammar=reference to non-existent parent grammar
+ref_outside_grammar=reference to non-existent grammar
+expected_one_name_class=found \"{0}\" element but expected no further content
+builtin_param=builtin datatypes do not have any parameters
+invalid_param_display=invalid parameter:\n{0}
+invalid_param_detail_display=invalid parameter: {0}:\n{1}
+display_param={0}>>>>{1}
+invalid_param_detail=invalid parameter: {0}
+invalid_param=invalid parameter
+invalid_params_detail=invalid parameters: {0}
+invalid_params=invalid parameters
+datatype_requires_parameter=datatype cannot be used without parameters
+datatype_requires_parameter_detail=datatype cannot be used without parameters: {0}
+
+attribute_contains_attribute=an attribute pattern must not contain an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path attribute//attribute)
+attribute_contains_element=an attribute pattern must not contain an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path attribute//ref)
+data_except_contains_attribute=a data pattern must not exclude an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//attribute)
+data_except_contains_element=a data pattern must not exclude an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//ref)
+data_except_contains_empty=a data pattern must not exclude an empty pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//empty)
+data_except_contains_group=a data pattern must not exclude a group (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//group)
+data_except_contains_interleave=a data pattern must not exclude an interleaved group (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//interleave)
+data_except_contains_list=a data pattern must not exclude a list pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//list)
+data_except_contains_one_or_more=a data pattern must not exclude a repetition (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//oneOrMore)
+data_except_contains_text=a data pattern must not exclude a text pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path data/except//text)
+list_contains_attribute=a list pattern must not contain an attribute pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//attribute)
+list_contains_element=a list pattern must not contain an element pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//ref)
+list_contains_list=a list pattern must not contain a list pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//list)
+list_contains_text=a list pattern must not contain a text pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//text)
+list_contains_interleave=a list pattern must not contain an interleave pattern (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path list//interleave)
+one_or_more_contains_group_contains_attribute=a group of attributes must not be repeatable (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path oneOrMore//group//attribute)
+one_or_more_contains_interleave_contains_attribute=an interleaved group of attributes must not be repeatable (section 7.1 of the RELAX NG specification requires that the simplified XML form of the schema not contain any elements matching the path oneOrMore//interleave//attribute)
+start_contains_attribute=found element matching the prohibited path start//attribute in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_data=found element matching the prohibited path start//data in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_empty=found element matching the prohibited path start//empty in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_group=found element matching the prohibited path start//group in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_interleave=found element matching the prohibited path start//interleave in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_list=found element matching the prohibited path start//list in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_one_or_more=found element matching the prohibited path start//oneOrMore in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_text=found element matching the prohibited path start//text in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+start_contains_value=found element matching the prohibited path start//value in the simplified XML form of the schema (see section 7.1 of the RELAX NG specification)
+duplicate_attribute=duplicate attribute
+duplicate_attribute_name=duplicate attribute {0}
+duplicate_attribute_ns=attributes from namespace \"{0}\" can occur more than once
+interleave_element_overlap=overlapping element names in operands of \"interleave\"
+interleave_element_overlap_name=the element {0} can occur in more than one operand of \"interleave\"
+interleave_element_overlap_ns=elements from namespace \"{0}\" can occur in more than one operand of \"interleave\"
+interleave_text_overlap=both operands of \"interleave\" contain \"text\"
+open_name_class_not_repeated=attribute using \"nsName\" or \"anyName\" must be in \"oneOrMore\"
+xmlns_uri_attribute=attribute must not have namespace URI \"http://www.w3.org/2000/xmlns\"
+xmlns_attribute=attribute must not be named \"xmlns\"
+
+# Validation errors
+unknown_element=elemento {0} non ammesso in questo punto {1}
+unexpected_element_required_element_missing=elemento {0} non ammesso in questo punto, richiesto: {1}
+unexpected_element_required_elements_missing=elemento {0} non ammesso in questo punto, richiesti: {1}
+element_not_allowed_yet=elemento {0} non ammesso in questo punto {1}
+out_of_context_element=elemento {0} non ammesso in questo punto {1}
+no_attributes_allowed=trovato attributo {0}, non permesso in questo punto
+invalid_attribute_name=trovato attributo {0}, non permesso per l''elemento {1}
+invalid_attribute_value=valore {1} dell''attributo {0} non valido
+required_attributes_missing_expected=l''elemento {0} non ha i seguenti attributi obbligatori: {1}
+required_attribute_missing=l''elemento {0} non ha l''attributo obbligatorio {1}
+required_attributes_missing=l''elemento {0} non ha i seguenti attributi obbligatori: {1}
+incomplete_element_required_elements_missing_expected=elemento {0} non completo: mancano gli elementi figli obbligatori {1}
+incomplete_element_required_element_missing=elemento {0} non completo: manca l''elemento figlio obbligatorio {1}
+incomplete_element_required_elements_missing=elemento {0} non completo: mancano gli elementi figli obbligatori {1}
+text_not_allowed=testo non ammesso in questo punto {0}
+document_incomplete=il documento pare incompleto
+invalid_element_value=valore {1} dell''elemento {0} non valido
+blank_not_allowed=l''elemento {0} deve avere un valore non nullo {1}
+schema_allows_nothing=lo schema non ammette un elemento in questo punto (<notAllowed/>)
+
+# ID correctness errors
+id_element_name_class=an \"element\" pattern containing an \"attribute\" pattern with a non-null ID-type must have a name class that contains only \"choice\" and \"name\" elements
+id_attribute_name_class=an \"attribute\" pattern with a non-null ID-type must have a name class that is a single name
+id_parent=a \"data\" or \"value\" pattern with non-null ID-type must occur as the child of an \"attribute\" pattern
+id_type_conflict=conflicting ID-types for attribute {1} of element {0}
+
+# ID soundness errors
+id_no_tokens=il valore dell''attributo non contiene un id valido
+id_multiple_tokens=il valore dell''attributo contiene molteplici id
+idref_no_tokens=il valore dell''attributo non contiene un id valido
+idref_multiple_tokens=il valore dell''attributo contiene molteplici id
+idrefs_no_tokens=il valore dell''attributo non contiene un id valido
+missing_id=l''idref \"{0}\" non contiene un id valido
+duplicate_id=id \"{0}\" gia'' definito
+first_id=prima occorrenza dell''id \"{0}\"
+
+# Fragment
+name_absent_namespace=\"{0}\"
+name_with_namespace=\"{1}\" dal namespace \"{0}\"
+qname=\"{0}\"
+qnames_nsdecls={0} (con {1})
+or_list_pair={0} o {1}
+or_list_many_first={0}
+or_list_many_middle={0}, {1}
+or_list_many_last={0} o {1}
+and_list_pair={0} e {1}
+and_list_many_first={0}
+and_list_many_middle={0}, {1}
+and_list_many_last={0} e {1}
+
+expected=. Atteso {0}
+element_end_tag=tag di chiusura dell''elemento
+text=testo
+data=data
+element_list=elemento {0}
+element_other_ns=un elemento di un altro namespace
+expected_attribute=. Ammesso solo l''attributo {0}
+expected_attribute_or_other_ns=. Ammesso attributo {0} o attributi di un altro namespace
+data_failures=; {0}
+token_failures=; espressione non valida {0}; {1}
+missing_token=; token mancante; {0}
+expected_data=; attesa una data
+require_values=deve essere {0}
+require_qnames=deve essere un nome qualificato (QName) come {0}
+require_datatype=deve essere una data valida di tipo {0}
diff --git a/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties
index 7effe39..4f20c82 100644
--- a/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties
+++ b/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties
@@ -1,6 +1,6 @@
# Copyright (c) 2013 JEPA (Japan Electronic Publishing Association).
#
-# This is Japanese translation of org/thaiopensource/relaxng/pattern/resources/Messages.propeerties file.
+# This is Japanese translation of org/thaiopensource/relaxng/pattern/resources/Messages.properties file.
# Original resources: http://info.jepa.or.jp/document/epubcheckj
# Properties file specifying messages
diff --git a/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages.properties b/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages.properties
new file mode 100644
index 0000000..b52d791
--- /dev/null
+++ b/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages.properties
@@ -0,0 +1,11 @@
+unexpected_schema_creation_error=could not create schema (please file a bug report)
+# these messages are used in schematron.xsl
+extends_cycle=cannot extend rule \"{0}\" because the extends chain has a cycle
+active_missing=cannot activate non-existent pattern \"{0}\"
+extends_missing=cannot extend non-existent rule \"{0}\"
+extends_concrete=cannot extend rule \"{0}\" because it is not abstract
+phase_missing=the schema does not define a phase \"{0}\"
+default_phase_missing=the schema does not define its default phase \"{0}\"
+diagnostic_missing=reference to non-existent diagnostic \"{0}\"
+report=
+failed_assertion=
diff --git a/src/main/resources/org/idpf/epubcheck/util/css/messages_de.properties b/src/main/resources/org/idpf/epubcheck/util/css/messages_de.properties
new file mode 100644
index 0000000..2d257dc
--- /dev/null
+++ b/src/main/resources/org/idpf/epubcheck/util/css/messages_de.properties
@@ -0,0 +1,20 @@
+css.scanner.token.syntax=Ungültige Syntax syntax "{0}"
+css.scanner.token.syntax.char=Das Zeichen "{0}" ist in folgendem Ausdruck nicht erlaubt: "{1}"
+css.scanner.token.syntax.firstChar=Das Zeichen "{0}" ist an erster Stelle des folgenden Ausdrucks nicht erlaubt: "{1}"
+css.scanner.token.syntax.escape=Ungültige Escape-Sequenz "{0}"
+css.scanner.token.syntax.urange=Ungültiger Unicode-Bereich-Ausdruck "{0}"
+css.scanner.prematureEOF=Vorzeitiges Ende der CSS-Datei.
+
+css.grammar.prematureEOF=Vorzeitiges Ende der CSS-Datei. Erwartet wird {0}
+css.grammar.token.unexpected=Die Zeichenkette "{0}" ist an dieser Stelle nicht erlaubt.
+css.grammar.token.expecting=Die Zeichenkette "{0}" ist an dieser Stelle nicht erlaubt. Erwartet wird {1}
+css.grammar.invalidSelector=Ungültiger Selektor: "{0}"
+
+or=oder
+a_property_name=eine CSS-Eigenschaft
+a_property_value=ein Eigenschaftswert
+a_type_or_universal_selector=ein Typ- oder Universal-Selektor
+a_string_or_dentifier=ein String oder eine ID
+an_attribute_value_matcher=ein Ausdruck der auf den Attributwert matcht
+negation_arguments=Argumente der not()-Funktion
+a_selectors=ein Selektor
diff --git a/src/main/resources/org/idpf/epubcheck/util/css/messages_it.properties b/src/main/resources/org/idpf/epubcheck/util/css/messages_it.properties
new file mode 100644
index 0000000..4453d5d
--- /dev/null
+++ b/src/main/resources/org/idpf/epubcheck/util/css/messages_it.properties
@@ -0,0 +1,20 @@
+css.scanner.token.syntax=Sintassi non valida ''{0}''
+css.scanner.token.syntax.char=Il carattere ''{0}'' non è consentito in espressioni ''{1}''
+css.scanner.token.syntax.firstChar=Il carattere ''{0}'' non è consentito come primo carattere di espressioni ''{1}''
+css.scanner.token.syntax.escape=Sequenza di escape non valida ''{0}''
+css.scanner.token.syntax.urange=Intervallo Unicode non valido ''{0}''
+css.scanner.prematureEOF=Fine prematura del file
+
+css.grammar.prematureEOF=Fine prematura della grammatica (atteso: {0})
+css.grammar.token.unexpected=Parola ''{0}'' non consentita in questo punto
+css.grammar.token.expecting=Parola ''{0}'' non consentita in questo punto, (attesa: {1})
+css.grammar.invalidSelector=Selettore non valido: ''{0}''
+
+or=o
+a_property_name=un nome di proprietà
+a_property_value=un valore di proprietà
+a_type_or_universal_selector=un tipo o un selettore universale
+a_string_or_dentifier=una stringa o un identificatore
+an_attribute_value_matcher=un simbolo di valore di attributo
+negation_arguments=argomenti per una funzione di negazione
+a_selectors=un selettore
diff --git a/src/test/java/com/adobe/epubcheck/api/AbstractEpubCheckTest.java b/src/test/java/com/adobe/epubcheck/api/AbstractEpubCheckTest.java
index 2b552df..580edea 100644
--- a/src/test/java/com/adobe/epubcheck/api/AbstractEpubCheckTest.java
+++ b/src/test/java/com/adobe/epubcheck/api/AbstractEpubCheckTest.java
@@ -22,68 +22,89 @@
package com.adobe.epubcheck.api;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.opf.DocumentValidator;
-import com.adobe.epubcheck.util.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.junit.Before;
+
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.DocumentValidator;
+import com.adobe.epubcheck.util.Archive;
+import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.util.URLResourceProvider;
+import com.adobe.epubcheck.util.ValidationReport;
+import com.adobe.epubcheck.util.outWriter;
public abstract class AbstractEpubCheckTest
{
-
private String basepath;
+ List<MessageId> expectedWarnings = new LinkedList<MessageId>();
+ List<MessageId> expectedErrors = new LinkedList<MessageId>();
+ List<MessageId> expectedFatals = new LinkedList<MessageId>();
protected AbstractEpubCheckTest(String basepath)
{
this.basepath = basepath;
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings)
+ public void testValidateDocument(String fileName)
+ {
+ testValidateDocument(fileName, false);
+ }
+
+ public void testValidateDocument(String fileName, boolean verbose)
{
- testValidateDocument(fileName, errors, warnings, new ArrayList<MessageId>(), false);
+ testValidateDocument(fileName, null, null, verbose);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors)
+ public void testValidateDocument(String fileName, EPUBProfile profile)
{
- testValidateDocument(fileName, errors, warnings, fatalErrors, false);
+ testValidateDocument(fileName, profile, false);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors,
- boolean verbose)
+ public void testValidateDocument(String fileName, EPUBProfile profile, boolean verbose)
{
- testValidateDocument(fileName, errors, warnings, fatalErrors, null, verbose);
+ testValidateDocument(fileName, null, profile, verbose);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, String resultFile)
+ public void testValidateDocument(String fileName, String resultFile)
{
- testValidateDocument(fileName, errors, warnings, new ArrayList<MessageId>(), resultFile, false);
+ testValidateDocument(fileName, resultFile, null, false);
}
- static ValidationReport savedReport;
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, String resultFile, boolean verbose)
+ public void testValidateDocument(String fileName, String resultFile, boolean verbose)
{
+ testValidateDocument(fileName, resultFile, EPUBProfile.DEFAULT, verbose);
+ }
+
+ public void testValidateDocument(String fileName, String resultFile, EPUBProfile profile,
+ boolean verbose)
+ {
+ EPUBProfile validationProfile = profile == null ? EPUBProfile.DEFAULT : profile;
DocumentValidator epubCheck;
- outWriter.printf("Starting testValidateDocument('%s')\n", fileName);
ValidationReport testReport;
if (fileName.startsWith("http://") || fileName.startsWith("https://"))
{
GenericResourceProvider resourceProvider = new URLResourceProvider(fileName);
try
{
- testReport = savedReport = new ValidationReport(fileName);
- epubCheck = new EpubCheck(
- resourceProvider.getInputStream(null), testReport, fileName);
- }
- catch (IOException e)
+ testReport = new ValidationReport(fileName);
+ epubCheck = new EpubCheck(resourceProvider.getInputStream(null), testReport, fileName,
+ validationProfile);
+ } catch (IOException e)
{
throw new RuntimeException(e);
}
@@ -96,26 +117,24 @@ public abstract class AbstractEpubCheckTest
URL url = this.getClass().getResource(basepath + fileName);
URI uri = url.toURI();
testFile = new File(uri);
- }
- catch (URISyntaxException e)
+ } catch (URISyntaxException e)
{
throw new IllegalStateException("Cannot find test file", e);
}
if (testFile.isDirectory())
{
Archive epub = new Archive(testFile.getPath());
- testReport = savedReport = new ValidationReport(epub.getEpubName());
+ testReport = new ValidationReport(epub.getEpubName());
epub.createArchive();
- epubCheck = new EpubCheck(epub.getEpubFile(), testReport);
+ epubCheck = new EpubCheck(epub.getEpubFile(), testReport, validationProfile);
}
else
{
- testReport = savedReport = new ValidationReport(fileName);
- epubCheck = new EpubCheck(new File(testFile.getPath()), testReport);
+ testReport = new ValidationReport(fileName);
+ epubCheck = new EpubCheck(new File(testFile.getPath()), testReport, validationProfile);
}
}
-
epubCheck.validate();
if (verbose)
@@ -123,9 +142,12 @@ public abstract class AbstractEpubCheckTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", IdsToListOfString(errors), IdsToListOfString(testReport.getErrorIds()));
- assertEquals("The warning results do not match", IdsToListOfString(warnings), IdsToListOfString(testReport.getWarningIds()));
- assertEquals("The fatal error results do not match", IdsToListOfString(fatalErrors), IdsToListOfString(testReport.getFatalErrorIds()));
+ assertEquals("The error results do not match", IdsToListOfString(expectedErrors),
+ IdsToListOfString(testReport.getErrorIds()));
+ assertEquals("The warning results do not match", IdsToListOfString(expectedWarnings),
+ IdsToListOfString(testReport.getWarningIds()));
+ assertEquals("The fatal error results do not match", IdsToListOfString(expectedFatals),
+ IdsToListOfString(testReport.getFatalErrorIds()));
if (resultFile != null)
{
@@ -134,8 +156,7 @@ public abstract class AbstractEpubCheckTest
try
{
f = new File(fileURL.toURI());
- }
- catch (URISyntaxException e)
+ } catch (URISyntaxException e)
{
throw new IllegalStateException("Cannot find test file", e);
}
@@ -143,8 +164,7 @@ public abstract class AbstractEpubCheckTest
BufferedReader in = null;
try
{
- in = new BufferedReader(
- new InputStreamReader(new FileInputStream(f), "utf-8"));
+ in = new BufferedReader(new InputStreamReader(new FileInputStream(f), "utf-8"));
String line;
while ((line = in.readLine()) != null)
{
@@ -153,27 +173,25 @@ public abstract class AbstractEpubCheckTest
assertTrue(line + " not found", testReport.hasInfoMessage(line));
}
}
- }
- catch (IOException e)
+ } catch (IOException e)
{ /* IGNORE */
- }
- finally
+ } finally
{
if (in != null)
{
try
{
in.close();
+ } catch (IOException e)
+ { /* IGNORE */
}
- catch (IOException e)
- { /* IGNORE */ }
}
}
}
- outWriter.printf("Completed testValidateDocument('%s')\n", fileName);
}
private final static String messageName = MessageId.class.getSimpleName();
+
private static List<String> IdsToListOfString(List<MessageId> ids)
{
if (ids != null && ids.size() > 0)
@@ -188,4 +206,12 @@ public abstract class AbstractEpubCheckTest
}
return new ArrayList<String>(0);
}
+
+ @Before
+ public void setup()
+ {
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
+ }
}
diff --git a/src/test/java/com/adobe/epubcheck/api/Epub20CheckExpandedTest.java b/src/test/java/com/adobe/epubcheck/api/Epub20CheckExpandedTest.java
index 1fbf127..e734e50 100644
--- a/src/test/java/com/adobe/epubcheck/api/Epub20CheckExpandedTest.java
+++ b/src/test/java/com/adobe/epubcheck/api/Epub20CheckExpandedTest.java
@@ -22,9 +22,7 @@
package com.adobe.epubcheck.api;
-import java.util.ArrayList;
import java.util.Collections;
-import java.util.List;
import org.junit.Test;
@@ -33,7 +31,6 @@ import com.adobe.epubcheck.messages.MessageId;
public class Epub20CheckExpandedTest extends AbstractEpubCheckTest
{
-
public Epub20CheckExpandedTest()
{
super("/20/expanded/");
@@ -42,121 +39,131 @@ public class Epub20CheckExpandedTest extends AbstractEpubCheckTest
@Test
public void testValidateEPUBPLoremBasic()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem/lorem-basic", expectedErrors, expectedWarnings, "valid/lorem/lorem-basic.txt");
+ testValidateDocument("valid/lorem/lorem-basic", "valid/lorem/lorem-basic.txt");
}
@Test
public void testValidateEPUBMimetype()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.PKG_007, MessageId.OPF_022, MessageId.PKG_007, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-mimetype", expectedErrors, expectedWarnings, "invalid/lorem-mimetype.txt");
+ Collections.addAll(expectedErrors, MessageId.PKG_007);
+ testValidateDocument("invalid/lorem-mimetype", "invalid/lorem-mimetype.txt");
+ }
+
+ @Test
+ public void testValidateEPUBBadPathInNCX()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/lorem-ncx-badpath");
}
@Test
public void testValidateEPUBUidSpaces()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //ascertain that leading/trailing space in 2.0 id values is accepted
- //issue 163
- testValidateDocument("valid/lorem-uidspaces", expectedErrors, expectedWarnings, "valid/lorem-uidspaces.txt");
+ // ascertain that leading/trailing space in 2.0 id values is accepted
+ // issue 163
+ testValidateDocument("valid/lorem-uidspaces", "valid/lorem-uidspaces.txt");
}
@Test
public void testValidateEPUB20_circularFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045, MessageId.MED_003);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/fallbacks-circular/", expectedErrors, expectedWarnings, "invalid/fallbacks-circular.txt");
+ Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045,
+ MessageId.OPF_045, MessageId.MED_003);
+ testValidateDocument("invalid/fallbacks-circular/", "invalid/fallbacks-circular.txt");
+ }
+
+ @Test
+ public void testValidateEPUB20_nonResolvingFallback()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_040, MessageId.MED_003);
+ testValidateDocument("invalid/fallbacks-nonresolving/");
}
@Test
public void testValidateEPUB20_okFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/fallbacks/", expectedErrors, expectedWarnings, "valid/fallbacks.txt");
+ testValidateDocument("valid/fallbacks/", "valid/fallbacks.txt");
}
@Test
public void testValidateEPUB20_loremBasicDual()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-basic-dual/", expectedErrors, expectedWarnings, "valid/lorem-basic-dual.txt");
+ testValidateDocument("valid/lorem-basic-dual/", "valid/lorem-basic-dual.txt");
}
@Test
public void testValidateEPUB20_guideWithNcx()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_032);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-dual-guide/", expectedErrors, expectedWarnings, "valid/lorem-dual-guide.txt");
+ testValidateDocument("valid/lorem-dual-guide/", "valid/lorem-dual-guide.txt");
}
@Test
public void testValidateEPUB20_guideBrokenLink()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_032, MessageId.OPF_031, MessageId.RSC_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-dual-guide/", expectedErrors, expectedWarnings, "invalid/lorem-dual-guide.txt");
+ testValidateDocument("invalid/lorem-dual-guide/", "invalid/lorem-dual-guide.txt");
}
@Test
public void testValidateEPUB20_customNsAttr()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/custom-ns-attr/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/custom-ns-attr/");
}
@Test
public void testValidateEPUB20_issue205()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue205/", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/issue205/");
}
@Test
public void testValidateEPUB20_issue182()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_034);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //repeated spine items
- testValidateDocument("invalid/issue182/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testValidateEPUB20_issue256() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- // Ignore .DS_Store, ._DS_Store, Thumbs.db, ehthumbs.db, .svn/, .git/ files in expanded mode. Valid EPUB expected.
- testValidateDocument("valid/issue256/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testValidateEPUB20_issue267() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue267/", expectedErrors, expectedWarnings, "valid/issue267.txt");
- }
-
+ // repeated spine items
+ testValidateDocument("invalid/issue182/");
+ }
+
+ @Test
+ public void testValidateEPUB20_issue256()
+ {
+ // Ignore .DS_Store, ._DS_Store, Thumbs.db, ehthumbs.db, .svn/, .git/ files
+ // in expanded mode. Valid EPUB expected.
+ testValidateDocument("valid/issue256/");
+ }
+
+ @Test
+ public void testValidateEPUB20_issue267()
+ {
+ testValidateDocument("valid/issue267/", "valid/issue267.txt");
+ }
+
+ @Test
+ public void testIssue332()
+ {
+ testValidateDocument("valid/issue332-idspaces");
+ }
+
+ @Test
+ public void testIssue329_IDSpaces()
+ {
+ // expectedWarnings.add(MessageId.NCX_004); // Now USAGE
+ testValidateDocument("invalid/ncx-uid-spaces");
+ }
+
+ @Test
+ public void testIssue329_NonMatchingId()
+ {
+ // expectedWarnings.add(MessageId.NCX_001); // Now USAGE
+ testValidateDocument("invalid/ncx-uid-nomatch");
+ }
+
@Test
public void testXHTMLExtension()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.HTM_014);
- testValidateDocument("invalid/xhtml-extension", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/xhtml-extension");
}
}
diff --git a/src/test/java/com/adobe/epubcheck/api/Epub20CheckTest.java b/src/test/java/com/adobe/epubcheck/api/Epub20CheckTest.java
index 0b3f212..8872fe8 100644
--- a/src/test/java/com/adobe/epubcheck/api/Epub20CheckTest.java
+++ b/src/test/java/com/adobe/epubcheck/api/Epub20CheckTest.java
@@ -42,277 +42,220 @@ public class Epub20CheckTest extends AbstractEpubCheckTest
@Test
public void testValidateEPUBvalid20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem.epub", expectedErrors, expectedWarnings, "valid/lorem.txt");
+ testValidateDocument("valid/lorem.epub", "valid/lorem.txt");
}
@Test
public void testValidateEPUBInvalid20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.PKG_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-mimetype.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-mimetype.epub");
}
@Test
public void testValidateEPUBPageMap20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("PageMap20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("PageMap20.epub");
}
@Test
public void testValidateEPUBNoUniqueId20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.OPF_030);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("OPFIllegalElement_UniqueID20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("OPFIllegalElement_UniqueID20.epub");
}
@Test
public void testValidateEPUBOPFIllegalElement20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("OPFIllegalElement20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("OPFIllegalElement20.epub");
}
@Test
public void testValidateEPUBUnmanifested20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055, MessageId.OPF_003, MessageId.OPF_003);
- testValidateDocument("Unmanifested20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("Unmanifested20.epub");
}
@Test
public void testValidateEPUBPFileDeclaredInContainerNotOpf20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ContainerNotOPF20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("ContainerNotOPF20.epub");
}
@Test
public void testValidateEPUBFileInMetaInfIgnored()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("MetaInfNotOPF20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("MetaInfNotOPF20.epub");
}
@Test
public void testValidateEPUBNullDate20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_054);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("NullDate20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("NullDate20.epub");
}
@Test
public void testValidateEPUBNon8601Date20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_054);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("Non8601Date20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("Non8601Date20.epub");
}
@Test
public void testValidateEPUBUnmanifestedGuideItems20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_031, MessageId.RSC_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("UnmanifestedGuideItems20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("UnmanifestedGuideItems20.epub");
}
@Test
public void testValidateEPUBEmptyDir20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055, MessageId.PKG_014);
- testValidateDocument("EmptyDir20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("EmptyDir20.epub");
}
@Test
public void testValidateEPUBPvalid20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("Test20.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("Test20.epub");
}
@Test
public void testValidateEPUBPNoRootFiles()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_024, MessageId.RSC_003);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatalErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedFatalErrors, MessageId.OPF_019);
- testValidateDocument("/invalid/no-rootfile.epub", expectedErrors, expectedWarnings, expectedFatalErrors);
+ Collections.addAll(expectedErrors, MessageId.RSC_003);
+ Collections.addAll(expectedFatals, MessageId.OPF_019);
+ testValidateDocument("/invalid/no-rootfile.epub");
}
@Test
public void testValidateEPUBPBadOpfNamespace()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_024, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.OPF_030);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.OPF_030);
Collections.addAll(expectedWarnings, MessageId.OPF_003, MessageId.OPF_003);
- List<MessageId> expectedFatalErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedFatalErrors, MessageId.OPF_019);
- testValidateDocument("/invalid/bad_opf_namespace.epub", expectedErrors, expectedWarnings, expectedFatalErrors);
+ Collections.addAll(expectedFatals, MessageId.OPF_019);
+ testValidateDocument("/invalid/bad_opf_namespace.epub");
}
@Test
public void testValidateEPUB_mimetypeAndVersion()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.PKG_006, MessageId.OPF_024, MessageId.OPF_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatalErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedFatalErrors, MessageId.OPF_019);
- testValidateDocument("/invalid/mimetypeAndVersion.epub", expectedErrors, expectedWarnings, expectedFatalErrors);
+ Collections.addAll(expectedErrors, MessageId.PKG_006, MessageId.OPF_001);
+ Collections.addAll(expectedFatals, MessageId.OPF_019);
+ testValidateDocument("/invalid/mimetypeAndVersion.epub");
}
@Test
public void testValidateEPUB_noLinearYes()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_033);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_003, MessageId.OPF_003, MessageId.OPF_003);
//+ 3 warnings that don't relate to linear
- testValidateDocument("/invalid/no-linear-yes.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("/invalid/no-linear-yes.epub");
}
@Test
public void testValidateEPUB_unusedImages()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_031, MessageId.RSC_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_003, MessageId.PKG_010, MessageId.OPF_003, MessageId.OPF_003, MessageId.PKG_010, MessageId.OPF_003);
//4 unused images in subfolder
- testValidateDocument("/invalid/issue89.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("/invalid/issue89.epub");
}
@Test
public void testValidateEPUB_issue138()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
//warning for empty dc:title
- testValidateDocument("/invalid/issue138.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("/invalid/issue138.epub");
}
@Test
public void testValidateEPUB_ncxDupeID()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("/invalid/ncx-dupe-id.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("/invalid/ncx-dupe-id.epub");
}
@Test
public void testValidateEPUB_unresolvedInternalLink()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_012);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("/invalid/unresolved-internal-xhtml-link.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("/invalid/unresolved-internal-xhtml-link.epub");
}
@Test
public void testValidateEPUBvalidIssue169()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue169.epub", expectedErrors, expectedWarnings, "valid/issue169.txt");
+ testValidateDocument("valid/issue169.epub", "valid/issue169.txt");
}
@Test // STA - This test LOCKS UP!!!!
public void testValidateEPUBvalidIssue194_1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.HTM_009);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue194.bad.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/issue194.bad.epub");
}
@Test
public void testValidateEPUBvalidIssue194_2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue194.good.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/issue194.good.epub");
}
@Test
public void testValidateEPUB30Issue170()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_032);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
//ncx references not allowed in guide
- testValidateDocument("invalid/issue170.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue170.epub");
}
@Test
public void testMissingFullpathAttributeIssue236() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_001, MessageId.OPF_017, MessageId.OPF_016);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> fatalErrors = new ArrayList<MessageId>();
+ Collections.addAll(expectedErrors, MessageId.OPF_017, MessageId.OPF_016);
+ List<MessageId> expectedFatals = new ArrayList<MessageId>();
//container.xml missing @full-path attribute or @full-path is empty
// issue 95 / issue 236
- testValidateDocument("invalid/issue236.epub", expectedErrors, expectedWarnings, fatalErrors);
+ testValidateDocument("invalid/issue236.epub");
}
@Test
public void testFilenameContainsSpacesIssue239() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.PKG_010);
- testValidateDocument("invalid/filenameSpacesErrorTwice_Issue239.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/filenameSpacesErrorTwice_Issue239.epub");
}
@Test
public void testNcxIdIssue313() {
// ID syntax in NCX files should be checked
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/issue313.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue313.epub");
+ }
+
+ @Test
+ public void testNcxIdEmptyLabel() {
+ testValidateDocument("valid/issue301-ncx-empty-label.epub");
}
@Test
public void testLinkedStylesheetCaseInsensitiveIssue316() {
// rel="stylesheet" must be checked case-insensitive
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/issue316.epub", expectedErrors, expectedWarnings);
- List<MessageId> fatalErrors = new ArrayList<MessageId>();
- testValidateDocument("invalid/issue316.epub", expectedErrors, expectedWarnings, fatalErrors);
+ Collections.addAll(expectedErrors, MessageId.RSC_007);
+ testValidateDocument("invalid/issue316.epub");
}
}
diff --git a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java
index c9404c8..13104bb 100644
--- a/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java
+++ b/src/test/java/com/adobe/epubcheck/api/Epub30CheckExpandedTest.java
@@ -22,9 +22,7 @@
package com.adobe.epubcheck.api;
-import java.util.ArrayList;
import java.util.Collections;
-import java.util.List;
import org.junit.Test;
@@ -33,7 +31,6 @@ import com.adobe.epubcheck.messages.MessageId;
public class Epub30CheckExpandedTest extends AbstractEpubCheckTest
{
-
public Epub30CheckExpandedTest()
{
super("/30/expanded/");
@@ -42,666 +39,966 @@ public class Epub30CheckExpandedTest extends AbstractEpubCheckTest
@Test
public void testValidateEPUBPLoremBasic()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-basic", expectedErrors, expectedWarnings, "valid/lorem-basic.txt");
+ testValidateDocument("valid/lorem-basic", "valid/lorem-basic.txt");
}
@Test
- public void testValidateEPUBPLoremMultipleRenditions()
+ public void testDuplicateID()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-xrenditions", expectedErrors, expectedWarnings);
+ // 2 errors x 2 sets of duplicate IDs
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("invalid/duplicate-id");
}
@Test
public void testValidateEPUBPLoremMultipleRenditionsUnmanifested()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- Collections.addAll(expectedWarnings, MessageId.OPF_003);
- testValidateDocument("invalid/lorem-xrenditions-unmanifested", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedWarnings, MessageId.RSC_019, MessageId.RSC_017, MessageId.OPF_003);
+ testValidateDocument("invalid/lorem-xrenditions-unmanifested");
}
@Test
public void testValidateEPUBWastelandBasic()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/wasteland-basic", expectedErrors, expectedWarnings, "valid/wasteland-basic.txt");
+ testValidateDocument("valid/wasteland-basic", "valid/wasteland-basic.txt");
}
@Test
public void testValidateEPUBLoremAudio()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- Collections.addAll(expectedWarnings, MessageId.OPF_056);
- testValidateDocument("valid/lorem-audio", expectedErrors, expectedWarnings, "valid/lorem-audio.txt");
+ testValidateDocument("valid/lorem-audio", "valid/lorem-audio.txt");
}
@Test
public void testValidateEPUBLoremxhtmlrng1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-xhtml-rng-1", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-xhtml-rng-1");
}
@Test
public void testValidateEPUBLoremxhtmlsch1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-xhtml-sch-1", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-xhtml-sch-1");
}
@Test
public void testValidateEPUBPLoremBasicMathml()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-basic-mathml", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/lorem-basic-mathml");
}
-
+
@Test
public void testValidateEPUBPMathmlNoAlt()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.ACC_009);
- testValidateDocument("invalid/lorem-mathml-noalt", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-mathml-noalt");
}
@Test
public void testValidateEPUBPLoremMimetype()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.PKG_007, MessageId.PKG_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-mimetype", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.PKG_007);
+ testValidateDocument("invalid/lorem-mimetype");
}
@Test
public void testValidateEPUBPLoremMimetype2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.PKG_007, MessageId.PKG_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-mimetype-2", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.PKG_007);
+ testValidateDocument("invalid/lorem-mimetype-2");
}
@Test
public void testValidateEPUBPLoremBasicSwitch()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-basic-switch", expectedErrors, expectedWarnings, "valid/lorem-basic-switch.txt");
+ testValidateDocument("valid/lorem-basic-switch", "valid/lorem-basic-switch.txt");
}
@Test
public void testValidateEPUBPLoremLink()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-link", expectedErrors, expectedWarnings, "valid/lorem-link.txt");
+ testValidateDocument("valid/lorem-link", "valid/lorem-link.txt");
}
@Test
public void testValidateEPUBPLoremForeign()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-foreign", expectedErrors, expectedWarnings, "valid/lorem-foreign.txt");
+ testValidateDocument("valid/lorem-foreign", "valid/lorem-foreign.txt");
}
@Test
public void testValidateEPUBPLoremObjectFallbacks()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-object-fallbacks", expectedErrors, expectedWarnings, "valid/lorem-object-fallbacks.txt");
+ testValidateDocument("valid/lorem-object-fallbacks", "valid/lorem-object-fallbacks.txt");
}
@Test
public void testValidateEPUBPLoremBindings()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-bindings", expectedErrors, expectedWarnings, "valid/lorem-bindings.txt");
+ testValidateDocument("valid/lorem-bindings", "valid/lorem-bindings.txt");
}
@Test
public void testValidateEPUBPLoremInvalidBindings()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.MED_002);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-bindings", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-bindings");
}
@Test
public void testValidateEPUBPLoremPoster()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-poster", expectedErrors, expectedWarnings, "valid/lorem-poster.txt");
+ testValidateDocument("valid/lorem-poster", "valid/lorem-poster.txt");
}
@Test
public void testValidateEPUBPLoremSvg()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-svg", expectedErrors, expectedWarnings, "valid/lorem-svg.txt");
+ testValidateDocument("valid/lorem-svg", "valid/lorem-svg.txt");
}
@Test
public void testValidateEPUBPLoremImage()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-image", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/lorem-image");
}
@Test
public void testValidateEPUBPLoremSvgHyperlink()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-svg-hyperlink", expectedErrors, expectedWarnings, "valid/lorem-svg-hyperlink.txt");
+ testValidateDocument("valid/lorem-svg-hyperlink", "valid/lorem-svg-hyperlink.txt");
}
-
+
@Test
public void testValidateEPUBPLoremSvgHyperlinkNoTitle()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.ACC_011);
- testValidateDocument("invalid/lorem-svg-hyperlink-notitle", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-svg-hyperlink-notitle");
+ }
+
+ @Test
+ public void testValidateEPUBPLoremIFrame()
+ {
+ testValidateDocument("valid/lorem-iframe");
}
@Test
public void testValidateEPUBPInvalidLoremPoster()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.MED_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-poster", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-poster");
}
@Test
public void testValidateEPUBPInvalidLoremForeign()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_014);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-foreign", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-foreign");
}
@Test
public void testValidateEPUB30_navInvalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-invalid/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-invalid/");
}
@Test
public void testValidateEPUB30_issue134_1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// svg in both contentdocs, opf props set right
- testValidateDocument("valid/lorem-svg-dual/", expectedErrors, expectedWarnings, "valid/lorem-svg-dual.txt");
+ testValidateDocument("valid/lorem-svg-dual/", "valid/lorem-svg-dual.txt");
}
@Test
public void testValidateEPUB30_issue134_2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_014, MessageId.OPF_014);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// svg in both contentdocs, no opf props set right
- testValidateDocument("invalid/lorem-svg-dual/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-svg-dual/");
}
@Test
public void testValidateEPUB30_issue134_3()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_014);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// svg in both contentdocs, only one opf prop set right
- testValidateDocument("invalid/lorem-svg-dual-2/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-svg-dual-2/");
}
@Test
public void testValidateEPUB30_CSSImport_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-css-import/", expectedErrors, expectedWarnings, "valid/lorem-css-import.txt");
+ testValidateDocument("valid/lorem-css-import/", "valid/lorem-css-import.txt");
}
@Test
public void testValidateEPUB30_CSSImport_invalid_1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_001, MessageId.RSC_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-css-import-1/", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.RSC_001);
+ testValidateDocument("invalid/lorem-css-import-1/");
}
@Test
public void testValidateEPUB30_CSSImport_invalid_2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_008);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_003);
- testValidateDocument("invalid/lorem-css-import-2/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-css-import-2/");
}
@Test
public void testValidateEPUB30_CSSURLS_1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //'imgs/table_header_bg_uni.jpg': referenced resource missing in the package
- testValidateDocument("invalid/lorem-css-urls-1/", expectedErrors, expectedWarnings);
+ // 'imgs/table_header_bg_uni.jpg': referenced resource missing in the
+ // package
+ testValidateDocument("invalid/lorem-css-urls-1/");
}
@Test
public void testValidateEPUB30_CSSURLS_2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_027);
- //'imgs/table_header_bg_uni.jpg': referenced resource missing in the package
- testValidateDocument("invalid/lorem-css-urls-2/", expectedErrors, expectedWarnings);
+ // 'imgs/table_header_bg_uni.jpg': referenced resource missing in the
+ // package
+ testValidateDocument("invalid/lorem-css-urls-2/");
}
@Test
public void testValidateEPUB30_CSSURLS_3()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.CSS_017);
- //'imgs/table_header_bg_uni.jpg': referenced resource missing in the package
- testValidateDocument("invalid/lorem-css-urls-3/", expectedErrors, expectedWarnings);
+ // 'imgs/table_header_bg_uni.jpg': referenced resource missing in the
+ // package
+ testValidateDocument("invalid/lorem-css-urls-3/");
}
@Test
public void testValidateEPUB30_CSSFontFace_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/wasteland-otf/", expectedErrors, expectedWarnings, "valid/wasteland-otf.txt");
+ testValidateDocument("valid/wasteland-otf/", "valid/wasteland-otf.txt");
}
@Test
public void testValidateEPUB30_CSSFontFace_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_001, MessageId.RSC_001, MessageId.RSC_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //referenced fonts missing
- testValidateDocument("invalid/wasteland-otf/", expectedErrors, expectedWarnings);
+ // referenced fonts missing
+ testValidateDocument("invalid/wasteland-otf/");
}
@Test
public void testValidateEPUB30_CSSEncoding_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.CSS_003);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //@charset not utf
- testValidateDocument("invalid/lorem-css-enc/", expectedErrors, expectedWarnings);
+ // @charset not utf
+ testValidateDocument("invalid/lorem-css-enc/");
}
@Test
- public void testValidateEPUB30_CSSMediaType_invalid()
+ public void testValidateEPUB30_CSSMediaType_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ Collections.addAll(expectedErrors, MessageId.CSS_010);
+ // CSS with declared type 'xhtml/css' should raise a "no fallback" error
+ testValidateDocument("invalid/lorem-css-wrongtype/");
+ }
- Collections.addAll(expectedWarnings,MessageId.CSS_010);
- //CSS with declared type 'xhtml/css' should raise a "no fallback" error
- testValidateDocument("invalid/lorem-css-wrongtype/", expectedErrors, expectedWarnings);
- }
- @Test
+ @Test
public void testValidateEPUB30_remoteAudio_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
-
-
// audio element with @src attribute
- testValidateDocument("valid/lorem-remote/", expectedErrors, expectedWarnings, "valid/lorem-remote.txt");
+ testValidateDocument("valid/lorem-remote/", "valid/lorem-remote.txt");
}
@Test
- public void testValidateEPUB30_remoteHttpsAudio_valid()
+ public void testValidateEPUB30_remoteHttpsAudio_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
-
// remote audio element via HTTPS
- testValidateDocument("valid/lorem-remote-https/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testValidateEPUB30_remoteUrlWithQuery_valid()
- {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ testValidateDocument("valid/lorem-remote-https/");
+ }
+ @Test
+ public void testValidateEPUB30_remoteUrlWithQuery_valid()
+ {
// remote audio element via HTTPS
- testValidateDocument("valid/lorem-remote-queryurl/", expectedErrors, expectedWarnings);
- }
+ testValidateDocument("valid/lorem-remote-queryurl/");
+ }
- @Test
+ @Test
public void testValidateEPUB30_remoteAudioSources_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
-
// audio element with sources children
- testValidateDocument("valid/lorem-remote-2/", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/lorem-remote-2/");
}
@Test
public void testValidateEPUB30_remoteImg_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_006, MessageId.OPF_010);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //remote resource of invalid type (img) declared in opf
- testValidateDocument("invalid/lorem-remote/", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.RSC_006);
+ // remote resource of invalid type (img) declared in opf
+ testValidateDocument("invalid/lorem-remote/");
}
@Test
public void testValidateEPUB30_remoteImg_invalid2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_014);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //remote audio, declared in opf, but missing 'remote-resources' property
- testValidateDocument("invalid/lorem-remote-2/", expectedErrors, expectedWarnings);
+ // remote audio, declared in opf, but missing 'remote-resources' property
+ testValidateDocument("invalid/lorem-remote-2/");
}
@Test
public void testValidateEPUB30_remoteAudio_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.MED_002, MessageId.RSC_008);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //remote audio, not declared in the manifest
+ // remote audio, not declared in the manifest
// we should only get one error here:
// the "no fallback" error is extra since no type info
// can be retrieved from the manifest...
- testValidateDocument("invalid/lorem-remote-3/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-remote-3/");
}
@Test
public void testValidateEPUB30_remoteAudioSources_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.MED_002, MessageId.RSC_008, MessageId.RSC_008);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //audio element with a list of source children pointing to remote resources
+ // audio element with a list of source children pointing to remote resources
// not declared in the manifest
// we should only get two errors here:
// the "no fallback" error is extra since no type info
// can be retrieved from the manifest...
- testValidateDocument("invalid/lorem-remote-4/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-remote-4/");
}
@Test
public void testValidateEPUB30_circularFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045, MessageId.MED_003);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/fallbacks-circular/", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045,
+ MessageId.OPF_045, MessageId.MED_003);
+ testValidateDocument("invalid/fallbacks-circular/");
}
@Test
public void testValidateEPUB30_nonresolvingFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.OPF_040, MessageId.MED_003);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //dupe messages, tbf
- testValidateDocument("invalid/fallbacks-nonresolving/", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.MED_003);
+ // dupe messages, tbf
+ testValidateDocument("invalid/fallbacks-nonresolving/");
}
@Test
public void testValidateEPUB30_okFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/fallbacks/", expectedErrors, expectedWarnings, "valid/fallbacks.txt");
+ testValidateDocument("valid/fallbacks/", "valid/fallbacks.txt");
}
@Test
public void testValidateEPUB30_svgCoverImage()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/svg-cover/", expectedErrors, expectedWarnings, "valid/svg-cover.txt");
+ testValidateDocument("valid/svg-cover/", "valid/svg-cover.txt");
}
@Test
public void testValidateEPUB30_svgInSpine()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //svg in spine, svg cover image
- testValidateDocument("valid/svg-in-spine/", expectedErrors, expectedWarnings, "valid/svg-in-spine.txt");
+ // svg in spine, svg cover image
+ testValidateDocument("valid/svg-in-spine/", "valid/svg-in-spine.txt");
+ }
+
+ @Test
+ public void testValidateEPUB30_svgReferenced()
+ {
+ // svg referenced from img, object, iframe
+ testValidateDocument("valid/svg-referenced/");
}
@Test
public void testValidateEPUB30_videoAudioTrigger()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/cc-shared-culture/", expectedErrors, expectedWarnings, "valid/cc-shared-culture.txt");
+ testValidateDocument("valid/cc-shared-culture/", "valid/cc-shared-culture.txt");
}
@Test
public void testValidateEPUB30_InvalidLinks()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_007, MessageId.RSC_012, MessageId.RSC_012, MessageId.RSC_012);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
-
+ Collections.addAll(expectedErrors, MessageId.RSC_007, MessageId.RSC_012, MessageId.RSC_012,
+ MessageId.RSC_012);
/*
- * the valid counterpart is in the zipped section
- *
- * - one broken file ref in navdoc
- * - one broken frag ref in navdoc
- * - one broken internal frag ref in overview
- * - one broken crossdoc frag ref in overview
- */
+ * the valid counterpart is in the zipped section
+ *
+ * - one broken file ref in navdoc - one broken frag ref in navdoc - one
+ * broken internal frag ref in overview - one broken crossdoc frag ref in
+ * overview
+ */
- testValidateDocument("invalid/epub30-spec/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/epub30-spec/");
}
@Test
public void testValidateEPUB30_basicDual()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem-basic-dual/", expectedErrors, expectedWarnings, "valid/lorem-basic-dual.txt");
+ testValidateDocument("valid/lorem-basic-dual/", "valid/lorem-basic-dual.txt");
}
@Test
public void testValidateEPUB30_Base()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_006, MessageId.RSC_006);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //<base href set, see issue 155
- testValidateDocument("invalid/lorem-basic-dual-base/", expectedErrors, expectedWarnings);
+ // <base href set, see issue 155
+ testValidateDocument("invalid/lorem-basic-dual-base/");
}
@Test
public void testValidateEPUB30_InvalidContainer()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-container/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-container/");
}
@Test
public void testValidateEPUB30_InvalidSignatures()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/lorem-signatures/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-signatures/");
}
@Test
public void testValidateEPUB30_InvalidEncryption()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- Collections.addAll(expectedWarnings, MessageId.OPF_003, MessageId.PKG_010);
- testValidateDocument("invalid/lorem-encryption/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-encryption/");
}
@Test
public void testValidateEPUB30_customNsAttr()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/custom-ns-attr/", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/custom-ns-attr/");
}
@Test
public void testIssue188()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //Image file name containing '+'
- testValidateDocument("valid/issue188/", expectedErrors, expectedWarnings);
+ // Image file name containing '+'
+ testValidateDocument("valid/issue188/");
}
@Test
public void testIssue189()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //element "somebadxhtmlformatting" not allowed here
- testValidateDocument("invalid/issue189/", expectedErrors, expectedWarnings);
+ // element "somebadxhtmlformatting" not allowed here
+ testValidateDocument("invalid/issue189/");
}
@Test
public void testIssue198()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- //Collections.addAll(expectedErrors, );
+ // Collections.addAll(expectedErrors, );
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //also data-* removal
- testValidateDocument("valid/issue198/", expectedErrors, expectedWarnings);
+ // also data-* removal
+ testValidateDocument("valid/issue198/");
}
@Test
public void testIssue211a()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //figcaption and scoped styles alt 1
- testValidateDocument("valid/issue211a/", expectedErrors, expectedWarnings);
+ // figcaption and scoped styles alt 1
+ testValidateDocument("valid/issue211a/");
}
@Test
public void testIssue211b()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //figcaption and scoped styles alt 2
- testValidateDocument("valid/issue211b/", expectedErrors, expectedWarnings);
+ // figcaption and scoped styles alt 2
+ testValidateDocument("valid/issue211b/");
}
@Test
public void testIssue225()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //2 @href values 0-length and empty after ws norm
- //issue225 asked for warning here, but we give none
- //until we have a compat hint message type; the empty
- //string is a valid URI
- testValidateDocument("valid/issue225/", expectedErrors, expectedWarnings);
+ // 2 @href values 0-length and empty after ws norm
+ // issue225 asked for warning here, but we give none
+ // until we have a compat hint message type; the empty
+ // string is a valid URI
+ testValidateDocument("valid/issue225/");
}
@Test
public void testIssue226()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue226/", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/issue226/");
}
-
- @Test
- public void testIssue237() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+
+ @Test
+ public void testIssue237()
+ {
// namespace uri in css is not a remote resource...
- testValidateDocument("valid/issue237/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testIssue249() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ testValidateDocument("valid/issue237/");
+ }
+
+ @Test
+ public void testIssue249()
+ {
Collections.addAll(expectedWarnings, MessageId.OPF_018);
- testValidateDocument("valid/issue249/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testValidateEPUB20_issue267() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue267/", expectedErrors, expectedWarnings, "valid/issue267.txt");
- }
-
- @Test
- public void testIssue270() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue270/", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testCollectionPreview() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("valid/collections-preview/", expectedErrors, expectedWarnings, expectedFatals,true);
- }
+ testValidateDocument("valid/issue249/");
+ }
+
+ @Test
+ public void testValidateEPUB20_issue267()
+ {
+ testValidateDocument("valid/issue267/", "valid/issue267.txt");
+ }
+
+ @Test
+ public void testIssue270()
+ {
+ testValidateDocument("valid/issue270/");
+ }
+
+ @Test
+ public void testIssue305()
+ {
+ expectedErrors.add(MessageId.OPF_073);
+ testValidateDocument("invalid/ncx-external-identifier");
+ }
+
+ @Test
+ public void testIssue332()
+ {
+ testValidateDocument("valid/issue332-idspaces");
+ }
+
+ @Test
+ public void testIssue419()
+ {
+ testValidateDocument("valid/issue419/");
+ }
+
+ @Test
+ public void testIssue5()
+ {
+ testValidateDocument("valid/issue567/");
+ }
+
+ @Test
+ public void testResource_Missing() {
+ Collections.addAll(expectedErrors, MessageId.RSC_001);
+ testValidateDocument("invalid/resource-missing/");
+ }
+
+ @Test
+ public void testFallback_XPGT_Explicit()
+ {
+ testValidateDocument("valid/xpgt-explicit-fallback/");
+ }
+
+ @Test
+ public void testFallback_XPGT_Implicit()
+ {
+ testValidateDocument("valid/xpgt-implicit-fallback/");
+ }
+
+ @Test
+ public void testFallback_XPGT_NoFallback()
+ {
+ Collections.addAll(expectedErrors, MessageId.CSS_010);
+ testValidateDocument("invalid/xpgt-no-fallback/");
+ }
+
+ @Test
+ public void testLink_MissingResource(){
+ Collections.addAll(expectedWarnings, MessageId.RSC_007w);
+ testValidateDocument("invalid/link-missing/");
+ }
+
+ @Test
+ public void testMultipleRenditions()
+ {
+ testValidateDocument("valid/multiple-renditions");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_MultipleNavs()
+ {
+ testValidateDocument("valid/multiple-renditions-mapping-multiplenavs");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_NotXHTML()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-mapping-nonxhtml");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_MoreThanOne()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ // side-effect or more than one mapping: only one is recognized as declared,
+ // hence the OPF_003
+ Collections.addAll(expectedWarnings, MessageId.OPF_003);
+ testValidateDocument("invalid/multiple-renditions-multiple-mappings");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_NoVersionMeta()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-mapping-noversion");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_NoResourceMap()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-mapping-noresourcemap");
+ }
+
+ @Test
+ public void testMultipleRenditions_Mapping_UnidentifiedNavType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-mapping-untypednav");
+ }
+
+ @Test
+ public void testPreview_Embedded()
+ {
+ testValidateDocument("valid/preview-embedded/");
+ }
+
+ @Test
+ public void testPreview_Embedded_NoManifest()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/preview-embedded-nomanifest/");
+ }
+
+ @Test
+ public void testPreview_Embedded_NoLinks()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/preview-embedded-nolinks/");
+ }
+
+ @Test
+ public void testPreview_Embedded_LinkNotContentDoc()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_075);
+ testValidateDocument("invalid/preview-embedded-linknoCD/");
+ }
+
+ @Test
+ public void testPreview_Embedded_LinkWithCFI()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_076);
+ testValidateDocument("invalid/preview-embedded-linkcfi/");
+ }
+
+ @Test
+ public void testPreview_Pub()
+ {
+ testValidateDocument("valid/preview-pub/");
+ }
+
+ @Test
+ public void testPreview_Pub_NoType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/preview-pub-notype/", EPUBProfile.PREVIEW);
+ }
+
+ @Test
+ public void testPreview_Pub_NoSource()
+ {
+ Collections.addAll(expectedWarnings, MessageId.RSC_017);
+ testValidateDocument("invalid/preview-pub-nosource/");
+ }
+
+ @Test
+ public void testPreview_Pub_SameSourceId()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/preview-pub-samesourceid/");
+ }
@Test
public void testXHTMExtension()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.HTM_014a);
- testValidateDocument("invalid/xhtml-extension", expectedErrors, expectedWarnings, expectedFatals, true);
+ testValidateDocument("invalid/xhtml-extension");
+ }
+
+ @Test
+ public void testEdupub_Basic()
+ {
+ testValidateDocument("valid/edu-basic/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_FXL()
+ {
+ testValidateDocument("valid/edu-fxl/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_NonLinear()
+ {
+ testValidateDocument("valid/edu-non-linear/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubPagination_InvalidNoPageList()
+ {
+ Collections.addAll(expectedErrors, MessageId.NAV_003);
+ testValidateDocument("invalid/edu-pagination-nopagelist/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubPagination_InvalidNoPageSource()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_066);
+ testValidateDocument("invalid/edu-pagination-nopagesource/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubPagination_InvalidWithMicrodata()
+ {
+ Collections.addAll(expectedWarnings, MessageId.HTM_051);
+ testValidateDocument("invalid/edu-microdata/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void test_MissingLOx()
+ {
+ testValidateDocument("valid/non-edu-missing-lox/");
+ }
+
+ @Test
+ public void testEdupub_MissingLOx()
+ {
+ testValidateDocument("invalid/edu-missing-lox/", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testIdx_SingleFile()
+ {
+ testValidateDocument("valid/idx-single-file/");
+ }
+
+ @Test
+ public void testIdx_SingleFile_InvalidIndexContent()
+ {
+ expectedErrors.add(MessageId.RSC_005);
+ testValidateDocument("invalid/idx-single-file-badidxcontent/");
+ }
+
+ @Test
+ public void testIdx_SingleFile_InvalidNoIndex()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_015, MessageId.RSC_005);
+ testValidateDocument("invalid/idx-single-file-noindex/");
+ }
+
+ @Test
+ public void testIdx_WholePub()
+ {
+ testValidateDocument("valid/idx-whole-pub/");
+ }
+
+ @Test
+ public void testIdx_WholePub_InvalidIndexContent()
+ {
+ expectedErrors.add(MessageId.RSC_005);
+ testValidateDocument("invalid/idx-whole-pub-badidxcontent/");
+ }
+
+ @Test
+ public void testIdx_WholePub_InvalidNoIndex()
+ {
+ expectedErrors.add(MessageId.RSC_005);
+ testValidateDocument("invalid/idx-whole-pub-noindex/");
+ }
+
+ @Test
+ public void testIdx_Collection()
+ {
+ testValidateDocument("valid/idx-collection/");
+ }
+
+ @Test
+ public void testIdx_Collection_InvalidIndexContent()
+ {
+ expectedErrors.add(MessageId.RSC_005);
+ testValidateDocument("invalid/idx-collection-badidxcontent/");
+ }
+
+ @Test
+ public void testIdx_Collection_InvalidNoIndex()
+ {
+ expectedErrors.add(MessageId.RSC_005);
+ testValidateDocument("invalid/idx-collection-noindex");
+ }
+
+ @Test
+ public void testDataNav_Basic()
+ {
+ testValidateDocument("valid/data-nav-basic");
+ }
+
+ @Test
+ public void testDataNav_MoreThanOne()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/data-nav-multiple");
+ }
+
+ @Test
+ public void testDataNav_NotXHTML()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_012);
+ testValidateDocument("invalid/data-nav-notxhtml");
+ }
+
+ @Test
+ public void testDataNav_InSpine()
+ {
+ Collections.addAll(expectedWarnings, MessageId.OPF_077);
+ testValidateDocument("invalid/data-nav-inspine");
+ }
+
+ @Test
+ public void testDataNav_MissingType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/data-nav-missing-type");
+ }
+
+ @Test
+ public void testDataNav_RegionBased()
+ {
+ testValidateDocument("valid/data-nav-regionbased");
+ }
+
+ @Test
+ public void testDataNav_RegionBased_NotInDataNav()
+ {
+ Collections.addAll(expectedErrors, MessageId.HTM_052);
+ testValidateDocument("invalid/data-nav-regionbased-notindatanav");
+ }
+
+ @Test
+ public void testDataNav_RegionBased_NotFXL()
+ {
+ Collections.addAll(expectedErrors, MessageId.NAV_009);
+ testValidateDocument("invalid/data-nav-regionbased-notfxl");
+ }
+
+ @Test
+ public void testDataNav_RegionBased_Struct()
+ {
+ Collections.addAll(expectedWarnings, MessageId.RSC_017);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/data-nav-regionbased-struct");
+ }
+
+ @Test
+ public void testDict_Single()
+ {
+ testValidateDocument("valid/dict-single");
+ }
+
+ @Test
+ public void testDict_Single_NoDictContent()
+ {
+ expectedErrors.add(MessageId.OPF_078);
+ testValidateDocument("invalid/dict-single-nodictcontent");
+ }
+
+ @Test
+ public void testDict_InvalidDictContent()
+ {
+ // Two errors: one in Nav Doc, one in regular XHTML Doc
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-invalidcontent");
+ }
+
+ @Test
+ public void testDict_SearchKeyMap_Invalid()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-skm-invalid");
+ }
+
+ @Test
+ public void testDict_SearchKeyMap_BadExtension()
+ {
+ Collections.addAll(expectedWarnings, MessageId.OPF_080);
+ testValidateDocument("invalid/dict-skm-badextension");
+ }
+
+ @Test
+ public void testDict_SearchKeyMap_LinkDoesntResolve()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_007);
+ testValidateDocument("invalid/dict-skm-linktonowhere");
+ }
+
+ @Test
+ public void testDict_SearchKeyMap_LinkToNonContentDoc()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_021);
+ testValidateDocument("invalid/dict-skm-linktocss");
+ }
+
+ @Test
+ public void testDict_NoDCType()
+ {
+ // error from schema, because profile is explictly asked
+ expectedErrors.add(MessageId.RSC_005);
+ // warning from content being detected as dictionary
+ expectedWarnings.add(MessageId.OPF_079);
+ testValidateDocument("invalid/dict-nodctype", EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_NoDCTypeButDictContent()
+ {
+ // Profile not set, but detected as dictionary from epub:type
+ expectedWarnings.add(MessageId.OPF_079);
+ testValidateDocument("invalid/dict-nodctype-2");
+ }
+
+ @Test
+ public void testDict_Multiple()
+ {
+ testValidateDocument("valid/dict-multiple");
+ }
+
+ @Test
+ public void testDict_Multiple_NoDictContent()
+ {
+ expectedErrors.add(MessageId.OPF_078);
+ testValidateDocument("invalid/dict-multiple-nodictcontent");
+ }
+
+ @Test
+ public void testDuplicateResources()
+ {
+ expectedErrors.add(MessageId.OPF_074);
+ testValidateDocument("invalid/duplicate-resource");
+ }
+
+ @Test
+ public void testOutOfSpineRef()
+ {
+ expectedErrors.add(MessageId.RSC_011);
+ testValidateDocument("invalid/href-outofspine");
}
}
diff --git a/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java b/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java
index 29afc32..3f3a245 100644
--- a/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java
+++ b/src/test/java/com/adobe/epubcheck/api/Epub30CheckTest.java
@@ -22,9 +22,7 @@
package com.adobe.epubcheck.api;
-import java.util.ArrayList;
import java.util.Collections;
-import java.util.List;
import org.junit.Test;
@@ -33,276 +31,312 @@ import com.adobe.epubcheck.messages.MessageId;
public class Epub30CheckTest extends AbstractEpubCheckTest
{
-
public Epub30CheckTest()
{
super("/30/epub/");
}
- // TODO -- check for fallback cycles
@Test
public void testValidateEPUBPFallbackCycle()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_044, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/fallback-cycle.epub", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.OPF_045, MessageId.OPF_044, MessageId.OPF_045,
+ MessageId.OPF_045, MessageId.OPF_045, MessageId.OPF_045);
+ testValidateDocument("invalid/fallback-cycle.epub");
}
@Test
public void testValidateEPUBPvalid30()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem.epub", expectedErrors, expectedWarnings, "valid/lorem.txt");
+ testValidateDocument("valid/lorem.epub", "valid/lorem.txt");
}
@Test
public void testValidateEPUBTestSvg()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/test_svg.epub", expectedErrors, expectedWarnings, "valid/test_svg.txt");
+ testValidateDocument("valid/test_svg.epub", "valid/test_svg.txt");
}
@Test
public void testValidateEPUBInvalidNcx()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_012, MessageId.RSC_012);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/invalid-ncx.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/invalid-ncx.epub");
}
@Test
public void testValidateEPUBMp3()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/mp3-in-manifest.epub", expectedErrors, expectedWarnings, "valid/mp3-in-manifest.txt");
+ testValidateDocument("valid/mp3-in-manifest.epub", "valid/mp3-in-manifest.txt");
}
@Test
public void testValidateEPUBInvalidMp3()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_043);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/mp3-in-spine-no-fallback.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/mp3-in-spine-no-fallback.epub");
}
@Test
public void testValidateEPUBMp3WithFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/mp3-with-fallback.epub", expectedErrors, expectedWarnings, "valid/mp3-with-fallback.txt");
+ testValidateDocument("valid/mp3-with-fallback.epub", "valid/mp3-with-fallback.txt");
}
@Test
public void testValidateEPUBFontNoFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_043);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/font_no_fallback.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/font_no_fallback.epub");
}
@Test
public void testValidateEPUBFontFallbackChain()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/font_fallback_chain.epub", expectedErrors, expectedWarnings, "valid/font_fallback_chain.txt");
+ testValidateDocument("valid/font_fallback_chain.epub", "valid/font_fallback_chain.txt");
}
@Test
public void testValidateEPUBvalid30()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/lorem.epub", expectedErrors, expectedWarnings, "valid/lorem.txt");
+ testValidateDocument("valid/lorem.epub", "valid/lorem.txt");
}
@Test
public void testValidateEPUB30_xhtmlsch()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// 1 schematron error from xhtml validation
- testValidateDocument("invalid/lorem-xht-sch-1.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-xht-sch-1.epub");
}
@Test
public void testValidateEPUB30_xhtmlrng()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// 1 rng error from xhtml validation
- testValidateDocument("invalid/lorem-xht-rng-1.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/lorem-xht-rng-1.epub");
}
@Test
public void testValidateEPUB30_navInvalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// invalid nav issue reported by MattG
- testValidateDocument("invalid/nav-invalid.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-invalid.epub");
}
@Test
public void testValidateEPUB30ValidExtension1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.PKG_016);
- testValidateDocument("valid/extension-1.ePub", expectedErrors, expectedWarnings, "valid/extension-1.txt");
+ testValidateDocument("valid/extension-1.ePub", "valid/extension-1.txt");
}
@Test
public void testValidateEPUB30CSSProfile()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //issue145; CSS3 pseudoselectors causing css2 lexers to bail out
- testValidateDocument("valid/issue145.epub", expectedErrors, expectedWarnings, "valid/issue145.txt");
+ // issue145; CSS3 pseudoselectors causing css2 lexers to bail out
+ testValidateDocument("valid/issue145.epub", "valid/issue145.txt");
}
@Test
public void testValidateEPUB30Issue158()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //bad warning message, this should pass without warnings
- testValidateDocument("valid/issue158.epub", expectedErrors, expectedWarnings, "valid/issue158.txt");
+ // bad warning message, this should pass without warnings
+ testValidateDocument("valid/issue158.epub", "valid/issue158.txt");
}
@Test
public void testValidateEPUB30Issue137a()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_006);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("invalid/issue137a.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue137a.epub");
}
@Test
public void testValidateEPUB30Issue137b()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_006);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.OPF_055);
- testValidateDocument("invalid/issue137b.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue137b.epub");
}
@Test
public void testValidateEPUB30specValid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/epub30-spec.epub", expectedErrors, expectedWarnings, "valid/epub30-spec.txt");
+ testValidateDocument("valid/epub30-spec.epub", "valid/epub30-spec.txt");
}
@Test
public void testValidateEPUB30Issue203()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.HTM_004);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.HTM_015);
- testValidateDocument("invalid/issue203.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue203.epub");
}
@Test
public void testValidateEPUB30Issue176()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_001, MessageId.RSC_001, MessageId.RSC_001, MessageId.RSC_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ Collections.addAll(expectedErrors, MessageId.RSC_001, MessageId.RSC_001, MessageId.RSC_001,
+ MessageId.RSC_001);
Collections.addAll(expectedWarnings, MessageId.HTM_016, MessageId.HTM_016, MessageId.HTM_016);
- testValidateDocument("invalid/issue176.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/issue176.epub");
}
@Test
public void testValidateEPUB30Issue221()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.CSS_008, MessageId.CSS_008, MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //syntax error in css that should not mask font-face
- testValidateDocument("invalid/issue221.epub", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.CSS_008, MessageId.RSC_007, MessageId.RSC_007,
+ MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007, MessageId.RSC_007);
+ // syntax error in css that should not mask font-face
+ testValidateDocument("invalid/issue221.epub");
}
@Test
public void testValidateEPUB30FontObfuscation()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.CSS_017);
- testValidateDocument("valid/font-obfuscation.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/font-obfuscation.epub");
}
@Test
public void testValidateEPUB30CFI()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/georgia-cfi.epub", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/georgia-cfi.epub");
}
- @Test
- public void testFilenameContainsSpacesIssue239() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ @Test
+ public void testFilenameContainsSpacesIssue239()
+ {
Collections.addAll(expectedWarnings, MessageId.PKG_010);
- testValidateDocument("invalid/issue239.epub", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testDuplicateZipEntriesIssue265() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
+ testValidateDocument("invalid/issue239.epub");
+ }
+ @Test
+ public void testDuplicateZipEntriesIssue265()
+ {
// duplicate entries should raise an error
- testValidateDocument("invalid/issue265.epub", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testDuplicateZipEntriesIssue265b() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- Collections.addAll(expectedWarnings, MessageId.PKG_012, MessageId.OPF_061, MessageId.OPF_003, MessageId.PKG_012);
+ testValidateDocument("invalid/issue265.epub");
+ }
+
+ @Test
+ public void testDuplicateZipEntriesIssue265b()
+ {
+ Collections.addAll(expectedWarnings, MessageId.OPF_003, MessageId.PKG_012, MessageId.OPF_061,
+ MessageId.PKG_012);
// non-unique entry names (after NFC normalization) should raise a warning
- testValidateDocument("invalid/issue265b.epub", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testDuplicateZipEntriesIssue265c() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
+ testValidateDocument("invalid/issue265b.epub");
+ }
+
+ @Test
+ public void testDuplicateZipEntriesIssue265c()
+ {
Collections.addAll(expectedErrors, MessageId.OPF_060);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
// non-unique entry names (after case normalization) should raise an error
- testValidateDocument("invalid/issue265c.epub", expectedErrors, expectedWarnings);
- }
-
- @Test
- public void testIssue262() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue262.epub", expectedErrors, expectedWarnings);
- }
- @Test
- public void testIssue271() {
- // Adobe page template xpgt with correct css fallback
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/issue271_xpgt_correctFallback.epub", expectedErrors, expectedWarnings);
- }
-
+ testValidateDocument("invalid/issue265c.epub");
+ }
+
+ @Test
+ public void testIssue262()
+ {
+ testValidateDocument("valid/issue262.epub");
+ }
+
+ @Test
+ public void testIssue271()
+ {
+ // Adobe page template xpgt with correct css fallback
+ testValidateDocument("valid/issue271_xpgt_correctFallback.epub");
+ }
+
+ @Test
+ public void testEdupub_Pagination()
+ {
+ testValidateDocument("valid/edupub-pagination.epub", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_PaginationInvalid_NoPageList()
+ {
+ Collections.addAll(expectedErrors, MessageId.NAV_003);
+ testValidateDocument("invalid/edupub-pagination-nopagelist.epub", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_PaginationInvalid_NoPageSource()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_066);
+ testValidateDocument("invalid/edupub-pagination-nosource.epub", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_ToCInvalid_NoFullToC()
+ {
+ // TODO re-enable NAV_004 as a WARNING or ERROR when the spec clearer
+ // Collections.addAll(expectedWarnings, MessageId.NAV_004);
+ testValidateDocument("invalid/edupub-toc-missing-branches.epub", EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testRenditions()
+ {
+ testValidateDocument("valid/multiple-renditions.epub");
+ }
+
+ @Test
+ public void testRenditions_Invalid_NoMetadata()
+ {
+ Collections.addAll(expectedWarnings, MessageId.RSC_019);
+ testValidateDocument("invalid/multiple-renditions-nometadata.epub");
+ }
+
+ @Test
+ public void testRenditions_Invalid_UIDMissingModified()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-nodctermsmodified.epub");
+ }
+
+ @Test
+ public void testRenditions_Invalid_BadMediaQuery()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-badmediaquery.epub");
+ }
+
+ @Test
+ public void testRenditions_Invalid_UndefinedSelection()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/multiple-renditions-undefinedselection.epub");
+ }
+
+ @Test
+ public void testRenditions_Invalid_NoSelection()
+ {
+ Collections.addAll(expectedWarnings, MessageId.RSC_017);
+ testValidateDocument("invalid/multiple-renditions-noselection.epub");
+ }
+
+ @Test
+ public void testEdupubRenditions()
+ {
+ testValidateDocument("valid/edupub-multiple-renditions.epub");
+ }
+
+ @Test
+ public void testEdupubRenditions_Invalid_NoPubDCType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-multiple-renditions-nodctype-pub.epub");
+ }
+
+ @Test
+ public void testEdupubRenditions_Invalid_NoRenditionDCType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-multiple-renditions-nodctype-rendition.epub");
+ }
}
diff --git a/src/test/java/com/adobe/epubcheck/cli/CLITest.java b/src/test/java/com/adobe/epubcheck/cli/CLITest.java
index 1bcef41..a1c8d11 100644
--- a/src/test/java/com/adobe/epubcheck/cli/CLITest.java
+++ b/src/test/java/com/adobe/epubcheck/cli/CLITest.java
@@ -68,7 +68,7 @@ public class CLITest
@Test
public void testValidSingle()
{
- assertEquals(0, run(new String[]{singlePath + "nav/valid/nav001.xhtml", "-mode", "nav"}));
+ assertEquals(0, run(new String[]{singlePath + "nav/valid/nav001.xhtml", "-mode", "nav"},true));
}
@Test
diff --git a/src/test/java/com/adobe/epubcheck/nav/NavCheckerTest.java b/src/test/java/com/adobe/epubcheck/nav/NavCheckerTest.java
index edcfd57..39f033e 100644
--- a/src/test/java/com/adobe/epubcheck/nav/NavCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/nav/NavCheckerTest.java
@@ -25,13 +25,16 @@ package com.adobe.epubcheck.nav;
import static org.junit.Assert.assertEquals;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
+import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FileResourceProvider;
import com.adobe.epubcheck.util.GenericResourceProvider;
@@ -44,18 +47,20 @@ public class NavCheckerTest
{
private static String basepath = "/30/single/nav/";
+ private List<MessageId> expectedWarnings = new LinkedList<MessageId>();
+ private List<MessageId> expectedErrors = new LinkedList<MessageId>();
+ private List<MessageId> expectedFatals = new LinkedList<MessageId>();
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings)
+ public void testValidateDocument(String fileName)
{
- testValidateDocument(fileName, errors, warnings, new ArrayList<MessageId>(), false);
+ testValidateDocument(fileName, false);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors,
- boolean verbose)
+ public void testValidateDocument(String fileName, boolean verbose)
{
ValidationReport testReport = new ValidationReport(fileName, String.format(
- Messages.get("single_file"), "nav", "3.0"));
+ Messages.get("single_file"), "nav", EPUBVersion.VERSION_3, EPUBProfile.DEFAULT));
GenericResourceProvider resourceProvider;
if (fileName.startsWith("http://") || fileName.startsWith("https://"))
@@ -69,8 +74,9 @@ public class NavCheckerTest
resourceProvider = new FileResourceProvider(filePath);
}
- NavChecker navChecker = new NavChecker(resourceProvider, testReport, basepath
- + fileName, "application/xhtml+xml", EPUBVersion.VERSION_3);
+ NavChecker navChecker = new NavChecker(new ValidationContextBuilder().path(basepath + fileName)
+ .resourceProvider(resourceProvider).report(testReport).mimetype("application/xhtml+xml")
+ .version(EPUBVersion.VERSION_3).profile(EPUBProfile.DEFAULT).build());
navChecker.validate();
@@ -79,9 +85,18 @@ public class NavCheckerTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", errors, testReport.getErrorIds());
- assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
+ assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
+ assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
+ testReport.getFatalErrorIds());
+ }
+
+ @Before
+ public void setup()
+ {
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
// XXX The mimeType of the nav document should be nav; this way it can be
@@ -89,95 +104,83 @@ public class NavCheckerTest
@Test
public void testValidateDocumentValidMinimalNav()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/minimal.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/minimal.xhtml");
}
@Test
public void testValidateDocumentValidNav001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("valid/nav001.xhtml", expectedErrors, expectedWarnings,expectedFatals,false);
+ testValidateDocument("valid/nav001.xhtml");
}
@Test
public void testValidateDocumentNoTocNav()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/noTocNav.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/noTocNav.xhtml");
}
-// @Test
-// public void testValidateDocumentNoTocNavFromURL() {
-// testValidateDocument("http://www.interq.ro/bgd/noTocNav.xhtml", expectedErrors, expectedWarnings);
-// }
+ // @Test
+ // public void testValidateDocumentNoTocNavFromURL() {
+ // testValidateDocument("http://www.interq.ro/bgd/noTocNav.xhtml",
+ // expectedErrors, expectedWarnings);
+ // }
@Test
public void testValidateDocumentHText()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/h-text.xhtml", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("invalid/h-text.xhtml");
}
@Test
public void testValidateDocumenNavLabels001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-labels-001.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-labels-001.xhtml");
}
@Test
public void testValidateDocumentNavLabels002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-labels-001.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-labels-001.xhtml");
}
@Test
public void testValidateDocumentNavLandmarks001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-landmarks-001.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-landmarks-001.xhtml");
}
@Test
public void testValidateDocumentNavNoPagelist001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-pagelist-001.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-pagelist-001.xhtml");
}
@Test
public void testValidateDocumentNavNoToc()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/nav-no-toc.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/nav-no-toc.xhtml");
}
@Test
public void testValidateDocumentNavReqHeading()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/req-heading.xhtml", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/req-heading.xhtml");
+ }
+
+ @Test
+ public void testValid_issuet538()
+ {
+ testValidateDocument("valid/issue538.xhtml");
}
}
diff --git a/src/test/java/com/adobe/epubcheck/ocf/OCFCheckerTest.java b/src/test/java/com/adobe/epubcheck/ocf/OCFCheckerTest.java
index 79f57b4..c342763 100644
--- a/src/test/java/com/adobe/epubcheck/ocf/OCFCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/ocf/OCFCheckerTest.java
@@ -20,22 +20,24 @@
modified, built upon, or otherwise exploited by anyone for any
purpose, commercial or non-commercial, and in any way, including
by methods that have not yet been invented or conceived.
-*/
+ */
package com.adobe.epubcheck.ocf;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.util.EPUBVersion;
-import com.adobe.epubcheck.util.ValidationReport;
-import com.adobe.epubcheck.util.outWriter;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import org.junit.Test;
+
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.ValidationReport;
+import com.adobe.epubcheck.util.outWriter;
public class OCFCheckerTest
{
@@ -44,10 +46,12 @@ public class OCFCheckerTest
{
OCFPackage ocf = new OCFMockPackage(fileName);
- ValidationReport testReport = new ValidationReport(fileName, String.format(
- "Package is being checked as ePub version %s", version == null ? "null" : version.toString()));
+ ValidationReport testReport = new ValidationReport(fileName,
+ String.format("Package is being checked as EPUB version %s",
+ version == null ? "null" : version.toString()));
- OCFChecker checker = new OCFChecker(ocf, testReport, version);
+ OCFChecker checker = new OCFChecker(
+ new ValidationContextBuilder().ocf(ocf).report(testReport).version(version).build());
checker.runChecks();
@@ -55,8 +59,8 @@ public class OCFCheckerTest
}
/**
- * Not a test of the OCFChecker, just a sanity check to be sure the Mock Package
- * provider is working.
+ * Not a test of the OCFChecker, just a sanity check to be sure the Mock
+ * Package provider is working.
*/
@Test
public void invalidPath()
@@ -70,15 +74,15 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem/lorem-basic/",
EPUBVersion.VERSION_2);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 2.0"));
- assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
+ assertTrue(testReport.hasInfoMessage("[format version] 2.0.1"));
+ assertTrue(testReport
+ .hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
}
@Test
@@ -86,15 +90,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -102,8 +105,7 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic/",
EPUBVersion.VERSION_2);
- if (0 == testReport.getErrorCount()
- || 1 != testReport.getWarningCount())
+ if (0 == testReport.getErrorCount() || 1 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -112,8 +114,9 @@ public class OCFCheckerTest
Collections.addAll(warnings, MessageId.PKG_001);
assertEquals(warnings, testReport.getWarningIds());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
- assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
+ assertTrue(testReport
+ .hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
}
@Test
@@ -121,8 +124,7 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem/lorem-basic/",
EPUBVersion.VERSION_3);
- if (0 == testReport.getErrorCount()
- || 1 != testReport.getWarningCount())
+ if (0 == testReport.getErrorCount() || 1 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -131,8 +133,9 @@ public class OCFCheckerTest
Collections.addAll(warnings, MessageId.PKG_001);
assertEquals(warnings, testReport.getWarningIds());
- assertTrue(testReport.hasInfoMessage("[format version] 2.0"));
- assertTrue(testReport.hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
+ assertTrue(testReport.hasInfoMessage("[format version] 2.0.1"));
+ assertTrue(testReport
+ .hasInfoMessage("[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314"));
}
@Test
@@ -140,16 +143,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-basic-switch/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -157,15 +158,13 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-audio/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -173,16 +172,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-bindings/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -190,16 +187,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-foreign/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -207,16 +202,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-link/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -224,16 +217,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-object-fallbacks/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -241,16 +232,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-poster/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -258,16 +247,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-svg/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -275,16 +262,14 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-svg-hyperlink/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -292,26 +277,22 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/valid/wasteland-basic/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
-
@Test
public void testLoremMultipleRenditions20()
{
ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem-xrenditions-2ops/",
EPUBVersion.VERSION_2);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -327,8 +308,7 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/20/expanded/valid/lorem-xrenditions-1ops/",
EPUBVersion.VERSION_2);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -340,12 +320,11 @@ public class OCFCheckerTest
@Test
public void testLoremMultipleRenditions30()
{
- ValidationReport testReport = testOcfPackage("/30/expanded/valid/lorem-xrenditions/",
+ ValidationReport testReport = testOcfPackage("/30/expanded/valid/multiple-renditions/",
EPUBVersion.VERSION_3);
- if (0 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (0 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
- outWriter.println(testReport);
+ outWriter.println(testReport);
}
assertEquals(0, testReport.getErrorCount());
assertEquals(0, testReport.getWarningCount());
@@ -359,21 +338,19 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-basic-switch/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
- // there must be a message error about the missing 'mathml' property
- assertTrue(testReport.errorList.get(0).message.contains(
- "The property 'mathml' should be declared in the OPF file."));
+ // there must be a message error about the missing 'mathml' property
+ assertTrue(testReport.errorList.get(0).message
+ .contains("The property 'mathml' should be declared in the OPF file."));
List<MessageId> errors = new ArrayList<MessageId>();
Collections.addAll(errors, MessageId.OPF_014);
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -381,19 +358,18 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-bindings/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
- assertTrue(testReport.errorList.get(0).message.contains(
- "Object element doesn't provide fallback"));
+ assertTrue(
+ testReport.errorList.get(0).message.contains("Object element doesn't provide fallback"));
List<MessageId> errors = new ArrayList<MessageId>();
Collections.addAll(errors, MessageId.MED_002);
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -401,21 +377,20 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-foreign/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
- // there must be a message error about the missing 'remote-resources' property
- assertTrue(testReport.errorList.get(0).message.contains(
- "The property 'remote-resources' should be declared in the OPF file."));
+ // there must be a message error about the missing 'remote-resources'
+ // property
+ assertTrue(testReport.errorList.get(0).message
+ .contains("The property 'remote-resources' should be declared in the OPF file."));
List<MessageId> errors = new ArrayList<MessageId>();
Collections.addAll(errors, MessageId.OPF_014);
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -423,9 +398,7 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-mimetype/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -435,7 +408,7 @@ public class OCFCheckerTest
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -443,9 +416,7 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-poster/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount()
- )
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
@@ -455,7 +426,7 @@ public class OCFCheckerTest
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -463,19 +434,17 @@ public class OCFCheckerTest
{
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-xhtml-rng-1/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
- assertTrue(testReport.errorList.get(0).message.contains(
- "element \"epub:x\" not allowed here"));
+ assertTrue(testReport.errorList.get(0).message.contains("element \"epub:x\" not allowed here"));
List<MessageId> errors = new ArrayList<MessageId>();
Collections.addAll(errors, MessageId.RSC_005);
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
@Test
@@ -484,21 +453,20 @@ public class OCFCheckerTest
ValidationReport testReport = testOcfPackage("/30/expanded/invalid/lorem-xhtml-sch-1/",
EPUBVersion.VERSION_3);
- if (1 != testReport.getErrorCount()
- || 0 != testReport.getWarningCount())
+ if (1 != testReport.getErrorCount() || 0 != testReport.getWarningCount())
{
outWriter.println(testReport);
}
if (testReport.errorList.size() > 0)
{
- assertTrue(testReport.errorList.get(0).message.contains(
- "The dfn element must not appear inside dfn elements"));
+ assertTrue(testReport.errorList.get(0).message
+ .contains("The dfn element must not appear inside dfn elements"));
}
List<MessageId> errors = new ArrayList<MessageId>();
Collections.addAll(errors, MessageId.RSC_005);
assertEquals(errors, testReport.getErrorIds());
assertEquals(0, testReport.getWarningCount());
- assertTrue(testReport.hasInfoMessage("[format version] 3.0"));
+ assertTrue(testReport.hasInfoMessage("[format version] 3.0.1"));
}
}
diff --git a/src/test/java/com/adobe/epubcheck/ocf/OCFFilenameCheckerTest.java b/src/test/java/com/adobe/epubcheck/ocf/OCFFilenameCheckerTest.java
index 36052c3..4d6f06b 100644
--- a/src/test/java/com/adobe/epubcheck/ocf/OCFFilenameCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/ocf/OCFFilenameCheckerTest.java
@@ -22,13 +22,15 @@
package com.adobe.epubcheck.ocf;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.Messages;
import com.adobe.epubcheck.util.ValidationReport;
import com.adobe.epubcheck.util.outWriter;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
public class OCFFilenameCheckerTest
{
@@ -55,7 +57,7 @@ public class OCFFilenameCheckerTest
EPUBVersion version)
{
testReport = new ValidationReport(fileName, String.format(
- Messages.get("single_file"), "opf", version.toString()));
+ Messages.get("single_file"), "opf", version.toString(), EPUBProfile.DEFAULT));
String result = OCFFilenameChecker.checkCompatiblyEscaped(fileName, testReport, version);
diff --git a/src/test/java/com/adobe/epubcheck/opf/MetadataSetTest.java b/src/test/java/com/adobe/epubcheck/opf/MetadataSetTest.java
new file mode 100644
index 0000000..1fcef9e
--- /dev/null
+++ b/src/test/java/com/adobe/epubcheck/opf/MetadataSetTest.java
@@ -0,0 +1,179 @@
+package com.adobe.epubcheck.opf;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import com.adobe.epubcheck.opf.MetadataSet.Metadata;
+import com.adobe.epubcheck.opf.MetadataSet.Builder;
+import com.adobe.epubcheck.vocab.Property;
+
+public class MetadataSetTest
+{
+
+ private Builder builder;
+ private MetadataSet set;
+ private static Property PROP_FOO = Property.newFrom("foo", "base#", "px");
+ private static Property PROP_FOZ = Property.newFrom("foz", "base#", "px");
+ private static Property PROP_BAR = Property.newFrom("bar", "base#", "px");
+ private static Property PROP_BAZ = Property.newFrom("baz", "base#", "px");
+
+ @Before
+ public void setup()
+ {
+ builder = new Builder();
+ }
+
+ @Test
+ public void testBuilderEmpty()
+ {
+ set = builder.build();
+ assertTrue(set.getAll().isEmpty());
+ }
+
+ @Test
+ public void testBuilderBasicProp()
+ {
+ builder.meta(null, PROP_FOO, "value", null);
+ set = builder.build();
+ assertEquals(1, set.getAll().size());
+ assertEquals(1, set.getPrimary(PROP_FOO).size());
+ assertEquals(1, set.getAny(PROP_FOO).size());
+ assertEquals("value", set.getAll().iterator().next().getValue());
+ }
+
+ @Test
+ public void testBuilderRefineResource()
+ {
+ builder.meta("id", PROP_FOO, "value", "bar");
+ set = builder.build();
+ assertNotNull(set.getRefining("bar"));
+ assertEquals(1, set.getRefining("bar").size());
+ }
+
+ @Test
+ public void testBuilderRefineWithHash()
+ {
+ builder.meta("id", PROP_FOO, "value", "#bar");
+ set = builder.build();
+ assertNotNull(set.getRefining("bar"));
+ assertEquals(1, set.getRefining("bar").size());
+ }
+
+ @Test
+ public void testBuilderRefinesEmpty()
+ {
+ builder.meta("id", PROP_FOO, "value", "#");
+ set = builder.build();
+ assertNotNull(set.getRefining("bar"));
+ assertTrue(set.getRefining("bar").isEmpty());
+ }
+
+ @Test
+ public void testBuilderRefineSingleProp()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", null);
+ set = builder.build();
+ assertEquals(2, set.getAll().size());
+ assertEquals(1, set.getPrimary().size());
+ assertEquals(1, set.getPrimary(PROP_BAR).size());
+ assertEquals(1, set.getAny(PROP_FOO).size());
+ Metadata bar = set.getAny(PROP_BAR).iterator().next();
+ Metadata foo = set.getAny(PROP_FOO).iterator().next();
+ assertEquals(1, bar.getRefiners().size());
+ assertEquals(foo, bar.getRefiners().iterator().next());
+ assertTrue(foo.getRefiners().isEmpty());
+ assertEquals(bar, set.getRefinedBy(foo).orNull());
+ assertEquals(foo, set.getRefining("idbar").iterator().next());
+ }
+
+ @Test
+ public void testBuilderRefineSinglePropWithNoId()
+ {
+ builder.meta(null, PROP_FOO, "valuefoo", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", null);
+ set = builder.build();
+ assertEquals(2, set.getAll().size());
+ assertEquals(1, set.getPrimary().size());
+ assertEquals(1, set.getPrimary(PROP_BAR).size());
+ assertEquals(1, set.getAny(PROP_FOO).size());
+ Metadata bar = set.getAny(PROP_BAR).iterator().next();
+ Metadata foo = set.getAny(PROP_FOO).iterator().next();
+ assertEquals(1, bar.getRefiners().size());
+ assertEquals(foo, bar.getRefiners().iterator().next());
+ assertTrue(foo.getRefiners().isEmpty());
+ assertEquals(bar, set.getRefinedBy(foo).orNull());
+ assertEquals(foo, set.getRefining("idbar").iterator().next());
+ }
+
+ @Test
+ public void testBuilderMultipleRefines()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idbar");
+ builder.meta("idfoz", PROP_FOZ, "valuefoz", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", null);
+ set = builder.build();
+ assertEquals(3, set.getAll().size());
+ assertEquals(1, set.getPrimary().size());
+ Metadata bar = set.getAny(PROP_BAR).iterator().next();
+ Metadata foo = set.getAny(PROP_FOO).iterator().next();
+ Metadata foz = set.getAny(PROP_FOZ).iterator().next();
+ assertEquals(2, bar.getRefiners().size());
+ assertTrue(bar.getRefiners().contains(foo));
+ assertTrue(bar.getRefiners().contains(foz));
+ }
+
+ @Test
+ public void testBuilderChainedRefines()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idfoz");
+ builder.meta("idfoz", PROP_FOZ, "valuefoz", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", null);
+ set = builder.build();
+ assertEquals(3, set.getAll().size());
+ assertEquals(1, set.getPrimary().size());
+ Metadata bar = set.getAny(PROP_BAR).iterator().next();
+ Metadata foo = set.getAny(PROP_FOO).iterator().next();
+ Metadata foz = set.getAny(PROP_FOZ).iterator().next();
+ assertEquals(1, bar.getRefiners().size());
+ assertTrue(bar.getRefiners().contains(foz));
+ assertEquals(1, foz.getRefiners().size());
+ assertTrue(foz.getRefiners().contains(foo));
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void testBuilderRefinesCycle()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", "idfoo");
+ set = builder.build();
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void testBuilderRefinesCycleSelf()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idfoo");
+ set = builder.build();
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void testBuilderRefinesCycleIndirect()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", "idbaz");
+ builder.meta("idbaz", PROP_BAZ, "valuebaz", "idfoo");
+ set = builder.build();
+ }
+
+
+ @Test(expected = IllegalStateException.class)
+ public void testBuilderRefines()
+ {
+ builder.meta("idfoo", PROP_FOO, "valuefoo", "#idbar");
+ builder.meta("idbar", PROP_BAR, "valuebar", "#idbaz");
+ builder.meta("idbaz", PROP_BAZ, "valuebaz", "#idfoo");
+ set = builder.build();
+ }
+}
diff --git a/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java b/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java
index a4660f5..4df78b8 100644
--- a/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/opf/OPFCheckerTest.java
@@ -25,14 +25,15 @@ package com.adobe.epubcheck.opf;
import static org.junit.Assert.assertEquals;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.FileResourceProvider;
import com.adobe.epubcheck.util.GenericResourceProvider;
@@ -40,45 +41,51 @@ import com.adobe.epubcheck.util.Messages;
import com.adobe.epubcheck.util.URLResourceProvider;
import com.adobe.epubcheck.util.ValidationReport;
import com.adobe.epubcheck.util.outWriter;
+import com.google.common.collect.Lists;
public class OPFCheckerTest
{
- private List<MessageId> expectedErrors;
- private List<MessageId> expectedWarnings;
- private List<MessageId> expectedFatalErrors;
+ private List<MessageId> expectedErrors = Lists.newLinkedList();
+ private List<MessageId> expectedWarnings = Lists.newLinkedList();
+ private List<MessageId> expectedFatals = Lists.newLinkedList();
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings,
- EPUBVersion version)
+ public void testValidateDocument(String fileName, EPUBVersion version)
{
- testValidateDocument(fileName, errors, warnings, new ArrayList<MessageId>(), version, false);
+ testValidateDocument(fileName, version, false);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings,
- List<MessageId> fatalErrors, EPUBVersion version)
+ public void testValidateDocument(String fileName, EPUBVersion version, boolean verbose)
{
- testValidateDocument(fileName, errors, warnings, fatalErrors, version, false);
+ testValidateDocument(fileName, version, EPUBProfile.DEFAULT, verbose);
+ }
+ public void testValidateDocument(String fileName, EPUBVersion version, EPUBProfile profile)
+ {
+ testValidateDocument(fileName, version, profile, false);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings,
- List<MessageId> fatalErrors, EPUBVersion version, boolean verbose)
+ public void testValidateDocument(String fileName, EPUBVersion version, EPUBProfile profile,
+ boolean verbose)
{
- ValidationReport testReport = new ValidationReport(fileName, String.format(Messages.get("single_file"), "opf",
- version.toString()));
+ ValidationReport testReport = new ValidationReport(fileName,
+ String.format(Messages.get("single_file"), "opf", version.toString(),
+ profile == null ? EPUBProfile.DEFAULT : profile));
GenericResourceProvider resourceProvider;
if (fileName.startsWith("http://") || fileName.startsWith("https://"))
{
resourceProvider = new URLResourceProvider(fileName);
- } else
+ }
+ else
{
String basepath = null;
if (version == EPUBVersion.VERSION_2)
{
basepath = "/20/single/opf/";
- } else if (version == EPUBVersion.VERSION_3)
+ }
+ else if (version == EPUBVersion.VERSION_3)
{
basepath = "/30/single/opf/";
}
@@ -87,14 +94,10 @@ public class OPFCheckerTest
resourceProvider = new FileResourceProvider(filePath);
}
- OPFChecker opfChecker = null;
- if (version == EPUBVersion.VERSION_2)
- {
- opfChecker = new OPFChecker("test_single_opf", resourceProvider, testReport);
- } else if (version == EPUBVersion.VERSION_3)
- {
- opfChecker = new OPFChecker30("test_single_opf", resourceProvider, testReport);
- }
+ OPFChecker opfChecker = OPFCheckerFactory.getInstance()
+ .newInstance(new ValidationContextBuilder().path("test_single_opf")
+ .resourceProvider(resourceProvider).report(testReport).version(version).profile(profile)
+ .build());
assert opfChecker != null;
opfChecker.validate();
@@ -104,587 +107,898 @@ public class OPFCheckerTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", errors, testReport.getErrorIds());
- assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
+ assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
+ assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
+ testReport.getFatalErrorIds());
}
@Before
public void setup()
{
- expectedErrors = new ArrayList<MessageId>();
- expectedWarnings = new ArrayList<MessageId>();
- expectedFatalErrors = new ArrayList<MessageId>();
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test
public void testValidateDocumentValidOPFBase001()
{
- testValidateDocument("valid/base-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/base-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidOPFBindings001()
{
- testValidateDocument("valid/bindings-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/bindings-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidOPFMediaOverlay001()
{
- testValidateDocument("valid/media-overlay-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/media-overlay-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidOPFMediaOverlay002()
{
- testValidateDocument("valid/media-overlay-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/media-overlay-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidOPFMinimal()
{
- testValidateDocument("valid/minimal.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/minimal.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidOPFDcDate1()
{
- testValidateDocument("valid/date-1.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/date-1.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidOPFDcDate2()
{
- testValidateDocument("valid/date-2.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/date-2.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidOPFDcDate3()
{
- testValidateDocument("valid/date-3.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/date-3.opf", EPUBVersion.VERSION_3);
}
@Test
public void testInvalidOPFDcDate1()
{
Collections.addAll(expectedWarnings, MessageId.OPF_053);
- testValidateDocument("invalid/date-1.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/date-1.opf", EPUBVersion.VERSION_3);
}
@Test
public void testInvalidOPFDcDate2()
{
Collections.addAll(expectedWarnings, MessageId.OPF_053);
- testValidateDocument("invalid/date-2.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/date-2.opf", EPUBVersion.VERSION_3);
}
@Test
public void testInvalidOPFNullIdentifier()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/null-identifier.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("invalid/null-identifier.opf", EPUBVersion.VERSION_2);
}
@Test
public void testValidateDocumentValidOPFSvg()
{
- testValidateDocument("valid/lorem-svg.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/lorem-svg.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidOPFSvgFallback()
{
- testValidateDocument("valid/lorem-svg-fallback.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/lorem-svg-fallback.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentMalformed()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- Collections.addAll(expectedFatalErrors, MessageId.RSC_016);
- testValidateDocument("invalid/malformed.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedFatals, MessageId.RSC_016);
+ testValidateDocument("invalid/malformed.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNoMetadataElement()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- Collections.addAll(expectedFatalErrors, MessageId.RSC_016);
- testValidateDocument("invalid/noMetadataElement.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedFatals, MessageId.RSC_016);
+ testValidateDocument("invalid/noMetadataElement.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNoNav()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/noNav.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/noNav.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentInvalidMetaAbout()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/invalidMetaAbout.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/invalidMetaAbout.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNoDcNamespace()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- Collections.addAll(expectedFatalErrors, MessageId.RSC_016);
- testValidateDocument("invalid/noDcNamespace.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedFatals, MessageId.RSC_016);
+ testValidateDocument("invalid/noDcNamespace.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentBindings001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/bindings-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/bindings-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentCoverImage()
{
Collections.addAll(expectedErrors, MessageId.OPF_012, MessageId.RSC_005);
- testValidateDocument("invalid/cover-image.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/cover-image.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentFallback001()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.OPF_040);
- testValidateDocument("invalid/fallback-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/fallback-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentFallback002()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/fallback-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/fallback-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentIdUnique()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/id-unique.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/id-unique.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateDocumentIdUniqueWithSpaces()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/id-unique-spaces.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testId_WithSpaces()
+ {
+ testValidateDocument("valid/id-spaces.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentItemref001()
{
Collections.addAll(expectedErrors, MessageId.OPF_049, MessageId.RSC_005);
- testValidateDocument("invalid/itemref-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/itemref-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentMediaOverlay001()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/media-overlay-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("invalid/media-overlay-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentMediaOverlay002()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/media-overlay-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/media-overlay-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentMediaOverlayMeta001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/media-overlay-meta-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/media-overlay-meta-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentMinlegth()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
- MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/minlength.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/minlength.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentModifiedSyntax()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/modified-syntax.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/modified-syntax.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentForeign()
{
- Collections.addAll(expectedErrors, MessageId.OPF_010);
- testValidateDocument("invalid/foreign.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_006);
+ testValidateDocument("invalid/foreign.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentModified()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/modified.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/modified.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNav001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/nav-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/nav-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNav002()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/nav-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/nav-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentNav003()
{
Collections.addAll(expectedErrors, MessageId.OPF_012, MessageId.RSC_005);
- testValidateDocument("invalid/nav-003.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/nav-003.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentOrder()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/order.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/order.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentRefinesRelative()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/refines-relative.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/refines-relative.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentTocncx001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/tocncx-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/tocncx-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentTocncx002()
{
Collections.addAll(expectedErrors, MessageId.OPF_050, MessageId.RSC_005);
- testValidateDocument("invalid/tocncx-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/tocncx-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentUid001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/uid-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/uid-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentUid002()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/uid-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/uid-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentValidPrefixes()
{
- testValidateDocument("valid/prefixes.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/prefixes.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentPrefixes001()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.OPF_025);
- testValidateDocument("invalid/prefixes-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/prefixes-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentPrefixes002()
{
Collections.addAll(expectedErrors, MessageId.OPF_027);
- testValidateDocument("invalid/prefixes-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/prefixes-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentPrefixes003()
{
Collections.addAll(expectedErrors, MessageId.OPF_028);
- testValidateDocument("invalid/prefixes-003.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/prefixes-003.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentPrefixes004()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/prefixes-004.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/prefixes-004.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentScheme()
{
- testValidateDocument("valid/scheme-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("valid/scheme-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentInvalidScheme001()
{
Collections.addAll(expectedErrors, MessageId.OPF_027);
- testValidateDocument("invalid/scheme-001.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/scheme-001.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentInvalidScheme002()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.OPF_025);
- testValidateDocument("invalid/scheme-002.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/scheme-002.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentPrefixDeclaration()
{
Collections.addAll(expectedErrors, MessageId.OPF_004c, MessageId.OPF_004c);
- testValidateDocument("invalid/prefix-declaration.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/prefix-declaration.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateDocumentItemProperties()
{
Collections.addAll(expectedErrors, MessageId.OPF_012);
- testValidateDocument("invalid/item-properties.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/item-properties.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateDocumentItemNoMediaType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/item-nomediatype.opf", EPUBVersion.VERSION_3);
}
@Test
public void testValidateRedeclaredReservedPrefixes()
{
- Collections.addAll(expectedErrors, MessageId.OPF_007b, MessageId.OPF_007b);
- Collections.addAll(expectedWarnings, MessageId.OPF_007, MessageId.OPF_007);
- // should generate 2 warnings (redeclaration of reserved prefixes) and 1 error (redeclaration of default vocab)
- testValidateDocument("invalid/prefixes-redeclare.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedWarnings, MessageId.OPF_007, MessageId.OPF_007, MessageId.OPF_007b,
+ MessageId.OPF_007b);
+ // should generate 2 warnings (redeclaration of reserved prefixes and
+ // redeclaration of default vocab)
+ testValidateDocument("invalid/prefixes-redeclare.opf", EPUBVersion.VERSION_3);
}
@Test
public void testBadOPFNamespace20()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
- MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/bad-opf-namespace.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/bad-opf-namespace.opf", EPUBVersion.VERSION_2);
}
@Test
public void testBadOPFDupeID()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/dupe-id.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("invalid/dupe-id.opf", EPUBVersion.VERSION_2);
}
@Test
public void testOPF_Issue216()
{
- testValidateDocument("valid/issue216.opf", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("valid/issue216.opf", EPUBVersion.VERSION_2);
}
@Test
public void testFilenameInManifestContainsSpacesIssue239_EPUB2()
{
Collections.addAll(expectedWarnings, MessageId.PKG_010);
- testValidateDocument("invalid/filename_contains_spaces_issue239.opf", expectedErrors, expectedWarnings,
- EPUBVersion.VERSION_2);
+ testValidateDocument("invalid/filename_contains_spaces_issue239.opf", EPUBVersion.VERSION_2);
}
@Test
public void testFilenameInManifestContainsSpacesIssue239_EPUB3()
{
Collections.addAll(expectedWarnings, MessageId.PKG_010);
- testValidateDocument("invalid/filename_contains_spaces_issue239.opf", expectedErrors, expectedWarnings,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/filename_contains_spaces_issue239.opf", EPUBVersion.VERSION_3);
}
@Test
public void testMultipleDCTypes()
{
- testValidateDocument("valid/dc-type.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/dc-type.opf", EPUBVersion.VERSION_3);
}
@Test
public void testMultipleDCSource()
{
- testValidateDocument("valid/dc-source.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/dc-source.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testMetaRefinesCycle()
+ {
+ expectedErrors.add(MessageId.OPF_065);
+ testValidateDocument("invalid/meta-refines-cycle.opf", EPUBVersion.VERSION_3);
}
-
@Test
public void testMetaSourceOf()
{
- testValidateDocument("valid/meta-source-of.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/meta-source-of.opf", EPUBVersion.VERSION_3);
}
@Test
public void testMetaSourceOfWrongValue()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-source-of-wrongvalue.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/meta-source-of-wrongvalue.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testMetaSourceOfNoRefines()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-source-of-norefines.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/meta-source-of-norefines.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testMetaSourceWrongRefinesTarget()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-source-of-wrongrefines.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/meta-source-of-wrongrefines.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
- public void testRecordLink()
+ public void testLink_Record()
{
- testValidateDocument("valid/link-rel-record.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/link-rel-record.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
- public void testRecordLinkNoMediaType()
+ public void testLink_RecordNoMediaType()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/link-rel-record-no-mediatype.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/link-rel-record-no-mediatype.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
- public void testRecordLinkWithRefines()
+ public void testLink_RecordWithRefines()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/link-rel-record-refines.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/link-rel-record-refines.opf", EPUBVersion.VERSION_3);
}
-
+
+ @Test
+ public void testLink_ResourceInManifest()
+ {
+ expectedErrors.add(MessageId.OPF_067);
+ testValidateDocument("invalid/link-in-manifest.opf", EPUBVersion.VERSION_3);
+ }
+
@Test
public void testMetaBelongsToCollection()
{
- testValidateDocument("valid/meta-collection.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/meta-collection.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testMetaBelongsToCollectionWrongRefines()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-collection-refine-noncollection.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/meta-collection-refine-noncollection.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testMetaCollectionTypeNoRefines()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-collection-type-norefines.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/meta-collection-type-norefines.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testMetaCollectionTypeWrongRefines()
{
expectedErrors.add(MessageId.RSC_005);
- testValidateDocument("invalid/meta-collection-type-refines-noncollection.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
+ testValidateDocument("invalid/meta-collection-type-refines-noncollection.opf",
EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionPropertiesValid()
{
- testValidateDocument("valid/rendition-properties.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/rendition-properties.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionGlobalsValid()
{
- testValidateDocument("valid/rendition-globals.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("valid/rendition-globals.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionGlobalsWithRefines()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/rendition-globals-refines.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("invalid/rendition-globals-refines.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionGlobalsDuplicated()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/rendition-globals-duplicate.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/rendition-globals-duplicate.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionGlobalsBadValues()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/rendition-globals-badvalues.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/rendition-globals-badvalues.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testRenditionOverridesConflicts()
{
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- testValidateDocument("invalid/rendition-globals-badvalues.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/rendition-globals-badvalues.opf", EPUBVersion.VERSION_3);
}
-
+
@Test
- public void testCollectionValid() {
- testValidateDocument("valid/collection-valid-001.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
- testValidateDocument("valid/collection-valid-002.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ public void testCollection_Preview()
+ {
+ testValidateDocument("valid/collection-preview.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_Unknown()
+ {
+ expectedErrors.add(MessageId.OPF_068);
+ testValidateDocument("invalid/collection-unknown-role.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_Foreign()
+ {
+ testValidateDocument("valid/collection-foreign.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_ForeignInvalid_idpforg()
+ {
+ expectedErrors.add(MessageId.OPF_069);
+ testValidateDocument("invalid/collection-foreign-idpf.org.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_ForeignInvalid_BadURI()
+ {
+ expectedWarnings.add(MessageId.OPF_070);
+ testValidateDocument("invalid/collection-foreign-invalid-uri.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_DO()
+ {
+ testValidateDocument("valid/collection-do.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_DOInvalid()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/collection-invalid-do-sch-001.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testCollection_ManifestInvalid_TopLevel()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/collection-manifest-toplevel.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testMetaSchemaOrg()
+ {
+ testValidateDocument("valid/meta-schemaorg.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testEdupub()
+ {
+ testValidateDocument("valid/edupub-minimal.opf", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_Teacher()
+ {
+ testValidateDocument("valid/edupub-teacher-edition.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_InvalidDCType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-missing-dc-type.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_InvalidNoAccessFeature()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-no-accessFeature.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_InvalidAccessFeatureNone()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-accessFeature-none.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_InvalidTeacherNoDCType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/edupub-teacher-edition-no-dc-type.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupub_InvalidTeacherNoSource()
+ {
+ Collections.addAll(expectedWarnings, MessageId.RSC_017);
+ testValidateDocument("invalid/edupub-teacher-edition-nosource.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testSC_Embedded()
+ {
+ testValidateDocument("valid/sc-embedded.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_Collection()
+ {
+ testValidateDocument("valid/idx-collection.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_CollectionWithSubGroup()
+ {
+ testValidateDocument("valid/idx-collection-indexgroup.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_CollectionInvalid_ChildNoIndexGroup()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/idx-collection-invalidchild.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_CollectionInvalid_TopLevelIndexGroup()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/idx-collection-toplevel-indexgroup.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_CollectionInvalid_IndexGroupWithChild()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/idx-collection-indexgroup-withchild.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIDX_CollectionInvalid_ResourceNotContentDoc()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_071, MessageId.OPF_071);
+ testValidateDocument("invalid/idx-collection-resource-noxhtml.opf", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testDict_Single()
+ {
+ testValidateDocument("valid/dict-single.opf", EPUBVersion.VERSION_3, EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Single_NoSKM()
+ {
+ // No SKM Doc
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-single-noskm.opf", EPUBVersion.VERSION_3, EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Single_NoSKM_2()
+ {
+ // SKM doc missing a required property
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-single-noskm-2.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple()
+ {
+ testValidateDocument("valid/dict-multiple.opf", EPUBVersion.VERSION_3, EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple_NoSKM()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_083);
+ testValidateDocument("invalid/dict-multiple-noskm.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple_CollectionWithMultipleSKMs()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_082);
+ testValidateDocument("invalid/dict-multiple-morethanoneskm.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple_CollectionSharingSKM()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-multiple-sharedskm.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple_CollectionContainingMissingResource()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_081);
+ testValidateDocument("invalid/dict-multiple-missingresource.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
}
@Test
- public void testCollectionManifestInvalid() {
+ public void testDict_Multiple_CollectionContainingNonXHTML()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_084);
+ testValidateDocument("invalid/dict-multiple-nonxhtml.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Multiple_CollectionWithSubCollection()
+ {
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/collection-invalid-manifest-001.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/dict-multiple-subcollection.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_NoDCType()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-nodctype.opf", EPUBVersion.VERSION_3, EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_SKM_BadMediaType()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_012);
+ testValidateDocument("invalid/dict-skm-badmediatype.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_InCollection()
+ {
+ testValidateDocument("valid/dict-multiple-dedicatedlang.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_InvalidInCollection()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-invalidcollection.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_InvalidInTopLevel()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-invalidtoplevel.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_MissingInCollection()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-missingcollection.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_MissingTopLevel()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-missingtoplevel.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_UndeclaredInCollection()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-undeclaredcollection.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
+ }
+
+ @Test
+ public void testDict_Lang_UndeclaredTopLevel()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("invalid/dict-lang-undeclaredtoplevel.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
}
@Test
- public void testDOValid() {
- testValidateDocument("valid/collection-valid-do-001.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ public void testDict_Type()
+ {
+ testValidateDocument("valid/dict-single-typed.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
}
@Test
- public void testDOInvalid() {
+ public void testDict_Type_Unknown()
+ {
Collections.addAll(expectedErrors, MessageId.RSC_005);
- testValidateDocument("invalid/collection-invalid-do-sch-001.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ testValidateDocument("invalid/dict-type-unknown.opf", EPUBVersion.VERSION_3,
+ EPUBProfile.DICT);
}
-
+
@Test
- public void testMetaSchemaOrg() {
- testValidateDocument("valid/meta-schemaorg.opf", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3);
+ public void testManifest_DuplicateResource()
+ {
+ Collections.addAll(expectedErrors, MessageId.OPF_074);
+ testValidateDocument("invalid/manifest-duplicate-resource.opf", EPUBVersion.VERSION_3);
}
+
}
diff --git a/src/test/java/com/adobe/epubcheck/ops/OPSCheckerTest.java b/src/test/java/com/adobe/epubcheck/ops/OPSCheckerTest.java
index 0047b9b..5afc611 100644
--- a/src/test/java/com/adobe/epubcheck/ops/OPSCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/ops/OPSCheckerTest.java
@@ -26,13 +26,16 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
+import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBProfile;
import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.ExtraReportTest;
import com.adobe.epubcheck.util.FileResourceProvider;
@@ -46,35 +49,50 @@ import com.adobe.epubcheck.util.outWriter;
public class OPSCheckerTest
{
- public void testValidateDocument(String fileName, String mimeType,
- List<MessageId> errors, List<MessageId> warnings, EPUBVersion version)
+ List<MessageId> expectedErrors = new LinkedList<MessageId>();
+ List<MessageId> expectedWarnings = new LinkedList<MessageId>();
+ List<MessageId> expectedFatals = new LinkedList<MessageId>();
+
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version)
{
- testValidateDocument(fileName, mimeType, errors, warnings, new ArrayList<MessageId>(), version, false);
+ testValidateDocument(fileName, mimeType, version, false);
}
- public void testValidateDocument(String fileName, String mimeType,
- List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, EPUBVersion version)
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ boolean verbose)
{
- testValidateDocument(fileName, mimeType, errors, warnings, fatalErrors, version, false);
+ testValidateDocument(fileName, mimeType, version, verbose, null);
+ }
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ EPUBProfile profile)
+ {
+ testValidateDocument(fileName, mimeType, version, profile, false);
}
-
- public void testValidateDocument(String fileName, String mimeType,
- List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, EPUBVersion version, boolean verbose)
+
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ EPUBProfile profile, boolean verbose)
+ {
+ testValidateDocument(fileName, mimeType, version, profile, verbose, null);
+ }
+
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ ExtraReportTest extraTest)
{
- testValidateDocument(fileName, mimeType, errors, warnings, fatalErrors, version, verbose, null);
- }
+ testValidateDocument(fileName, mimeType, version, false, extraTest);
+ }
- public void testValidateDocument(String fileName, String mimeType,
- List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, EPUBVersion version, ExtraReportTest extraTest)
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ boolean verbose, ExtraReportTest extraTest)
{
- testValidateDocument(fileName, mimeType, errors, warnings, fatalErrors, version, false, extraTest);
+ testValidateDocument(fileName, mimeType, version, EPUBProfile.DEFAULT, verbose, extraTest);
}
- public void testValidateDocument(String fileName, String mimeType,
- List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, EPUBVersion version, boolean verbose, ExtraReportTest extraTest)
+ public void testValidateDocument(String fileName, String mimeType, EPUBVersion version,
+ EPUBProfile profile, boolean verbose, ExtraReportTest extraTest)
{
- ValidationReport testReport = new ValidationReport(fileName, String.format(Messages.get("single_file"), mimeType, version));
+ ValidationReport testReport = new ValidationReport(fileName,
+ String.format(Messages.get("single_file"), mimeType, version, profile));
String basepath = null;
if (version == EPUBVersion.VERSION_2)
{
@@ -97,8 +115,9 @@ public class OPSCheckerTest
resourceProvider = new FileResourceProvider(filePath);
}
- OPSChecker opsChecker = new OPSChecker(basepath + fileName, mimeType,
- resourceProvider, testReport, version);
+ OPSChecker opsChecker = new OPSChecker(new ValidationContextBuilder().path(basepath + fileName)
+ .mimetype(mimeType).resourceProvider(resourceProvider).report(testReport).version(version)
+ .profile(profile).build());
opsChecker.validate();
@@ -107,613 +126,720 @@ public class OPSCheckerTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", errors, testReport.getErrorIds());
- assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
- if (extraTest != null)
+ assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
+ assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
+ testReport.getFatalErrorIds());
+ if (extraTest != null)
{
- extraTest.test(testReport);
- }
+ extraTest.test(testReport);
+ }
+ }
+
+ @Before
+ public void setup()
+ {
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test
public void testValidateSVGRectInvalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("svg/invalid/rect.svg", "image/svg+xml", expectedErrors, expectedWarnings,
- EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("svg/invalid/rect.svg", "image/svg+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateSVGRectValid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("svg/valid/rect.svg", "image/svg+xml", expectedErrors, expectedWarnings,
- EPUBVersion.VERSION_3);
+ testValidateDocument("svg/valid/rect.svg", "image/svg+xml", EPUBVersion.VERSION_3);
}
-
+
@Test
public void testValidateXHTMLEdits001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/edits-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/edits-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLEmbed001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- // Collections.addAll(expectedErrors, );
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/embed-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/embed-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLForms001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/forms-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/forms-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLGlobalAttrs001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/global-attrs-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, false);
+ testValidateDocument("xhtml/valid/global-attrs-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, false);
}
@Test
public void testValidateXHTMLOps001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ops-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ops-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLOPSMATHML001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ops-mathml-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ops-mathml-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLLINK()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/link.xhtml", "application/xhtml+xml",
- expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/link.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLLINKInvalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_027, MessageId.CSS_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/link.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/link.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLXml11()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.HTM_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/xml11.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/xml11.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLOPSMATHML002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ops-mathml-002.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ops-mathml-002.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLOPSSVG001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ops-svg-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ops-svg-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLOPSSVG002()
{
- //assure that epub:type is allowed on svg elements
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ops-svg-002.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, true);
+ // assure that epub:type is allowed on svg elements
+ testValidateDocument("xhtml/valid/ops-svg-002.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, false);
}
-
+
@Test
public void testValidateXHTMLRuby001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ruby-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ruby-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLCanvas()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/canvas.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/canvas.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLInvalidCanvasFallback()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.MED_002);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/canvas-fallback.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/canvas-fallback.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLSCH001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/sch-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/sch-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLSections001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/sections-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/sections-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLSSML()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/ssml.xhtml", "application/xhtml+xml",
- expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/ssml.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLStyle001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/style-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/style-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLStyle002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.CSS_008);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/style-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/style-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLSwitch001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/switch-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/switch-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLTables001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/tables-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/tables-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLText001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/text-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/text-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLTrigger()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/trigger.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/trigger.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLData()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/data.xhtml", "application/xhtml+xml",
- expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/data.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLPrefixes001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/prefixes-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/prefixes-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLInvalidPrefixes001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.OPF_028, MessageId.OPF_027);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/prefixes-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/prefixes-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLVideo()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/video.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/video.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_OPSMATHML001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/ops-mathml-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/ops-mathml-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_OPSMATHML002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/ops-mathml-002.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/ops-mathml-002.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_SCH001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- //Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.MED_002, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_ [...]
- //mgy not sure what happened here, removed the first entry to make it pass
- Collections.addAll(expectedErrors, MessageId.MED_002, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_00 [...]
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatalErrors = new ArrayList<MessageId>();
-
- testValidateDocument("xhtml/invalid/sch-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatalErrors,
- EPUBVersion.VERSION_3,false,new ExtraReportTest() {
- @Override
- public void test(ValidationReport testReport) {
- for (ItemReport error : testReport.errorList) {
- assertTrue("Error '"+error.message+"' has no line number.",error.line != -1);
- assertTrue("Error '"+error.message+"' has no column number.",error.column != -1);
- }
- }
- });
+ // Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.MED_002,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ // MessageId.RSC_005);
+ // mgy not sure what happened here, removed the first entry to make it pass
+ Collections.addAll(expectedErrors, MessageId.MED_002, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+
+ testValidateDocument("xhtml/invalid/sch-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, false, new ExtraReportTest()
+ {
+ @Override
+ public void test(ValidationReport testReport)
+ {
+ for (ItemReport error : testReport.errorList)
+ {
+ assertTrue("Error '" + error.message + "' has no line number.", error.line != -1);
+ assertTrue("Error '" + error.message + "' has no column number.", error.column != -1);
+ }
+ }
+ });
}
@Test
public void testValidateXHTML_SVG001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/svg-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/svg-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_Switch001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/switch-001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005);
+
+ testValidateDocument("xhtml/invalid/switch-001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_Trigger()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/trigger.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/trigger.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_UnresolvedDTD()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.HTM_004, MessageId.RSC_001);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ops/invalid/unresolved-entity.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ Collections.addAll(expectedErrors, MessageId.HTM_004);
+ testValidateDocument("ops/invalid/unresolved-entity.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
}
@Test
public void testValidateXHTML_DupeID()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ops/invalid/dupe-id.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("ops/invalid/dupe-id.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
+ }
+
+ @Test
+ public void testValidateXHTML_DupeID_EPUB3()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/duplicate-id.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_httpequiv1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/http-equiv-1.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/http-equiv-1.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_httpequiv2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/http-equiv-1.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/http-equiv-1.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTML_httpequivInvalidMetaSibling()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/http-equiv-2.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_SSMLemptyPh()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.HTM_007, MessageId.HTM_007);
- testValidateDocument("xhtml/invalid/ssml-empty-ph.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/ssml-empty-ph.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_issue153_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/issue153.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/issue153.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_issue153_invalid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/issue153.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/issue153.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_issue166_valid()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ops/valid/svg-foreignObject.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("ops/valid/svg-foreignObject.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
}
@Test
public void testValidateXHTML_doctype1_obsolete()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.HTM_004);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/doctype-1.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/doctype-1.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_doctype1()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //<!DOCTYPE html>
- testValidateDocument("xhtml/valid/doctype-1.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ // <!DOCTYPE html>
+ testValidateDocument("xhtml/valid/doctype-1.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTML_doctype2()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //<!DOCTYPE html SYSTEM "about:legacy-compat">
- testValidateDocument("xhtml/valid/doctype-2.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ // <!DOCTYPE html SYSTEM "about:legacy-compat">
+ testValidateDocument("xhtml/valid/doctype-2.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLIssue204()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
Collections.addAll(expectedWarnings, MessageId.HTM_025);
- testValidateDocument("xhtml/valid/issue204.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/issue204.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLStyleAttr001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/styleAttr001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/valid/styleAttr001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLStyleAttr002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.CSS_008);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/styleAttr001.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("xhtml/invalid/styleAttr001.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
// this test should validate, see issue 173, need to wait for schema update.
-// @Test
-// public void testValidateXHTMLSVGwithRDF() {
-// testValidateDocument("xhtml/valid/svg-rdf-001.xhtml",
-// "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3, true);
-// }
+ // @Test
+ // public void testValidateXHTMLSVGwithRDF() {
+ // testValidateDocument("xhtml/valid/svg-rdf-001.xhtml",
+ // "application/xhtml+xml",
+ // EPUBVersion.VERSION_3, true);
+ // }
@Test
public void testValidateSVGIssue196()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ops/valid/svg-font-face.svg",
- "image/svg+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("ops/valid/svg-font-face.svg", "image/svg+xml", EPUBVersion.VERSION_2);
}
@Test
public void testValidateXHTMLIssue215()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("ops/valid/issue215.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ testValidateDocument("ops/valid/issue215.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
}
@Test
public void testValidateSVGIssue219()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("svg/valid/issue219.svg",
- "image/svg+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
+ testValidateDocument("svg/valid/issue219.svg", "image/svg+xml", EPUBVersion.VERSION_3);
}
@Test
public void testValidateXHTMLIssue222_223_20()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //foreignObject allowed outside switch, and <body> allowed inside
- testValidateDocument("ops/valid/issue222.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_2);
+ // foreignObject allowed outside switch, and <body> allowed inside
+ testValidateDocument("ops/valid/issue222.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
}
@Test
public void testValidateXHTMLIssue222_223_30()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- //in 3.0 foreignObject content must be flow as per
- //http://idpf.org/epub/30/spec/epub30-contentdocs.html#confreq-svg-foreignObject
- //so the document gives 1 error
- testValidateDocument("svg/valid/issue222.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
- }
-
- @Test
- public void testValidateXHTMLIssue248() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/issue248.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, EPUBVersion.VERSION_3);
- }
-
- @Test
- public void testValidateXHTML301RDFaValid() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/rdfa.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, false, null);
- }
-
- @Test
- public void testValidateXHTML301MDValid() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/md.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, true, null);
- }
-
- @Test
- public void testValidateXHTML301MDInvalid() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
+ // in 3.0 foreignObject content must be flow as per
+ // http://idpf.org/epub/30/spec/epub30-contentdocs.html#confreq-svg-foreignObject
+ // so the document gives 1 error
+ testValidateDocument("svg/valid/issue222.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue248()
+ {
+ testValidateDocument("xhtml/valid/issue248.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue282_ObjectTypemustmatch()
+ {
+ testValidateDocument("xhtml/valid/issue282-object-typemustmatch.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue287_NestedHyperlink()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("ops/invalid/issue287-nested-hyperlink.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue288_InvalidURI()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_020);
+ testValidateDocument("xhtml/invalid/issue288-invalid-uri.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue293()
+ {
+ testValidateDocument("ops/valid/issue293-edits-elem-attributes.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_2);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue296()
+ {
+ testValidateDocument("xhtml/valid/issue296-irc-uri.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue340()
+ {
+ testValidateDocument("xhtml/valid/issue340.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue341()
+ {
+ testValidateDocument("xhtml/valid/issue341.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTMLIssue355()
+ {
+ testValidateDocument("xhtml/valid/issue355.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTML301RDFaValid()
+ {
+ testValidateDocument("xhtml/valid/rdfa.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTML301MDValid()
+ {
+ testValidateDocument("xhtml/valid/md.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTML301MDInvalid()
+ {
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/invalid/md.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, false, null);
- }
-
- @Test
- public void testValidateXHTML301CustomAttributes() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/custom-ns-attrs.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, false, null);
- }
-
- @Test
- public void testValidateXHTML301AriaDescribedAt() {
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- List<MessageId> expectedFatals = new ArrayList<MessageId>();
- testValidateDocument("xhtml/valid/aria-describedAt.xhtml",
- "application/xhtml+xml", expectedErrors, expectedWarnings, expectedFatals, EPUBVersion.VERSION_3, false, null);
+ testValidateDocument("xhtml/invalid/md.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testValidateXHTML301CustomAttributes()
+ {
+ testValidateDocument("xhtml/valid/custom-ns-attrs.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
}
+
+ @Test
+ public void testValidateXHTML301AriaDescribedAt()
+ {
+ testValidateDocument("xhtml/valid/aria-describedAt.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testEdupubSectioning_ExplicitBody()
+ {
+ testValidateDocument("xhtml/valid/edupub-sectioning-explicit-body.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_ExplicitSections()
+ {
+ testValidateDocument("xhtml/valid/edupub-sectioning-explicit-sections.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_ImplicitBody()
+ {
+ testValidateDocument("xhtml/valid/edupub-sectioning-implicit-body.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_Subtitle()
+ {
+ testValidateDocument("xhtml/valid/edupub-sectioning-subtitle.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_Invalid()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_InvalidExplicitBody()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning-explicit-body.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_InvalidImplicitBody()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning-implicit-body.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_InvalidImplicitBodyAriaHeading()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning-implicit-body-aria-heading.xhtml",
+ "application/xhtml+xml", EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_InvalidSubtitle()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning-subtitle.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupubSectioning_InvalidAriaLabel()
+ {
+ // aria-label MUST NOT be equal to heading content
+ // 2 errors: one on body and one on sub-section
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-sectioning-arialabel-heading.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupupHeaading_ImgWithAltText()
+ {
+ testValidateDocument("xhtml/valid/edupub-heading-img.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testEdupupHeaading_ImgWithEmptyAltText()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/edupub-heading-imgnoalt.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.EDUPUB);
+ }
+
+ @Test
+ public void testMathML()
+ {
+ testValidateDocument("xhtml/valid/mathml.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3);
+ }
+
+ @Test
+ public void testIndex()
+ {
+ testValidateDocument("xhtml/valid/index.xhtml", "application/xhtml+xml", EPUBVersion.VERSION_3,
+ EPUBProfile.IDX);
+ }
+
+ @Test
+ public void testIndex_NoIndex()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/index-noindex.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.IDX);
+ }
+
+ @Test
+ public void testIndex_IndexNotOnBody()
+ {
+ Collections.addAll(expectedErrors, MessageId.RSC_005);
+ testValidateDocument("xhtml/invalid/index-notonbody.xhtml", "application/xhtml+xml",
+ EPUBVersion.VERSION_3, EPUBProfile.IDX);
+ }
+
}
diff --git a/src/test/java/com/adobe/epubcheck/overlay/OverlayCheckerTest.java b/src/test/java/com/adobe/epubcheck/overlay/OverlayCheckerTest.java
index ace1097..1c705a3 100644
--- a/src/test/java/com/adobe/epubcheck/overlay/OverlayCheckerTest.java
+++ b/src/test/java/com/adobe/epubcheck/overlay/OverlayCheckerTest.java
@@ -22,36 +22,44 @@
package com.adobe.epubcheck.overlay;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.util.*;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
-import static org.junit.Assert.assertEquals;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.adobe.epubcheck.api.EPUBProfile;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
+import com.adobe.epubcheck.util.EPUBVersion;
+import com.adobe.epubcheck.util.FileResourceProvider;
+import com.adobe.epubcheck.util.GenericResourceProvider;
+import com.adobe.epubcheck.util.Messages;
+import com.adobe.epubcheck.util.URLResourceProvider;
+import com.adobe.epubcheck.util.ValidationReport;
+import com.adobe.epubcheck.util.outWriter;
public class OverlayCheckerTest
{
private static String basepath = "/30/single/overlays/";
+ private List<MessageId> expectedWarnings = new LinkedList<MessageId>();
+ private List<MessageId> expectedErrors = new LinkedList<MessageId>();
+ private List<MessageId> expectedFatals = new LinkedList<MessageId>();
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings)
+ public void testValidateDocument(String fileName)
{
- testValidateDocument(fileName, errors, warnings, new ArrayList<MessageId>(), false);
+ testValidateDocument(fileName,false);
}
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors)
- {
- testValidateDocument(fileName, errors, warnings, fatalErrors, false);
- }
-
- public void testValidateDocument(String fileName, List<MessageId> errors, List<MessageId> warnings, List<MessageId> fatalErrors, boolean verbose)
+ public void testValidateDocument(String fileName, boolean verbose)
{
ValidationReport testReport = new ValidationReport(fileName, String.format(
- Messages.get("single_file"), "media overlay", "3.0"));
+ Messages.get("single_file"), "media overlay", EPUBVersion.VERSION_3, EPUBProfile.DEFAULT));
GenericResourceProvider resourceProvider;
if (fileName.startsWith("http://") || fileName.startsWith("https://"))
@@ -65,8 +73,9 @@ public class OverlayCheckerTest
resourceProvider = new FileResourceProvider(filePath);
}
- OverlayChecker overlayChecker = new OverlayChecker(basepath + fileName, resourceProvider,
- testReport);
+ OverlayChecker overlayChecker = new OverlayChecker(new ValidationContextBuilder()
+ .mimetype("application/smil+xml").path(basepath + fileName)
+ .resourceProvider(resourceProvider).report(testReport).build());
overlayChecker.validate();
@@ -75,94 +84,85 @@ public class OverlayCheckerTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", errors, testReport.getErrorIds());
- assertEquals("The warning results do not match", warnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", fatalErrors, testReport.getFatalErrorIds());
+ assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
+ assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
+ testReport.getFatalErrorIds());
+ }
+
+ @Before
+ public void setup()
+ {
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test
public void testValidateDocumentValidOverlay001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/overlay-001.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/overlay-001.smil");
}
@Test
public void testValidateDocumentValidOverlay002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/overlay-002.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/overlay-002.smil");
}
@Test
public void testValidateDocumentValidOverlay003()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/overlay-003.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/overlay-003.smil");
}
@Test
public void testValidateDocumentInvalidOverlay001()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-001.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/overlay-001.smil");
}
@Test
public void testValidateDocumentInvalidOverlay002()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-002.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/overlay-002.smil");
}
@Test
public void testValidateDocumentInvalidOverlay003()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-003.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/overlay-003.smil");
}
@Test
public void testValidateDocumentInvalidOverlay004()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-004.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("invalid/overlay-004.smil");
}
@Test
public void testValidateDocumentInvalidOverlay005()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-005.smil", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005,
+ MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005, MessageId.RSC_005);
+ testValidateDocument("invalid/overlay-005.smil");
}
@Test
public void testValidateDocumentInvalidOverlay006()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- Collections.addAll(expectedErrors, MessageId.OPF_027, MessageId.OPF_027, MessageId.OPF_028, MessageId.OPF_027, MessageId.OPF_027);
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("invalid/overlay-006.smil", expectedErrors, expectedWarnings);
+ Collections.addAll(expectedErrors, MessageId.OPF_027, MessageId.OPF_027, MessageId.OPF_028,
+ MessageId.OPF_027, MessageId.OPF_027);
+ testValidateDocument("invalid/overlay-006.smil");
}
@Test
public void testValidateDocumentValidOverlay007()
{
- List<MessageId> expectedErrors = new ArrayList<MessageId>();
- List<MessageId> expectedWarnings = new ArrayList<MessageId>();
- testValidateDocument("valid/overlay-007.smil", expectedErrors, expectedWarnings);
+ testValidateDocument("valid/overlay-007.smil");
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/OutputDifferenceListener.java b/src/test/java/com/adobe/epubcheck/test/OutputDifferenceListener.java
index 5ef59a5..681d7b2 100644
--- a/src/test/java/com/adobe/epubcheck/test/OutputDifferenceListener.java
+++ b/src/test/java/com/adobe/epubcheck/test/OutputDifferenceListener.java
@@ -43,7 +43,10 @@ public class OutputDifferenceListener implements DifferenceListener
if (expectedXPath.equals("/jhove[1]/@release")
|| expectedXPath.equals("/jhove[1]/@date")
|| expectedXPath.equals("/jhove[1]/date[1]/text()[1]")
- || expectedXPath.equals("/jhove[1]/repInfo[1]/@uri"))
+ || expectedXPath.equals("/jhove[1]/repInfo[1]/@uri")
+ || expectedXPath.equals("/xmpmeta[1]/RDF[1]/Description[1]/hasEvent[1]/hasEventDateTime[1]/text()[1]")
+ || expectedXPath.equals("/xmpmeta[1]/RDF[1]/Description[1]/hasEvent[1]/hasEventRelatedAgent[1]/hasAgentName[1]/text()[1]")
+ )
{
return DifferenceListener.RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR;
}
diff --git a/src/test/java/com/adobe/epubcheck/test/TestRunListener.java b/src/test/java/com/adobe/epubcheck/test/TestRunListener.java
index 2fbd6f4..a65d503 100644
--- a/src/test/java/com/adobe/epubcheck/test/TestRunListener.java
+++ b/src/test/java/com/adobe/epubcheck/test/TestRunListener.java
@@ -1,18 +1,19 @@
package com.adobe.epubcheck.test;
-import com.adobe.epubcheck.api.MasterReport;
-import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.util.outWriter;
-import org.junit.runner.Description;
-import org.junit.runner.Result;
-import org.junit.runner.notification.RunListener;
-
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import org.junit.runner.Description;
+import org.junit.runner.Result;
+import org.junit.runner.notification.RunListener;
+
+import com.adobe.epubcheck.api.MasterReport;
+import com.adobe.epubcheck.messages.MessageId;
+import com.adobe.epubcheck.util.outWriter;
+
public class TestRunListener extends RunListener
{
@Override
diff --git a/src/test/java/com/adobe/epubcheck/test/command_line_Test.java b/src/test/java/com/adobe/epubcheck/test/command_line_Test.java
index a4d5f96..c472937 100644
--- a/src/test/java/com/adobe/epubcheck/test/command_line_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/command_line_Test.java
@@ -13,9 +13,11 @@ import junit.framework.Assert;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Test;
import com.adobe.epubcheck.api.EpubCheck;
+import com.adobe.epubcheck.test.common.TestOutputType;
import com.adobe.epubcheck.tool.Checker;
import com.adobe.epubcheck.util.CheckUtil;
import com.adobe.epubcheck.util.HandlerUtil;
@@ -173,6 +175,7 @@ public class command_line_Test
@Test
+ @Ignore // too cumbersome to maintain
public void SeveritiesList_Test()
{
//public static void runCustomTest(String epubName, String componentName, String testName, int expectedReturnCode, String... args)
@@ -206,13 +209,19 @@ public class command_line_Test
@Test
public void jsonfile_Test()
{
- common.runExpTest("command_line", "jsonfile", 0, true, true, new String[0]);
+ common.runExpTest("command_line", "jsonfile", 0, TestOutputType.JSON, true, new String[0]);
}
@Test
public void xmlfile_Test()
{
- common.runExpTest("command_line", "xmlfile", 0, false, true, new String[0]);
+ common.runExpTest("command_line", "xmlfile", 0, TestOutputType.XML, true, new String[0]);
+ }
+
+ @Test
+ public void xmpfile_Test()
+ {
+ common.runExpTest("command_line", "xmlfile", 0, TestOutputType.XMP, true, new String[0]);
}
@Test
@@ -225,7 +234,7 @@ public class command_line_Test
public static void runExtraCommandLineArgTest(String testName, int expectedReturnCode, String[] extraArgs)
{
- common.runExpTest("command_line", testName, expectedReturnCode, true, false, extraArgs);
+ common.runExpTest("command_line", testName, expectedReturnCode, TestOutputType.JSON, false, extraArgs);
}
public static void runSeverityTest(String epubName, String componentName, String testName, int expectedReturnCode, String... args)
diff --git a/src/test/java/com/adobe/epubcheck/test/common.java b/src/test/java/com/adobe/epubcheck/test/common.java
index 48c39d2..2e0f2bf 100644
--- a/src/test/java/com/adobe/epubcheck/test/common.java
+++ b/src/test/java/com/adobe/epubcheck/test/common.java
@@ -17,15 +17,22 @@ import java.util.List;
public class common
{
- public static void runExpTest(String componentName, String testName, int expectedReturnCode, boolean isJson)
+ public enum TestOutputType { JSON, XML, XMP };
+
+ public static void runExpTest(String componentName, String testName, int expectedReturnCode, TestOutputType testOutput)
{
- runExpTest(componentName, testName, expectedReturnCode, isJson, false, new String[0]);
+ runExpTest(componentName, testName, expectedReturnCode, testOutput, false, new String[0]);
}
- public static void runExpTest(String componentName, String testName, int expectedReturnCode, boolean isJson, boolean useNullOutputPath, String... extraArgs)
+ public static void runExpTest(String componentName, String testName, int expectedReturnCode, TestOutputType testOutput, boolean useNullOutputPath, String... extraArgs)
{
ArrayList<String> args = new ArrayList<String>();
- String extension = isJson ? "json" : "xml";
+ String extension = "json";
+ switch (testOutput) {
+ case JSON : extension = "json"; break;
+ case XML : extension = "xml"; break;
+ case XMP : extension = "xmp"; break;
+ }
int extraArgsLength = extraArgs != null ? extraArgs.length : 0;
URL inputUrl = common.class.getResource(componentName + "/" + testName);
Assert.assertNotNull("Input folder is missing.", inputUrl);
@@ -39,7 +46,11 @@ public class common
{
args.add(extraArgs[j]);
}
- args.add((isJson) ? "-j" : "-o");
+ switch (testOutput) {
+ case JSON : args.add("-j"); break;
+ case XML : args.add("-o"); break;
+ case XMP : args.add("-x"); break;
+ }
if (!useNullOutputPath && outputPath != null && !outputPath.isEmpty())
{
args.add(outputPath);
@@ -52,13 +63,10 @@ public class common
Assert.assertNotNull("Expected file is missing.", expectedUrl);
File expectedOutput = new File(expectedUrl.getPath());
Assert.assertTrue("Expected file is missing.", expectedOutput.exists());
- if (isJson)
- {
- compareJson(expectedOutput, actualOutput);
- }
- else
- {
- compareXml(expectedOutput, actualOutput);
+ switch (testOutput) {
+ case JSON : compareJson(expectedOutput, actualOutput); break;
+ case XML : compareXml(expectedOutput, actualOutput); break;
+ case XMP : compareXml(expectedOutput, actualOutput); break;
}
File tempFile = new File(testName + ".epub");
Assert.assertFalse("Temp file left over after test: " + tempFile.getPath(), tempFile.exists());
@@ -165,6 +173,7 @@ public class common
if (!diff.similar())
{
DetailedDiff details = new DetailedDiff(diff);
+ @SuppressWarnings("rawtypes")
List differences = details.getAllDifferences();
StringBuilder sb = new StringBuilder();
for (Object difference : differences)
diff --git a/src/test/java/com/adobe/epubcheck/test/css_Test.java b/src/test/java/com/adobe/epubcheck/test/css_Test.java
index afc90d0..1bc00ea 100644
--- a/src/test/java/com/adobe/epubcheck/test/css_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/css_Test.java
@@ -4,6 +4,8 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.test.common.TestOutputType;
+
public class css_Test
{
private SecurityManager originalManager;
@@ -51,6 +53,12 @@ public class css_Test
runCSSJsonTest("font-face", 1);
}
+ @Test
+ public void font_face_xmp_Test() throws Exception
+ {
+ runCSSXmpTest("font-face", 1);
+ }
+
// @Test
public void unused_epub3_Test() throws Exception
{
@@ -123,13 +131,24 @@ public class css_Test
runCSSXmlTest("font_encryption_idpf", 0);
}
+ @Test
+ public void font_encryption_idpf_xmp_Test() throws Exception
+ {
+ runCSSXmpTest("font_encryption_idpf", 0);
+ }
+
private void runCSSJsonTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("css", testName, expectedReturnCode, true);
+ common.runExpTest("css", testName, expectedReturnCode, TestOutputType.JSON);
}
private void runCSSXmlTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("css", testName, expectedReturnCode, false);
+ common.runExpTest("css", testName, expectedReturnCode, TestOutputType.XML);
+ }
+
+ private void runCSSXmpTest(String testName, int expectedReturnCode) throws Exception
+ {
+ common.runExpTest("css", testName, expectedReturnCode, TestOutputType.XMP);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/dtBook_Test.java b/src/test/java/com/adobe/epubcheck/test/dtBook_Test.java
index 9c46ff5..0c7ff6f 100644
--- a/src/test/java/com/adobe/epubcheck/test/dtBook_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/dtBook_Test.java
@@ -2,6 +2,8 @@ package com.adobe.epubcheck.test;
import org.junit.*;
+import com.adobe.epubcheck.test.common.TestOutputType;
+
public class dtBook_Test
{
@@ -35,12 +37,12 @@ public class dtBook_Test
private void runDTBookJsonTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("DTBook", testName, expectedReturnCode, true);
+ common.runExpTest("DTBook", testName, expectedReturnCode, TestOutputType.JSON);
}
private void runDTBookXmlTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("DTBook", testName, expectedReturnCode, false);
+ common.runExpTest("DTBook", testName, expectedReturnCode, TestOutputType.XML);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/message_coverage.java b/src/test/java/com/adobe/epubcheck/test/message_coverage.java
index e7691ed..d531b60 100644
--- a/src/test/java/com/adobe/epubcheck/test/message_coverage.java
+++ b/src/test/java/com/adobe/epubcheck/test/message_coverage.java
@@ -5,15 +5,16 @@ import java.io.File;
import java.io.FileReader;
import java.util.Arrays;
import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import junit.framework.Assert;
-
import org.junit.Test;
import com.adobe.epubcheck.messages.MessageId;
+import junit.framework.Assert;
+
/**
* Test the coverage of reported message ids by all the tests. This test should run after all the others have completed.
*/
@@ -24,7 +25,7 @@ public class message_coverage
{
File dumpFile = new File("ReportedMessages.txt");
Assert.assertTrue("MessageId output file is missing: " + dumpFile.getAbsolutePath(), dumpFile.exists());
- HashSet<MessageId> reportedMessageIds = new HashSet<MessageId>();
+ HashSet<MessageId> reportedMessageIds = new LinkedHashSet<MessageId>();
BufferedReader reader = new BufferedReader(new FileReader(dumpFile));
Assert.assertNotNull("Could not read the reported message file.", reader);
String line;
@@ -39,17 +40,20 @@ public class message_coverage
reader.close();
List<MessageId> allMessageList = Arrays.asList(MessageId.values());
Assert.assertNotNull("Could not read the reported message file.", allMessageList);
- Set<MessageId> allMessages = new HashSet<MessageId>(allMessageList);
+ Set<MessageId> allMessages = new LinkedHashSet<MessageId>(allMessageList);
allMessages.removeAll(reportedMessageIds);
- Set<MessageId> expectedMissedCoverage = new HashSet<MessageId>();
+ Set<MessageId> expectedMissedCoverage = new LinkedHashSet<MessageId>();
+ expectedMissedCoverage.add(MessageId.CHK_006); //This message is in a code path that shouldn't ever be hit, but its here in case there is an error parsing the regex result.
+ expectedMissedCoverage.add(MessageId.CHK_007); //This message is in a code path that shouldn't be hit, but is here in case there is some other error accessing the file.
expectedMissedCoverage.add(MessageId.HTM_002); //This message is in a code path that shouldn't be hit
expectedMissedCoverage.add(MessageId.HTM_011); //This message may never be reported. Undeclared entities result in a Sax Parser Error and message RSC_005.
- expectedMissedCoverage.add(MessageId.CHK_007); //This message is in a code path that shouldn't be hit, but is here in case there is some other error accessing the file.
- expectedMissedCoverage.add(MessageId.CHK_006); //This message is in a code path that shouldn't ever be hit, but its here in case there is an error parsing the regex result.
+ expectedMissedCoverage.add(MessageId.NAV_001); //This message is only reported if the user explicitly calls validation of a Nav Doc with EPUB 2 version
+ expectedMissedCoverage.add(MessageId.OPF_010); //This is only reported in an exception that is difficult to generate in a test
expectedMissedCoverage.add(MessageId.OPF_011); //This is currently reported as RSC_005 in Schematron, but would be safer in prefix-checked code
- expectedMissedCoverage.add(MessageId.PKG_015); //This is only reported in an exception that is difficult to generate in a test
expectedMissedCoverage.add(MessageId.PKG_005); //This is only reported in an exception that is difficult to generate in a test
- expectedMissedCoverage.add(MessageId.RSC_017); //This message may never be reported. Sax Parser Error and message RSC_005, but this covers SAX warnings, which may never happen.
+ expectedMissedCoverage.add(MessageId.PKG_015); //This is only reported in an exception that is difficult to generate in a test
+ expectedMissedCoverage.add(MessageId.PKG_023); //TODO add tests
+ expectedMissedCoverage.add(MessageId.RSC_022); //If a LinkageError happens when running Java 6
Assert.assertEquals("Messages not covered by tests", expectedMissedCoverage, allMessages);
}
diff --git a/src/test/java/com/adobe/epubcheck/test/opf_Test.java b/src/test/java/com/adobe/epubcheck/test/opf_Test.java
index 61ac1d8..1431dc9 100644
--- a/src/test/java/com/adobe/epubcheck/test/opf_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/opf_Test.java
@@ -2,6 +2,8 @@ package com.adobe.epubcheck.test;
import org.junit.*;
+import com.adobe.epubcheck.test.common.TestOutputType;
+
public class opf_Test
{
private SecurityManager originalManager;
@@ -205,11 +207,11 @@ public class opf_Test
private void runOpfJsonTest(String testName, int expectedReturnCode)
{
- common.runExpTest("opf", testName, expectedReturnCode, true);
+ common.runExpTest("opf", testName, expectedReturnCode, TestOutputType.JSON);
}
private void runOpfXmlTest(String testName, int expectedReturnCode)
{
- common.runExpTest("opf", testName, expectedReturnCode, false);
+ common.runExpTest("opf", testName, expectedReturnCode, TestOutputType.XML);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/package_Test.java b/src/test/java/com/adobe/epubcheck/test/package_Test.java
index 701096c..d8a40e2 100644
--- a/src/test/java/com/adobe/epubcheck/test/package_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/package_Test.java
@@ -16,7 +16,9 @@ import com.adobe.epubcheck.messages.MessageId;
import com.adobe.epubcheck.ocf.OCFMockPackage;
import com.adobe.epubcheck.ocf.OCFPackage;
import com.adobe.epubcheck.opf.OPFChecker;
+import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder;
import com.adobe.epubcheck.reporting.CheckingReport;
+import com.adobe.epubcheck.test.common.TestOutputType;
import com.adobe.epubcheck.util.EPUBVersion;
import com.adobe.epubcheck.util.ValidationReport;
@@ -25,104 +27,121 @@ public class package_Test
private SecurityManager originalManager;
@Before
- public void setUp() throws Exception
+ public void setUp()
+ throws Exception
{
this.originalManager = System.getSecurityManager();
System.setSecurityManager(new NoExitSecurityManager());
}
@After
- public void tearDown() throws Exception
+ public void tearDown()
+ throws Exception
{
System.setSecurityManager(this.originalManager);
}
@Test
- public void Missing_toc_file_Test() throws Exception
+ public void Missing_toc_file_Test()
+ throws Exception
{
runPackageJsonTest("missing_toc_file", 1);
}
@Test
- public void Missing_ncx_file_Test() throws Exception
+ public void Missing_ncx_file_Test()
+ throws Exception
{
runPackageJsonTest("missing_ncx_file", 1);
}
@Test
- public void missing_mimetype_file_epub3_Test() throws Exception
+ public void missing_mimetype_file_epub3_Test()
+ throws Exception
{
runPackageJsonTest("missing_mimetype_file_epub3", 1);
}
@Test
- public void missing_mimetype_file_epub2_Test() throws Exception
+ public void missing_mimetype_file_epub2_Test()
+ throws Exception
{
runPackageJsonTest("missing_mimetype_file_epub2", 1);
}
@Test
- public void missing_container_file_epub3_Test() throws Exception
+ public void missing_container_file_epub3_Test()
+ throws Exception
{
runPackageJsonTest("missing_container_file_epub3", 1);
}
@Test
- public void missing_container_file_epub2_Test() throws Exception
+ public void missing_container_file_epub2_Test()
+ throws Exception
{
runPackageJsonTest("missing_container_file_epub2", 1);
}
@Test
- public void missing_opf_file_Test() throws Exception
+ public void missing_opf_file_Test()
+ throws Exception
{
runPackageJsonTest("missing_opf_file", 1);
}
@Test
- public void interesting_paths_epub2_Test() throws Exception
+ public void interesting_paths_epub2_Test()
+ throws Exception
{
runPackageJsonTest("interesting_paths_epub2", 0);
}
@Test
- public void interesting_paths_epub2_xml_Test() throws Exception
+ public void interesting_paths_epub2_xml_Test()
+ throws Exception
{
runPackageXmlTest("interesting_paths_epub2", 0);
}
@Test
- public void interesting_paths_epub3_json_Test() throws Exception
+ public void interesting_paths_epub3_json_Test()
+ throws Exception
{
runPackageJsonTest("interesting_paths_epub3", 1);
}
@Test
- public void interesting_paths_epub3_xml_Test() throws Exception
+ public void interesting_paths_epub3_xml_Test()
+ throws Exception
{
runPackageXmlTest("interesting_paths_epub3", 1);
}
@Test
- public void empty_mimetype_Test() throws Exception
+ public void empty_mimetype_Test()
+ throws Exception
{
runPackageJsonTest("empty_mimetype", 1);
}
@Test
- public void image_types_Test() throws Exception
+ public void image_types_Test()
+ throws Exception
{
runPackageJsonTest("image_types", 0);
}
@Test
- public void path_resolution_Test() throws Exception
+ public void path_resolution_Test()
+ throws Exception
{
runPackageJsonTest("path_resolution", 0);
}
@Test
- public void empty_dir_Test() throws Exception
+ public void empty_dir_Test()
+ throws Exception
{
String[] args = new String[3];
URL inputUrl = common.class.getResource("package");
@@ -142,7 +161,8 @@ public class package_Test
}
@Test
- public void corrupt_file_Test() throws Exception
+ public void corrupt_file_Test()
+ throws Exception
{
String[] args = new String[3];
URL inputUrl = common.class.getResource("package");
@@ -162,7 +182,8 @@ public class package_Test
}
@Test
- public void blank_file_Test() throws Exception
+ public void blank_file_Test()
+ throws Exception
{
URL inputUrl = common.class.getResource("package");
String inputPath = inputUrl.getPath();
@@ -183,7 +204,8 @@ public class package_Test
}
@Test
- public void wrong_type_Test() throws Exception
+ public void wrong_type_Test()
+ throws Exception
{
String[] args = new String[3];
URL inputUrl = common.class.getResource("package");
@@ -202,9 +224,11 @@ public class package_Test
common.compareJson(expectedOutput, actualOutput);
}
- // @Test There are different results when running through IntelliJ and running with Maven.
+ // @Test There are different results when running through IntelliJ and running
+ // with Maven.
// Different OS's also produce different results.
- public void empty_archive_Test() throws Exception
+ public void empty_archive_Test()
+ throws Exception
{
String[] args = new String[3];
URL inputUrl = common.class.getResource("package");
@@ -224,7 +248,8 @@ public class package_Test
}
@Test
- public void wrong_extension_Test() throws Exception
+ public void wrong_extension_Test()
+ throws Exception
{
URL inputUrl = common.class.getResource("package");
String inputPath = inputUrl.getPath();
@@ -235,7 +260,8 @@ public class package_Test
report.initialize();
File inputEpub = new File(inputPath);
EpubCheck check = new EpubCheck(inputEpub, report);
- org.junit.Assert.assertEquals("The file should have generated warnings.", 1, check.doValidate());
+ org.junit.Assert
+ .assertEquals("The file should have generated warnings.", 1, check.doValidate());
report.generate();
File actualOutput = new File(outputPath);
Assert.assertTrue("Output file is missing.", actualOutput.exists());
@@ -245,7 +271,8 @@ public class package_Test
}
@Test
- public void missing_file_Test() throws Exception
+ public void missing_file_Test()
+ throws Exception
{
URL inputUrl = common.class.getResource("package");
String inputPath = inputUrl.getPath();
@@ -256,7 +283,8 @@ public class package_Test
report.initialize();
File inputEpub = new File(inputPath);
EpubCheck check = new EpubCheck(inputEpub, report);
- org.junit.Assert.assertEquals("The file should have generated warnings.", 2, check.doValidate());
+ org.junit.Assert
+ .assertEquals("The file should have generated warnings.", 2, check.doValidate());
report.generate();
File actualOutput = new File(outputPath);
Assert.assertTrue("Output file is missing.", actualOutput.exists());
@@ -266,7 +294,8 @@ public class package_Test
}
@Test
- public void missing_opf_epub_file_Test() throws Exception
+ public void missing_opf_epub_file_Test()
+ throws Exception
{
URL inputUrl = common.class.getResource("package");
String inputPath = inputUrl.getPath();
@@ -277,7 +306,8 @@ public class package_Test
CheckingReport report = new CheckingReport(inputPath, outputPath);
report.initialize();
ocf.setReport(report);
- OPFChecker opfChecker = new OPFChecker(ocf, report, "test_single_opf", EPUBVersion.VERSION_3);
+ OPFChecker opfChecker = new OPFChecker(new ValidationContextBuilder().path("test_single_opf")
+ .ocf(ocf).report(report).version(EPUBVersion.VERSION_3).build());
opfChecker.runChecks();
report.generate();
File actualOutput = new File(outputPath);
@@ -287,13 +317,15 @@ public class package_Test
common.compareJson(expectedOutput, actualOutput);
}
- private void runPackageJsonTest(String testName, int expectedReturnCode) throws Exception
+ private void runPackageJsonTest(String testName, int expectedReturnCode)
+ throws Exception
{
- common.runExpTest("package", testName, expectedReturnCode, true);
+ common.runExpTest("package", testName, expectedReturnCode, TestOutputType.JSON);
}
- private void runPackageXmlTest(String testName, int expectedReturnCode) throws Exception
+ private void runPackageXmlTest(String testName, int expectedReturnCode)
+ throws Exception
{
- common.runExpTest("package", testName, expectedReturnCode, false);
+ common.runExpTest("package", testName, expectedReturnCode, TestOutputType.XML);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/script_Test.java b/src/test/java/com/adobe/epubcheck/test/script_Test.java
index 99b7e09..548ad01 100644
--- a/src/test/java/com/adobe/epubcheck/test/script_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/script_Test.java
@@ -2,6 +2,8 @@ package com.adobe.epubcheck.test;
import org.junit.*;
+import com.adobe.epubcheck.test.common.TestOutputType;
+
public class script_Test
{
private SecurityManager originalManager;
@@ -55,8 +57,14 @@ public class script_Test
runScriptTest("epub2", 1);
}
+ @Test
+ public void epub2_script_xmp_Test() throws Exception
+ {
+ common.runExpTest("scripts", "epub2", 1, TestOutputType.XMP);
+ }
+
private void runScriptTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("scripts", testName, expectedReturnCode, true);
+ common.runExpTest("scripts", testName, expectedReturnCode, TestOutputType.JSON);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/toc_Test.java b/src/test/java/com/adobe/epubcheck/test/toc_Test.java
index c92b359..67342e8 100644
--- a/src/test/java/com/adobe/epubcheck/test/toc_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/toc_Test.java
@@ -2,6 +2,8 @@ package com.adobe.epubcheck.test;
import org.junit.*;
+import com.adobe.epubcheck.test.common.TestOutputType;
+
public class toc_Test
{
@@ -40,7 +42,7 @@ public class toc_Test
private void runTocTest(String testName, int expectedReturnCode) throws Exception
{
- common.runExpTest("toc", testName, expectedReturnCode, true);
+ common.runExpTest("toc", testName, expectedReturnCode, TestOutputType.JSON);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/test/xhtml_Test.java b/src/test/java/com/adobe/epubcheck/test/xhtml_Test.java
index 736a58c..a732f61 100644
--- a/src/test/java/com/adobe/epubcheck/test/xhtml_Test.java
+++ b/src/test/java/com/adobe/epubcheck/test/xhtml_Test.java
@@ -1,6 +1,9 @@
package com.adobe.epubcheck.test;
import org.junit.*;
+
+import com.adobe.epubcheck.test.common.TestOutputType;
+
import java.util.Locale;
public class xhtml_Test
@@ -128,6 +131,6 @@ public class xhtml_Test
private void runXhtmlTest(String testName, int expectedReturnCode)
{
- common.runExpTest("xhtml", testName, expectedReturnCode, true);
+ common.runExpTest("xhtml", testName, expectedReturnCode, TestOutputType.JSON);
}
}
diff --git a/src/test/java/com/adobe/epubcheck/util/OPFPeekerTest.java b/src/test/java/com/adobe/epubcheck/util/OPFPeekerTest.java
index da2e646..e413dc9 100644
--- a/src/test/java/com/adobe/epubcheck/util/OPFPeekerTest.java
+++ b/src/test/java/com/adobe/epubcheck/util/OPFPeekerTest.java
@@ -26,15 +26,15 @@ import static org.junit.Assert.assertEquals;
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
import java.util.Collections;
+import java.util.LinkedList;
import java.util.List;
import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.opf.OPFData;
import com.adobe.epubcheck.opf.OPFPeeker;
import com.google.common.collect.Sets;
@@ -42,8 +42,9 @@ import com.google.common.collect.Sets;
public class OPFPeekerTest
{
- private List<MessageId> expectedErrors;
- private List<MessageId> expectedWarnings;
+ private List<MessageId> expectedErrors = new LinkedList<MessageId>();
+ private List<MessageId> expectedWarnings = new LinkedList<MessageId>();
+ private List<MessageId> expectedFatals = new LinkedList<MessageId>();
private final GenericResourceProvider provider = new GenericResourceProvider()
{
@@ -53,39 +54,31 @@ public class OPFPeekerTest
public InputStream getInputStream(String path)
throws IOException
{
- return this.getClass().getResourceAsStream(basepath+path);
+ return this.getClass().getResourceAsStream(basepath + path);
}
};
+
/*
* TEST DEBUG FUNCTION
*/
- public OPFData retrieveData(String fileName, List<MessageId> errors,
- List<MessageId> warnings)
- {
- return retrieveData(fileName, errors, warnings, new ArrayList<MessageId>(), false);
- }
-
- public OPFData retrieveData(String fileName, List<MessageId> errors,
- List<MessageId> warnings, List<MessageId> fatalErrors)
+ public OPFData retrieveData(String fileName)
{
- return retrieveData(fileName, errors, warnings, fatalErrors, false);
+ return retrieveData(fileName, false);
}
- public OPFData retrieveData(String fileName, List<MessageId> errors,
- List<MessageId> warnings, List<MessageId> fatalErrors, boolean verbose)
+ public OPFData retrieveData(String fileName, boolean verbose)
{
OPFData result = null;
- ValidationReport testReport = new ValidationReport(fileName,
- Messages.get("opv_version_test"));
+ ValidationReport testReport = new ValidationReport(fileName, Messages.get("opv_version_test"));
try
{
OPFPeeker peeker = new OPFPeeker(fileName, testReport, provider);
result = peeker.peek();
} catch (InvalidVersionException e)
{
- testReport.message(MessageId.RSC_005, new MessageLocation(fileName, -1,
- -1), e.getMessage());
- } catch (IOException e) {
+ testReport.message(MessageId.RSC_005, EPUBLocation.create(fileName, -1, -1), e.getMessage());
+ } catch (IOException e)
+ {
throw new RuntimeException(e);
}
@@ -94,11 +87,9 @@ public class OPFPeekerTest
outWriter.println(testReport);
}
- assertEquals("The error results do not match", errors,
- testReport.getErrorIds());
- assertEquals("The warning results do not match", warnings,
- testReport.getWarningIds());
- assertEquals("The fatal error results do not match", fatalErrors,
+ assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
+ assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
testReport.getFatalErrorIds());
return result;
@@ -107,141 +98,141 @@ public class OPFPeekerTest
@Before
public void setup()
{
- expectedErrors = new ArrayList<MessageId>();
- expectedWarnings = new ArrayList<MessageId>();
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test
public void testRetrieveVersionValidVersion()
{
- retrieveData("validVersion.opf", expectedErrors, expectedWarnings);
+ retrieveData("validVersion.opf");
}
@Test
public void testRetrieveVersionNoPackageElement()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("noPackageElement.opf", expectedErrors, expectedWarnings);
+ retrieveData("noPackageElement.opf");
}
@Test
public void testRetrieveVersionNoVersionAttribute()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("noVersion.opf", expectedErrors, expectedWarnings);
+ retrieveData("noVersion.opf");
}
@Test
public void testRetrieveVersionNoEqualSign()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- retrieveData("noEqual.opf", expectedErrors, expectedWarnings);
+ retrieveData("noEqual.opf");
}
@Test
public void testRetrieveVersionValueWithoutQuotes()
{
Collections.addAll(expectedErrors, MessageId.RSC_005, MessageId.RSC_005);
- retrieveData("valueWithoutQuotes.opf", expectedErrors, expectedWarnings);
+ retrieveData("valueWithoutQuotes.opf");
}
@Test
public void testRetrieveVersionSpacesBetweenQuotes()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("spacesBetweenQuotes.opf", expectedErrors, expectedWarnings);
+ retrieveData("spacesBetweenQuotes.opf");
}
@Test
public void testRetrieveVersionSpacesInValue()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("spacesInValue.opf", expectedErrors, expectedWarnings);
+ retrieveData("spacesInValue.opf");
}
@Test
public void testRetrieveVersionVersion123323()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("version123.323.opf", expectedErrors, expectedWarnings);
+ retrieveData("version123.323.opf");
}
@Test
public void testRetrieveVersionNoPointInValue()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("noPointInValue.opf", expectedErrors, expectedWarnings);
+ retrieveData("noPointInValue.opf");
}
@Test
public void testRetrieveVersionNegativeVersion()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
- retrieveData("negativeVersion.opf", expectedErrors, expectedWarnings);
+ retrieveData("negativeVersion.opf");
}
-
+
@Test
public void testRetrieveType()
{
- OPFData data = retrieveData("singleDCType.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("singleDCType.opf");
assertEquals(Sets.newHashSet("foo"), data.getTypes());
}
-
+
@Test
public void testRetrieveMultipleTypes()
{
- OPFData data = retrieveData("multipleDCType.opf",expectedErrors,expectedWarnings);
- assertEquals(Sets.newHashSet("foo","bar"), data.getTypes());
+ OPFData data = retrieveData("multipleDCType.opf");
+ assertEquals(Sets.newHashSet("foo", "bar"), data.getTypes());
}
-
+
@Test
public void testRetrieveOnlyTopLevelTypes()
{
- OPFData data = retrieveData("collectionDCType.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("collectionDCType.opf");
assertEquals(Sets.newHashSet("foo"), data.getTypes());
}
-
+
@Test
public void testRetrieveTypeWithWhiteSpace()
{
- OPFData data = retrieveData("whitespaceInDCType.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("whitespaceInDCType.opf");
assertEquals(Sets.newHashSet("foo bar"), data.getTypes());
}
-
+
@Test
public void testRetrieveID()
{
- OPFData data = retrieveData("uniqueId.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("uniqueId.opf");
assertEquals("foo", data.getUniqueIdentifier());
}
-
+
@Test
public void testEmptyID()
{
- OPFData data = retrieveData("emptyId.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("emptyId.opf");
assertEquals(null, data.getUniqueIdentifier());
}
-
+
@Test
public void tesMissingID()
{
- OPFData data = retrieveData("missingId.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("missingId.opf");
assertEquals(null, data.getUniqueIdentifier());
}
-
+
@Test
public void testMultipleIDs()
{
- OPFData data = retrieveData("multipleIds.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("multipleIds.opf");
assertEquals("foo", data.getUniqueIdentifier());
}
-
+
@Test
public void testIDWithWhiteSpace()
{
- OPFData data = retrieveData("whitespaceInDCIdentifier.opf",expectedErrors,expectedWarnings);
+ OPFData data = retrieveData("whitespaceInDCIdentifier.opf");
assertEquals("foo", data.getUniqueIdentifier());
}
-
}
diff --git a/src/test/java/com/adobe/epubcheck/util/ValidationReport.java b/src/test/java/com/adobe/epubcheck/util/ValidationReport.java
index ee67c0d..45566ca 100644
--- a/src/test/java/com/adobe/epubcheck/util/ValidationReport.java
+++ b/src/test/java/com/adobe/epubcheck/util/ValidationReport.java
@@ -22,15 +22,15 @@
package com.adobe.epubcheck.util;
+import java.util.ArrayList;
+import java.util.List;
+
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.api.MasterReport;
import com.adobe.epubcheck.messages.Message;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.messages.Severity;
-import java.util.ArrayList;
-import java.util.List;
-
public class ValidationReport extends MasterReport
{
String info = "";
@@ -83,19 +83,19 @@ public class ValidationReport extends MasterReport
}
@Override
- public void message(Message message, MessageLocation location, Object... args)
+ public void message(Message message, EPUBLocation location, Object... args)
{
if (message.getSeverity().equals(Severity.ERROR))
{
- error(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
+ error(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
}
else if (message.getSeverity().equals(Severity.WARNING))
{
- warning(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
+ warning(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
}
else if (message.getSeverity().equals(Severity.FATAL))
{
- fatalError(PathUtil.removeWorkingDirectory(location.getFileName()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
+ fatalError(PathUtil.removeWorkingDirectory(location.getPath()), location.getLine(), location.getColumn(), message.getMessage(args), message.getID());
}
}
diff --git a/src/test/java/com/adobe/epubcheck/vocab/PrefixParsingTest.java b/src/test/java/com/adobe/epubcheck/vocab/PrefixParsingTest.java
index 84d34ca..6f0f6bb 100644
--- a/src/test/java/com/adobe/epubcheck/vocab/PrefixParsingTest.java
+++ b/src/test/java/com/adobe/epubcheck/vocab/PrefixParsingTest.java
@@ -24,29 +24,29 @@ package com.adobe.epubcheck.vocab;
import static org.junit.Assert.assertEquals;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.ValidationReport;
import com.adobe.epubcheck.util.outWriter;
import com.google.common.collect.ImmutableMap;
+import com.google.common.collect.Lists;
public class PrefixParsingTest
{
- private static final MessageLocation loc = new MessageLocation("file", 42, 42);
- private static final Map<String, String> foobarMap = ImmutableMap.of("foo", "http://example.org/foo#", "bar",
- "http://example.org/bar#");
+ private static final EPUBLocation loc = EPUBLocation.create("file", 42, 42);
+ private static final Map<String, String> foobarMap = ImmutableMap.of("foo",
+ "http://example.org/foo#", "bar", "http://example.org/bar#");
private static final Map<String, String> emptyMap = ImmutableMap.of();
- private List<MessageId> expectedErrors;
- private List<MessageId> expectedWarnings;
- private List<MessageId> expectedFatalErrors;
+ private List<MessageId> expectedErrors = Lists.newLinkedList();
+ private List<MessageId> expectedWarnings = Lists.newLinkedList();;
+ private List<MessageId> expectedFatals = Lists.newLinkedList();;
private Map<String, String> actual;
private Map<String, String> test(String value)
@@ -58,7 +58,8 @@ public class PrefixParsingTest
{
ValidationReport testReport = new ValidationReport(PrefixParsingTest.class.getSimpleName());
- Map<String, String> result = PrefixDeclarationParser.parsePrefixMappings(value, testReport, loc);
+ Map<String, String> result = PrefixDeclarationParser
+ .parsePrefixMappings(value, testReport, loc);
if (verbose)
{
@@ -67,7 +68,8 @@ public class PrefixParsingTest
assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", expectedFatalErrors, testReport.getFatalErrorIds());
+ assertEquals("The fatal error results do not match", expectedFatals,
+ testReport.getFatalErrorIds());
return result;
}
@@ -75,9 +77,9 @@ public class PrefixParsingTest
@Before
public void setup()
{
- expectedErrors = new ArrayList<MessageId>();
- expectedWarnings = new ArrayList<MessageId>();
- expectedFatalErrors = new ArrayList<MessageId>();
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test
@@ -93,7 +95,7 @@ public class PrefixParsingTest
actual = test("");
assertEquals(emptyMap, actual);
}
-
+
@Test
public void testNullPrefixDeclaration()
{
@@ -118,7 +120,7 @@ public class PrefixParsingTest
actual = test(": http://example.org/foo# : http://example.org/bar#");
assertEquals(emptyMap, actual);
}
-
+
@Test
public void testInvalidPrefixName()
{
@@ -126,7 +128,7 @@ public class PrefixParsingTest
actual = test("123: http://example.org/foo#");
assertEquals(emptyMap, actual);
}
-
+
@Test
public void testInvalidColonAfterPrefix()
{
@@ -135,7 +137,7 @@ public class PrefixParsingTest
actual = test("foo http://example.org/foo# bar : http://example.org/bar#");
assertEquals(emptyMap, actual);
}
-
+
@Test
public void testNoSpaceAfterColon()
{
@@ -143,7 +145,7 @@ public class PrefixParsingTest
actual = test("foo:http://example.org/foo#");
assertEquals(emptyMap, actual);
}
-
+
@Test
public void testIllegalWhitespace()
{
@@ -152,7 +154,7 @@ public class PrefixParsingTest
actual = test("foo:\t http://example.org/foo# \u2003 bar: http://example.org/bar#");
assertEquals(foobarMap, actual);
}
-
+
@Test
public void testNoURIForPrefix()
{
@@ -168,7 +170,7 @@ public class PrefixParsingTest
actual = test("foo: http://example.org/foo# bar: http://example.org/bar# baz:");
assertEquals(foobarMap, actual);
}
-
+
@Test
public void testNoURIForPrefix3()
{
@@ -176,13 +178,13 @@ public class PrefixParsingTest
actual = test("foo: http://example.org/foo# bar: http://example.org/bar# baz: ");
assertEquals(foobarMap, actual);
}
-
+
@Test
- public void testInvalidURI() {
+ public void testInvalidURI()
+ {
expectedErrors.add(MessageId.OPF_006);
actual = test("bad: [bad] foo: http://example.org/foo# bar: http://example.org/bar#");
assertEquals(foobarMap, actual);
}
-
}
diff --git a/src/test/java/com/adobe/epubcheck/vocab/VocabTest.java b/src/test/java/com/adobe/epubcheck/vocab/VocabTest.java
index e9103ee..c6a8698 100644
--- a/src/test/java/com/adobe/epubcheck/vocab/VocabTest.java
+++ b/src/test/java/com/adobe/epubcheck/vocab/VocabTest.java
@@ -27,7 +27,6 @@ import static org.hamcrest.CoreMatchers.not;
import static org.junit.Assert.*;
import static org.junit.matchers.JUnitMatchers.hasItems;
-import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -35,18 +34,19 @@ import java.util.Set;
import org.junit.Before;
import org.junit.Test;
+import com.adobe.epubcheck.api.EPUBLocation;
import com.adobe.epubcheck.messages.MessageId;
-import com.adobe.epubcheck.messages.MessageLocation;
import com.adobe.epubcheck.util.ValidationReport;
import com.adobe.epubcheck.util.outWriter;
import com.google.common.base.Optional;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Lists;
public class VocabTest
{
- private static final MessageLocation loc = new MessageLocation("file", 42, 42);
+ private static final EPUBLocation loc = EPUBLocation.create("file", 42, 42);
private static enum FOOBAR
{
@@ -55,7 +55,7 @@ public class VocabTest
FOO_BAR
}
- private static final Vocab FOOBAR_VOCAB = new EnumVocab(FOOBAR.class,
+ private static final Vocab FOOBAR_VOCAB = new EnumVocab<FOOBAR>(FOOBAR.class,
"http://example.org/foobar#");
private static enum NUMBERS
@@ -65,7 +65,7 @@ public class VocabTest
THREE
}
- private static final Vocab NUMBERS_VOCAB = new EnumVocab(NUMBERS.class,
+ private static final Vocab NUMBERS_VOCAB = new EnumVocab<NUMBERS>(NUMBERS.class,
"http://example.org/number#", "num");
private static final Vocab BAZ_UNCHECKED_VOCAB = new UncheckedVocab(
"http://example.org/number#baz", "baz");
@@ -78,9 +78,9 @@ public class VocabTest
private static final Set<String> FORBIDDEN_URIS = ImmutableSet.of("http://example.org/default#",
"http://example.org/forbidden#");
- private List<MessageId> expectedErrors;
- private List<MessageId> expectedWarnings;
- private List<MessageId> expectedFatalErrors;
+ private List<MessageId> expectedErrors = Lists.newLinkedList();
+ private List<MessageId> expectedWarnings = Lists.newLinkedList();
+ private List<MessageId> expectedFatals = Lists.newLinkedList();
private Set<Property> testPropertyList(String value, Map<String, Vocab> vocabs)
{
@@ -100,7 +100,7 @@ public class VocabTest
assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", expectedFatalErrors,
+ assertEquals("The fatal error results do not match", expectedFatals,
testReport.getFatalErrorIds());
return props;
@@ -124,7 +124,7 @@ public class VocabTest
assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", expectedFatalErrors,
+ assertEquals("The fatal error results do not match", expectedFatals,
testReport.getFatalErrorIds());
return prop;
@@ -149,7 +149,7 @@ public class VocabTest
assertEquals("The error results do not match", expectedErrors, testReport.getErrorIds());
assertEquals("The warning results do not match", expectedWarnings, testReport.getWarningIds());
- assertEquals("The fatal error results do not match", expectedFatalErrors,
+ assertEquals("The fatal error results do not match", expectedFatals,
testReport.getFatalErrorIds());
return result;
@@ -158,15 +158,15 @@ public class VocabTest
@Before
public void setup()
{
- expectedErrors = new ArrayList<MessageId>();
- expectedWarnings = new ArrayList<MessageId>();
- expectedFatalErrors = new ArrayList<MessageId>();
+ expectedErrors.clear();
+ expectedWarnings.clear();
+ expectedFatals.clear();
}
@Test(expected = NullPointerException.class)
public void testVocabsRequired()
{
- testPropertyList("prop1 prop2", null, true);
+ testPropertyList("prop1 prop2", null);
}
@Test
@@ -175,7 +175,7 @@ public class VocabTest
Optional<Property> prop = testProperty("foo", PREDEF_VOCABS);
assertTrue(prop.isPresent());
}
-
+
@Test
public void testSingleInvalid()
{
@@ -183,14 +183,13 @@ public class VocabTest
Optional<Property> prop = testProperty("foo bar", PREDEF_VOCABS);
assertFalse(prop.isPresent());
}
-
+
@Test
public void testList()
{
testPropertyList(" foo bar ", PREDEF_VOCABS);
}
-
@Test
public void testMalformed()
{
@@ -271,7 +270,7 @@ public class VocabTest
@Test
public void testDefaultDeclaredPrefix()
{
- expectedErrors.add(MessageId.OPF_007b);
+ expectedWarnings.add(MessageId.OPF_007b);
Map<String, Vocab> actual = testVocabs("default: http://example.org/default# hello: http://example.org/hello#");
assertThat(actual.entrySet().size(), is(4));
assertThat(actual.keySet(), not(hasItems("default")));
diff --git a/src/test/java/org/idpf/epubcheck/util/css/CssParserTest.java b/src/test/java/org/idpf/epubcheck/util/css/CssParserTest.java
index 91c3ede..782604f 100644
--- a/src/test/java/org/idpf/epubcheck/util/css/CssParserTest.java
+++ b/src/test/java/org/idpf/epubcheck/util/css/CssParserTest.java
@@ -2,9 +2,7 @@ package org.idpf.epubcheck.util.css;
import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_NONE;
import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_S_CMNT;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.io.IOException;
import java.io.PrintStream;
@@ -1193,6 +1191,15 @@ public class CssParserTest {
assertEquals(0, handler.errors.size());
}
+ @Test
+ public void testIssue333() throws Exception {
+// String s = "color: rgba(198,215,225,0);";
+ String s = "background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(198,215,225,0)), color-stop(100%, rgba(198,215,225,1)));";
+ HandlerImpl handler = execStyleAttr(s, false);
+ assertEquals(1, handler.declarations.size());
+ assertEquals(0, handler.errors.size());
+ }
+
HandlerImpl exec(String css, boolean debug) throws IOException, CssException {
HandlerImpl handler = new HandlerImpl(debug);
new CssParser().parse(new StringReader(css), CssLocation.NO_SID, handler, handler);
diff --git a/src/test/resources/20/epub/tests20.xml b/src/test/resources/20/epub/tests20.xml
index 455d7ae..caf7287 100644
--- a/src/test/resources/20/epub/tests20.xml
+++ b/src/test/resources/20/epub/tests20.xml
@@ -2,7 +2,7 @@
<testsuite>
<test>
<file>PageMap.epub</file>
- <description>This ePub has a PageMap. Having a page-map will cause a validation error.</description>
+ <description>This EPUB has a PageMap. Having a page-map will cause a validation error.</description>
<result valid="false">
<errors>1</errors>
<warnings>0</warnings>
@@ -10,7 +10,7 @@
</test>
<test>
<file>OPFIllegalElement_UniqueID.epub</file>
- <description>This ePub has an illegal element in the opf, and is missing the unique-id.</description>
+ <description>This EPUB has an illegal element in the opf, and is missing the unique-id.</description>
<result valid="false">
<errors>2</errors>
<warnings>0</warnings>
@@ -18,7 +18,7 @@
</test>
<test>
<file>OPFIllegalElement.epub</file>
- <description>This ePub has an illegal element in the opf.</description>
+ <description>This EPUB has an illegal element in the opf.</description>
<result valid="false">
<errors>1</errors>
<warnings>0</warnings>
@@ -26,7 +26,7 @@
</test>
<test>
<file>Unmanifested.epub</file>
- <description>This ePub has two files which are not listed in its manifest.</description>
+ <description>This EPUB has two files which are not listed in its manifest.</description>
<result valid="false">
<errors>0</errors>
<warnings>2</warnings>
@@ -34,7 +34,7 @@
</test>
<test>
<file>ContainerNotOPF.epub</file>
- <description>This ePub has a file which is not listed in the OPF manifest, but is listed in container.xml.</description>
+ <description>This EPUB has a file which is not listed in the OPF manifest, but is listed in container.xml.</description>
<result valid="true">
<errors>0</errors>
<warnings>0</warnings>
@@ -42,7 +42,7 @@
</test>
<test>
<file>MetaInfNotOPF.epub</file>
- <description>This ePub has a file in META-INF which is not listed in the OPF manifest.</description>
+ <description>This EPUB has a file in META-INF which is not listed in the OPF manifest.</description>
<result valid="true">
<errors>0</errors>
<warnings>0</warnings>
@@ -50,7 +50,7 @@
</test>
<test>
<file>NullDate.epub</file>
- <description>This ePub has a null date field in the OPF manifest.</description>
+ <description>This EPUB has a null date field in the OPF manifest.</description>
<result valid="false">
<errors>1</errors>
<warnings>0</warnings>
@@ -58,7 +58,7 @@
</test>
<test>
<file>Non8601Date.epub</file>
- <description>This ePub has a date field in the OPF manifest which does not conform to the ISO 8601 date format.</description>
+ <description>This EPUB has a date field in the OPF manifest which does not conform to the ISO 8601 date format.</description>
<result valid="false">
<errors>1</errors>
<warnings>0</warnings>
@@ -66,7 +66,7 @@
</test>
<test>
<file>UnmanifestedGuideItems.epub</file>
- <description>This ePub has two items declared in the "guide" element in its OPF. One of these items is declared in the OPF's manifest and should not generate an error, but the other one is not declared in the OPF and should generate an error.</description>
+ <description>This EPUB has two items declared in the "guide" element in its OPF. One of these items is declared in the OPF's manifest and should not generate an error, but the other one is not declared in the OPF and should generate an error.</description>
<result valid="false">
<errors>1</errors>
<warnings>0</warnings>
@@ -74,7 +74,7 @@
</test>
<test>
<file>EmptyDir.epub</file>
- <description>This ePub has an empty directory in it, which will cause a warning message.</description>
+ <description>This EPUB has an empty directory in it, which will cause a warning message.</description>
<result valid="false">
<errors>0</errors>
<warnings>1</warnings>
@@ -82,7 +82,7 @@
</test>
<test>
<file>Test.epub</file>
- <description>This ePub is valid.</description>
+ <description>This EPUB is valid.</description>
<result valid="true">
<errors>0</errors>
<warnings>0</warnings>
diff --git a/src/test/resources/20/epub/valid/issue169.txt b/src/test/resources/20/epub/valid/issue169.txt
index 0aed40f..b548e7a 100644
--- a/src/test/resources/20/epub/valid/issue169.txt
+++ b/src/test/resources/20/epub/valid/issue169.txt
@@ -1,5 +1,5 @@
[creation date] 2011-05-19T15:41:42Z
-[format version] 2.0
+[format version] 2.0.1
[format name] application/epub+zip
[creator] Gourévitch Jean-Paul
[title] LA FRANCE EN AFRIQUE
diff --git a/src/test/resources/20/epub/valid/issue301-ncx-empty-label.epub b/src/test/resources/20/epub/valid/issue301-ncx-empty-label.epub
new file mode 100644
index 0000000..e81be71
Binary files /dev/null and b/src/test/resources/20/epub/valid/issue301-ncx-empty-label.epub differ
diff --git a/src/test/resources/20/epub/valid/lorem.txt b/src/test/resources/20/epub/valid/lorem.txt
index 13fb9b3..a445a73 100644
--- a/src/test/resources/20/epub/valid/lorem.txt
+++ b/src/test/resources/20/epub/valid/lorem.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 2.0
+[format version] 2.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-circular.txt b/src/test/resources/20/expanded/invalid/fallbacks-circular.txt
index 84db5df..7959e75 100644
--- a/src/test/resources/20/expanded/invalid/fallbacks-circular.txt
+++ b/src/test/resources/20/expanded/invalid/fallbacks-circular.txt
@@ -1,5 +1,5 @@
[format name] application/epub+zip
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314
[title] Lorem Ipsum
[language] la
@@ -10,4 +10,4 @@
[declared mimetype] image/xyz
[declared mimetype] image/abc
[declared mimetype] image/jpeg
-[declared mimetype] application/x-dtbncx+xml
\ No newline at end of file
+[declared mimetype] application/x-dtbncx+xml
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.abc b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.abc
new file mode 100755
index 0000000..4d55c1e
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.abc
@@ -0,0 +1 @@
+<xyz/>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.jpeg b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.jpeg
new file mode 100644
index 0000000..ff336a5
Binary files /dev/null and b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.jpeg differ
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.xyz b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.xyz
new file mode 100755
index 0000000..4d55c1e
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/image.xyz
@@ -0,0 +1 @@
+<xyz/>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.css
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.ncx b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.ncx
new file mode 100644
index 0000000..fe3524a
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.ncx
@@ -0,0 +1,29 @@
+<?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="en">
+ <head>
+ <meta name="dtb:uid" content="urn:uuid:550e8400-e29b-41d4-a716-4466674412314"/>
+ <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>Chapter 1</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch1"/>
+ </navPoint>
+ <navPoint id="ch2" playOrder="2">
+ <navLabel>
+ <text>Chapter 2</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch2"/>
+ </navPoint>
+ </navMap>
+</ncx>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.opf b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.opf
new file mode 100644
index 0000000..0b8f389
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.opf
@@ -0,0 +1,21 @@
+<?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:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ <item id="img1" href="image.xyz" media-type="image/xyz" fallback="img2"/>
+ <item id="img2" href="image.abc" media-type="image/abc" fallback="img4"/>
+ <item id="img3" href="image.jpeg" media-type="image/jpeg"/>
+ <item id="ncx" href="lorem.ncx" media-type="application/x-dtbncx+xml"/>
+ <item id="xpgt" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml" fallback-style="css"/>
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="t1" />
+ </spine>
+</package>
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.xhtml b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.xhtml
new file mode 100644
index 0000000..d43ef0c
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/lorem.xhtml
@@ -0,0 +1,109 @@
+<?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>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div>
+ <h2>Table of Contents</h2>
+ <div>
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </div>
+ </div>
+ <div id="ch1">
+ <h2>Chapter 1</h2>
+ <img src="image.xyz" alt=""/>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </div>
+ <div id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/page-template.xpgt b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/page-template.xpgt
new file mode 100755
index 0000000..d260589
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/EPUB/page-template.xpgt
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <fo:layout-master-set>
+
+ <fo:simple-page-master master-name="single_column">
+ <fo:region-body margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column_head" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master>
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="single_column"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+
+ </fo:layout-master-set>
+
+ <ade:style>
+ <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
+ </ade:style>
+
+</ade:template>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/20/expanded/invalid/fallbacks-nonresolving/META-INF/container.xml
diff --git a/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/mimetype b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/fallbacks-nonresolving/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/lorem-dual-guide.txt b/src/test/resources/20/expanded/invalid/lorem-dual-guide.txt
index 84af072..c96debd 100644
--- a/src/test/resources/20/expanded/invalid/lorem-dual-guide.txt
+++ b/src/test/resources/20/expanded/invalid/lorem-dual-guide.txt
@@ -1,5 +1,5 @@
[format name] application/epub+zip
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:998e8400-a29c-41d4-a716-2278971238567
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/20/expanded/invalid/lorem-mimetype.txt b/src/test/resources/20/expanded/invalid/lorem-mimetype.txt
index bfa8112..8ea1717 100644
--- a/src/test/resources/20/expanded/invalid/lorem-mimetype.txt
+++ b/src/test/resources/20/expanded/invalid/lorem-mimetype.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx b/src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx
index e06ffd7..fe3524a 100644
--- a/src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx
+++ b/src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx
@@ -25,11 +25,5 @@
</navLabel>
<content src="lorem.xhtml#ch2"/>
</navPoint>
- <navPoint id="thisIsABadOne" playOrder="3">
- <navLabel>
- <text>bogus</text>
- </navLabel>
- <content src="../../AppData/Local/Temp/www.NotARealWebsite.com"/>
- </navPoint>
</navMap>
</ncx>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.css b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.css
similarity index 100%
rename from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.css
rename to src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.css
diff --git a/src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.ncx
similarity index 100%
copy from src/test/resources/20/expanded/invalid/lorem-mimetype/EPUB/lorem.ncx
copy to src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.ncx
diff --git a/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.opf b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.opf
new file mode 100644
index 0000000..ca73a3c
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?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:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</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" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.xhtml b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.xhtml
new file mode 100644
index 0000000..6bce358
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/EPUB/lorem.xhtml
@@ -0,0 +1,98 @@
+<?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>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </div>
+ <div id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/20/expanded/invalid/lorem-ncx-badpath/META-INF/container.xml
diff --git a/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/mimetype b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/lorem-ncx-badpath/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.css
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.ncx b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.ncx
new file mode 100644
index 0000000..16ee134
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.ncx
@@ -0,0 +1,29 @@
+<?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="en">
+ <head>
+ <meta name="dtb:uid" content="foo"/>
+ <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>Chapter 1</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch1"/>
+ </navPoint>
+ <navPoint id="ch2" playOrder="2">
+ <navLabel>
+ <text>Chapter 2</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch2"/>
+ </navPoint>
+ </navMap>
+</ncx>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.opf b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.opf
new file mode 100644
index 0000000..55bab1e
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?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">bar</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</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" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.xhtml b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.xhtml
new file mode 100644
index 0000000..52731c6
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/EPUB/lorem.xhtml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </div>
+ <div id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/20/expanded/invalid/ncx-uid-nomatch/META-INF/container.xml
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/mimetype b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-nomatch/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.css
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.ncx b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.ncx
new file mode 100644
index 0000000..bef938f
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.ncx
@@ -0,0 +1,29 @@
+<?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="en">
+ <head>
+ <meta name="dtb:uid" content="urn:uuid:550e8400-e29b-41d4-a716-4466674412314 "/>
+ <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>Chapter 1</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch1"/>
+ </navPoint>
+ <navPoint id="ch2" playOrder="2">
+ <navLabel>
+ <text>Chapter 2</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch2"/>
+ </navPoint>
+ </navMap>
+</ncx>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.opf b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.opf
new file mode 100644
index 0000000..6132e22
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?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:550e8400-e29b-41d4-a716-4466674412314 </dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</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" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.xhtml b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.xhtml
new file mode 100644
index 0000000..52731c6
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/EPUB/lorem.xhtml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+ "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </div>
+ <div id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/20/expanded/invalid/ncx-uid-spaces/META-INF/container.xml
diff --git a/src/test/resources/20/expanded/invalid/ncx-uid-spaces/mimetype b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/20/expanded/invalid/ncx-uid-spaces/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/valid/fallbacks.txt b/src/test/resources/20/expanded/valid/fallbacks.txt
index 0581de4..e4dd158 100644
--- a/src/test/resources/20/expanded/valid/fallbacks.txt
+++ b/src/test/resources/20/expanded/valid/fallbacks.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314
[title] Lorem Ipsum
[language] la
@@ -10,4 +10,4 @@
[declared mimetype] image/abc
[declared mimetype] image/jpeg
[declared mimetype] application/x-dtbncx+xml
-[declared mimetype] application/vnd.adobe-page-template+xml
\ No newline at end of file
+[declared mimetype] application/vnd.adobe-page-template+xml
diff --git a/src/test/resources/20/expanded/valid/issue267.txt b/src/test/resources/20/expanded/valid/issue267.txt
index 48389f6..54eddfb 100644
--- a/src/test/resources/20/expanded/valid/issue267.txt
+++ b/src/test/resources/20/expanded/valid/issue267.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content1.xhtml b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content1.xhtml
new file mode 100644
index 0000000..d2e6ab8
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content1.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Lorem ipsum dolor</title>
+ <link rel="stylesheet" href="../Style/style.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+ <div class="content">
+ <h1>Lorem ipsum dolor</h1>
+ <h2>Lorem ipsum dolor</h2>
+ <p><em>Lorem ipsum dolor</em> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p><b>Lorem ipsum dolor</b> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p><strong>Lorem ipsum dolor</strong> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <h3>Lorem ipsum dolor |h3|</h3>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <h3>Lorem ipsum dolor |h3|</h3>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content2.xhtml b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content2.xhtml
new file mode 100644
index 0000000..d2e6ab8
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Content/content2.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Lorem ipsum dolor</title>
+ <link rel="stylesheet" href="../Style/style.css" type="text/css"/>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ </head>
+ <body>
+ <div class="content">
+ <h1>Lorem ipsum dolor</h1>
+ <h2>Lorem ipsum dolor</h2>
+ <p><em>Lorem ipsum dolor</em> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p><b>Lorem ipsum dolor</b> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p><strong>Lorem ipsum dolor</strong> sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+
+ <h2>Lorem ipsum dolor</h2>
+ <h3>Lorem ipsum dolor |h3|</h3>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <h3>Lorem ipsum dolor |h3|</h3>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg
new file mode 100644
index 0000000..ccd3945
Binary files /dev/null and b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg differ
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Navigation/toc.ncx b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Navigation/toc.ncx
new file mode 100644
index 0000000..eb339ad
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Navigation/toc.ncx
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!DOCTYPE ncx PUBLIC "-//NISO//DTD ncx 2005-1//EN" "http://www.daisy.org/z3986/2005/ncx-2005-1.dtd">
+<ncx version="2005-1" xmlns="http://www.daisy.org/z3986/2005/ncx/">
+ <head>
+ <meta name="dtb:uid" content="aSampleToCheck.epub2.spaces-in-attributes"/>
+ <meta name="dtb:depth" content="4"/>
+ <meta name="dtb:totalPageCount" content="0"/>
+ <meta name="dtb:maxPageNumber" content="0"/>
+ </head>
+ <docTitle>
+ <text>Simple Sample</text>
+ </docTitle>
+ <navMap>
+ <navPoint id="np1" playOrder="1">
+ <navLabel>
+ <text/>
+ </navLabel>
+ <content src="../Content/content1.xhtml"/>
+ </navPoint>
+ <navPoint id="np2" playOrder="2">
+ <navLabel>
+ <text/>
+ </navLabel>
+ <content src="../Content/content2.xhtml"/>
+ </navPoint>
+ </navMap>
+</ncx>
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Style/style.css b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Style/style.css
new file mode 100644
index 0000000..fa26afc
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/Style/style.css
@@ -0,0 +1,9 @@
+body
+{
+ margin:0px;
+}
+
+img
+{
+ margin:0px;
+}
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/package.opf b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/package.opf
new file mode 100644
index 0000000..fa6d1fc
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/EPUB/package.opf
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package unique-identifier="unid" version="2.0" xmlns="http://www.idpf.org/2007/opf">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
+ <dc:identifier id="unid">aSampleToCheck.epub2.spaces-in-attributes</dc:identifier>
+ <dc:title>ePub2</dc:title>
+ <dc:language>fr</dc:language>
+ <dc:creator opf:role="aut">Vincent Gros</dc:creator>
+ <dc:date>2013-12-26</dc:date>
+ <dc:rights id="rights" xml:lang="en">This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.</dc:rights>
+ <meta name="cover" content="cover"/>
+ </metadata>
+ <manifest>
+ <item id="ncx" href="Navigation/toc.ncx" media-type="application/x-dtbncx+xml"/>
+ <item id="css " href="Style/style.css" media-type="text/css"/>
+
+ <item id=" cover" href="Image/cover.jpg" media-type="image/jpeg"/>
+ <item id="content1 " href="Content/content1.xhtml" media-type="application/xhtml+xml"/>
+ <item id=" content2" href="Content/content2.xhtml" media-type="application/xhtml+xml"/>
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="content1"/>
+ <itemref idref="content2"/>
+ </spine>
+ <guide>
+ <reference type="text" title="text" href="Content/content1.xhtml"/>
+ <reference type="other" title="other" href="Content/content2.xhtml"/>
+ </guide>
+</package>
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/META-INF/container.xml b/src/test/resources/20/expanded/valid/issue332-idspaces/META-INF/container.xml
new file mode 100644
index 0000000..4b089ed
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/META-INF/container.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"></rootfile>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/valid/issue332-idspaces/mimetype b/src/test/resources/20/expanded/valid/issue332-idspaces/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/20/expanded/valid/issue332-idspaces/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/20/expanded/valid/lorem-basic-dual.txt b/src/test/resources/20/expanded/valid/lorem-basic-dual.txt
index c53ff22..5777523 100644
--- a/src/test/resources/20/expanded/valid/lorem-basic-dual.txt
+++ b/src/test/resources/20/expanded/valid/lorem-basic-dual.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:998e8400-a29c-41d4-a716-2278971238567
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/20/expanded/valid/lorem-dual-guide.txt b/src/test/resources/20/expanded/valid/lorem-dual-guide.txt
index 9810a55..5777523 100644
--- a/src/test/resources/20/expanded/valid/lorem-dual-guide.txt
+++ b/src/test/resources/20/expanded/valid/lorem-dual-guide.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[unique identifier] urn:uuid:998e8400-a29c-41d4-a716-2278971238567
[title] Lorem Ipsum
[language] la
@@ -6,4 +6,4 @@
[items count] 4
[declared mimetype] application/xhtml+xml
[declared mimetype] application/x-dtbncx+xml
-[declared mimetype] text/css
\ No newline at end of file
+[declared mimetype] text/css
diff --git a/src/test/resources/20/expanded/valid/lorem-uidspaces.txt b/src/test/resources/20/expanded/valid/lorem-uidspaces.txt
index 9ec6b9c..4056969 100644
--- a/src/test/resources/20/expanded/valid/lorem-uidspaces.txt
+++ b/src/test/resources/20/expanded/valid/lorem-uidspaces.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[title] Lorem Ipsum
[language] la
[date] 2011-09-01
diff --git a/src/test/resources/20/expanded/valid/lorem/lorem-basic.txt b/src/test/resources/20/expanded/valid/lorem/lorem-basic.txt
index b3dd902..29db9f7 100644
--- a/src/test/resources/20/expanded/valid/lorem/lorem-basic.txt
+++ b/src/test/resources/20/expanded/valid/lorem/lorem-basic.txt
@@ -1,4 +1,4 @@
-[format version] 2.0
+[format version] 2.0.1
[title] Lorem Ipsum
[language] la
[date] 2011-09-01
@@ -6,4 +6,4 @@
[items count] 3
[declared mimetype] application/xhtml+xml
[declared mimetype] application/x-dtbncx+xml
-[declared mimetype] text/css
\ No newline at end of file
+[declared mimetype] text/css
diff --git a/src/test/resources/20/single/ops/invalid/issue287-nested-hyperlink.xhtml b/src/test/resources/20/single/ops/invalid/issue287-nested-hyperlink.xhtml
new file mode 100644
index 0000000..6a08b7d
--- /dev/null
+++ b/src/test/resources/20/single/ops/invalid/issue287-nested-hyperlink.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+ <head>
+ <title>title</title>
+ </head>
+ <body>
+ <div>
+ <a href="http://idpf.org">text <a class="footnote" href="content.xhtml#foo">link</a>
+ text</a>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/20/single/ops/invalid/unresolved-entity.xhtml b/src/test/resources/20/single/ops/invalid/unresolved-entity.xhtml
index b8a155d..100ab42 100644
--- a/src/test/resources/20/single/ops/invalid/unresolved-entity.xhtml
+++ b/src/test/resources/20/single/ops/invalid/unresolved-entity.xhtml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1/EN" "http://idpf.org/xhtml11.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1/EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>...</title>
diff --git a/src/test/resources/20/single/ops/valid/issue293-edits-elem-attributes.xhtml b/src/test/resources/20/single/ops/valid/issue293-edits-elem-attributes.xhtml
new file mode 100644
index 0000000..6bf7566
--- /dev/null
+++ b/src/test/resources/20/single/ops/valid/issue293-edits-elem-attributes.xhtml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>title</title>
+ </head>
+ <body>
+ <del class="foo">del</del>
+ </body>
+</html>
diff --git a/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-pub.epub b/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-pub.epub
new file mode 100644
index 0000000..8ceeecf
Binary files /dev/null and b/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-pub.epub differ
diff --git a/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-rendition.epub b/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-rendition.epub
new file mode 100644
index 0000000..4925840
Binary files /dev/null and b/src/test/resources/30/epub/invalid/edupub-multiple-renditions-nodctype-rendition.epub differ
diff --git a/src/test/resources/30/epub/invalid/edupub-pagination-nopagelist.epub b/src/test/resources/30/epub/invalid/edupub-pagination-nopagelist.epub
new file mode 100644
index 0000000..8a6b05e
Binary files /dev/null and b/src/test/resources/30/epub/invalid/edupub-pagination-nopagelist.epub differ
diff --git a/src/test/resources/30/epub/invalid/edupub-pagination-nosource.epub b/src/test/resources/30/epub/invalid/edupub-pagination-nosource.epub
new file mode 100644
index 0000000..1a61b7d
Binary files /dev/null and b/src/test/resources/30/epub/invalid/edupub-pagination-nosource.epub differ
diff --git a/src/test/resources/30/epub/invalid/edupub-toc-missing-branches.epub b/src/test/resources/30/epub/invalid/edupub-toc-missing-branches.epub
new file mode 100644
index 0000000..4047976
Binary files /dev/null and b/src/test/resources/30/epub/invalid/edupub-toc-missing-branches.epub differ
diff --git a/src/test/resources/30/epub/invalid/multiple-renditions-badmediaquery.epub b/src/test/resources/30/epub/invalid/multiple-renditions-badmediaquery.epub
new file mode 100644
index 0000000..111a5c9
Binary files /dev/null and b/src/test/resources/30/epub/invalid/multiple-renditions-badmediaquery.epub differ
diff --git a/src/test/resources/30/epub/invalid/multiple-renditions-nodctermsmodified.epub b/src/test/resources/30/epub/invalid/multiple-renditions-nodctermsmodified.epub
new file mode 100644
index 0000000..285a13c
Binary files /dev/null and b/src/test/resources/30/epub/invalid/multiple-renditions-nodctermsmodified.epub differ
diff --git a/src/test/resources/30/epub/invalid/multiple-renditions-nometadata.epub b/src/test/resources/30/epub/invalid/multiple-renditions-nometadata.epub
new file mode 100644
index 0000000..f2ab55d
Binary files /dev/null and b/src/test/resources/30/epub/invalid/multiple-renditions-nometadata.epub differ
diff --git a/src/test/resources/30/epub/invalid/multiple-renditions-noselection.epub b/src/test/resources/30/epub/invalid/multiple-renditions-noselection.epub
new file mode 100644
index 0000000..3b91ea7
Binary files /dev/null and b/src/test/resources/30/epub/invalid/multiple-renditions-noselection.epub differ
diff --git a/src/test/resources/30/epub/invalid/multiple-renditions-undefinedselection.epub b/src/test/resources/30/epub/invalid/multiple-renditions-undefinedselection.epub
new file mode 100644
index 0000000..5ca701b
Binary files /dev/null and b/src/test/resources/30/epub/invalid/multiple-renditions-undefinedselection.epub differ
diff --git a/src/test/resources/30/epub/valid/edupub-multiple-renditions.epub b/src/test/resources/30/epub/valid/edupub-multiple-renditions.epub
new file mode 100644
index 0000000..5e0134b
Binary files /dev/null and b/src/test/resources/30/epub/valid/edupub-multiple-renditions.epub differ
diff --git a/src/test/resources/30/epub/valid/edupub-pagination.epub b/src/test/resources/30/epub/valid/edupub-pagination.epub
new file mode 100644
index 0000000..4b2a6f1
Binary files /dev/null and b/src/test/resources/30/epub/valid/edupub-pagination.epub differ
diff --git a/src/test/resources/30/epub/valid/epub30-spec.txt b/src/test/resources/30/epub/valid/epub30-spec.txt
index d022d99..2616cdd 100644
--- a/src/test/resources/30/epub/valid/epub30-spec.txt
+++ b/src/test/resources/30/epub/valid/epub30-spec.txt
@@ -1,6 +1,6 @@
[creation date] 2012-02-14T11:20:00Z
[modification date] 2012-02-27T16:38:35Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] EPUB 3.0 Specification
[creator] EPUB 3 Working Group
diff --git a/src/test/resources/30/epub/valid/extension-1.txt b/src/test/resources/30/epub/valid/extension-1.txt
index 64058f3..df4cff0 100644
--- a/src/test/resources/30/epub/valid/extension-1.txt
+++ b/src/test/resources/30/epub/valid/extension-1.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/font_fallback_chain.txt b/src/test/resources/30/epub/valid/font_fallback_chain.txt
index a66d5d9..e2f44fd 100644
--- a/src/test/resources/30/epub/valid/font_fallback_chain.txt
+++ b/src/test/resources/30/epub/valid/font_fallback_chain.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/issue145.txt b/src/test/resources/30/epub/valid/issue145.txt
index 5f0ba75..46b56b0 100644
--- a/src/test/resources/30/epub/valid/issue145.txt
+++ b/src/test/resources/30/epub/valid/issue145.txt
@@ -1,5 +1,5 @@
[creation date] 2011-12-13T18:37:18Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Abroad
[creator] Thomas Crane
diff --git a/src/test/resources/30/epub/valid/issue158.txt b/src/test/resources/30/epub/valid/issue158.txt
index dd9c9c2..779d73f 100644
--- a/src/test/resources/30/epub/valid/issue158.txt
+++ b/src/test/resources/30/epub/valid/issue158.txt
@@ -1,5 +1,5 @@
[creation date] 2012-02-29T06:12:48Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] external resource example epub
[creator] KOJIMA Satoshi
diff --git a/src/test/resources/30/epub/valid/lorem.txt b/src/test/resources/30/epub/valid/lorem.txt
index 64058f3..df4cff0 100644
--- a/src/test/resources/30/epub/valid/lorem.txt
+++ b/src/test/resources/30/epub/valid/lorem.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/mp3-in-manifest.txt b/src/test/resources/30/epub/valid/mp3-in-manifest.txt
index 18ab1cb..3dbee48 100644
--- a/src/test/resources/30/epub/valid/mp3-in-manifest.txt
+++ b/src/test/resources/30/epub/valid/mp3-in-manifest.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/mp3-with-fallback.txt b/src/test/resources/30/epub/valid/mp3-with-fallback.txt
index 18ab1cb..3dbee48 100644
--- a/src/test/resources/30/epub/valid/mp3-with-fallback.txt
+++ b/src/test/resources/30/epub/valid/mp3-with-fallback.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/multiple-renditions.epub b/src/test/resources/30/epub/valid/multiple-renditions.epub
new file mode 100644
index 0000000..8defcb8
Binary files /dev/null and b/src/test/resources/30/epub/valid/multiple-renditions.epub differ
diff --git a/src/test/resources/30/epub/valid/test_svg.txt b/src/test/resources/30/epub/valid/test_svg.txt
index 0bfd420..ecd10b5 100644
--- a/src/test/resources/30/epub/valid/test_svg.txt
+++ b/src/test/resources/30/epub/valid/test_svg.txt
@@ -1,5 +1,5 @@
[creation date] 2011-09-01T17:16:54Z
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/epub/valid/valid_ncx.txt b/src/test/resources/30/epub/valid/valid_ncx.txt
index c89ed56..5867a71 100644
--- a/src/test/resources/30/epub/valid/valid_ncx.txt
+++ b/src/test/resources/30/epub/valid/valid_ncx.txt
@@ -1,5 +1,5 @@
[creation date] 1314890214000
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..124d7e5
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/data-nav.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="foo:bar">
+ <p>anything</p>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.opf
new file mode 100644
index 0000000..2476afd
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ <itemref idref="t2" linear="no"/>
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/data-nav-inspine/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-inspine/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/data-nav-inspine/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-inspine/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-inspine/mimetype
diff --git a/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..d2233d1
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/data-nav.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav>
+ <p>anything</p>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.opf
new file mode 100644
index 0000000..a94f959
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.xhtml b/src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.xhtml
rename to src/test/resources/30/expanded/invalid/data-nav-missing-type/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-missing-type/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/data-nav-missing-type/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/mimetype b/src/test/resources/30/expanded/invalid/data-nav-missing-type/mimetype
similarity index 100%
rename from src/test/resources/30/expanded/valid/lorem-xrenditions/mimetype
rename to src/test/resources/30/expanded/invalid/data-nav-missing-type/mimetype
diff --git a/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav-2.xhtml b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav-2.xhtml
new file mode 100644
index 0000000..124d7e5
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav-2.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="foo:bar">
+ <p>anything</p>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..124d7e5
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/data-nav.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="foo:bar">
+ <p>anything</p>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.opf
new file mode 100644
index 0000000..eb8b5ae
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="t3" href="data-nav-2.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/data-nav-multiple/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-multiple/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/data-nav-multiple/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-multiple/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-multiple/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.opf
new file mode 100644
index 0000000..788c8b8
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" properties="data-nav" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/data-nav-notxhtml/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/data-nav-notxhtml/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-notxhtml/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-notxhtml/mimetype
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..6b5c0a9
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/data-nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="region-based">
+ <ol>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ </li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/package.opf b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/package.opf
new file mode 100644
index 0000000..81e6b09
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="page1.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" properties="rendition:layout-reflowable"/>
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/page1.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/page1.xhtml
new file mode 100644
index 0000000..5356f2f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/page1.xhtml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-notfxl/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.opf
new file mode 100644
index 0000000..3b65af2
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.xhtml
new file mode 100644
index 0000000..d20fc7f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/EPUB/lorem.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc region-based">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-notindatanav/mimetype
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..ba6726c
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/data-nav.xhtml
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="region-based">
+ <h1>title</h1><!-- Invalid -->
+ <ol>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15">
+ <meta property="ahl:character-name" content="Sandman"/>
+ </a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"><b>Hello</b></a><!--Warning-->
+ </li>
+ <li>Empty</li><!-- Invalid -->
+ <li>
+ <span>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ <a href="page2.xhtml#xywh=percent:5,5,15,15"></a>
+ </span>
+ </li>
+ <li>
+ <span><!--Invalid-->
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ </span>
+ </li>
+ <li>
+ <span><!--Invalid-->
+ Hello
+ </span>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a><!-- Invalid -->
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ <ol>
+ <li>
+ <a href="page1.xhtml#xywh=percent:30,30,20,25"></a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:35,60,20,25"></a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ <ol>
+ <li>
+ <a href="page1.xhtml#xywh=percent:30,30,20,25"></a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:35,60,20,25"></a>
+ </li>
+ </ol>
+ <ol><!--Invalid-->
+ <li>
+ <a href="page1.xhtml#xywh=percent:30,30,20,25"></a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:35,60,20,25"></a>
+ </li>
+ </ol>
+ </li>
+ <li>
+ <ol><!-- Invalid -->
+ <li>
+ <a href="page1.xhtml#xywh=percent:30,30,20,25"></a>
+ </li>
+ <li>
+ <a href="page1.xhtml#xywh=percent:35,60,20,25"></a>
+ </li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/package.opf b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/package.opf
new file mode 100644
index 0000000..d2613fb
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/package.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="page1.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="page2.xhtml" media-type="application/xhtml+xml" />
+ <item id="dn" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ <itemref idref="t2" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page1.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page1.xhtml
new file mode 100644
index 0000000..5356f2f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page1.xhtml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page2.xhtml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page2.xhtml
new file mode 100644
index 0000000..035a399
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/page2.xhtml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/META-INF/container.xml b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/data-nav-regionbased-struct/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/dict.xhtml
new file mode 100644
index 0000000..d1676c0
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <!--<article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>-->
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/nav.xhtml
new file mode 100644
index 0000000..141402e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/nav.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ <section epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <!--<dfn title="dragon">drag·on</dfn>-->
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/package.opf
new file mode 100644
index 0000000..fde465a
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/package.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="nav"/>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/search.xml
new file mode 100644
index 0000000..3ee99ad
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="nav.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-invalidcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-invalidcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-invalidcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-invalidcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-invalidcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-invalidcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict1.xhtml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict1.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict1.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict2.xhtml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict2.xhtml
new file mode 100644
index 0000000..d9d3811
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/dict2.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span lang="en-fonipa">/ˈdrægən/</span>
+ <span>noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span>[count]</span>
+ <span> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/nav.xhtml
new file mode 100644
index 0000000..f861406
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/nav.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict1.xhtml">Dictionary 1</a></li>
+ <li><a href="dict2.xhtml">Dictionary 2</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/package.opf
new file mode 100644
index 0000000..d348a2d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/package.opf
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search1.xml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search1.xml
new file mode 100644
index 0000000..b443ad1
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search1.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict1.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search2.xml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search2.xml
new file mode 100644
index 0000000..e918438
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/search2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict2.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-multiple-nodictcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/package.opf
new file mode 100644
index 0000000..b40248e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <!--<dc:type>dictionary</dc:type>-->
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/search.xml
new file mode 100644
index 0000000..2c523cc
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-nodctype-2/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype-2/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-nodctype-2/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype-2/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-nodctype-2/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-nodctype-2/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/package.opf
new file mode 100644
index 0000000..b40248e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <!--<dc:type>dictionary</dc:type>-->
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/search.xml
new file mode 100644
index 0000000..2c523cc
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-nodctype/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-nodctype/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-nodctype/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-nodctype/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-nodctype/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-nodctype/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/dict.xhtml
new file mode 100644
index 0000000..d5331af
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span lang="en-fonipa">/ˈdrægən/</span>
+ <span >noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span>[count]</span>
+ <span> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/package.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/search.xml
new file mode 100644
index 0000000..2c523cc
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-single-nodictcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-single-nodictcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-single-nodictcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/package.opf
new file mode 100644
index 0000000..e92dbfb
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.txt" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/search.txt b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/search.txt
new file mode 100644
index 0000000..2c523cc
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/search.txt
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-skm-badextension/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-badextension/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-skm-badextension/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-badextension/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-skm-badextension/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-skm-badextension/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/package.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/search.xml
new file mode 100644
index 0000000..69e666f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <!--<search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>-->
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-skm-invalid/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-invalid/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-skm-invalid/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-invalid/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-skm-invalid/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-skm-invalid/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/package.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/search.xml
new file mode 100644
index 0000000..5650d36
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="style.css">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-skm-linktocss/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktocss/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-skm-linktocss/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-skm-linktocss/mimetype
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/dict.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/package.opf b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/package.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/search.xml b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/search.xml
new file mode 100644
index 0000000..37e05f4
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/search.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="missing.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/META-INF/container.xml b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/dict-skm-linktonowhere/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.opf
new file mode 100644
index 0000000..3b65af2
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.xhtml
new file mode 100644
index 0000000..8925d6e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/duplicate-id/EPUB/lorem.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2 id="ch1">Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2 id="ch2">Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/duplicate-id/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/duplicate-id/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/duplicate-id/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/duplicate-id/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.opf
new file mode 100644
index 0000000..6fd55c3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ <item id="css2" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/duplicate-resource/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/duplicate-resource/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/duplicate-resource/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/duplicate-resource/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/duplicate-resource/mimetype
diff --git a/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/contents.xhtml b/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/contents.xhtml
new file mode 100644
index 0000000..d1ed5e4
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/contents.xhtml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p itemscope="" itemtype="http://schema.org/Person">
+ Hello, my name is
+ <span itemprop="name">John Doe</span>
+ </p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/package.opf b/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/package.opf
new file mode 100644
index 0000000..b2c10a9
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-microdata/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/edu-microdata/META-INF/container.xml b/src/test/resources/30/expanded/invalid/edu-microdata/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-microdata/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/edu-microdata/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/edu-microdata/mimetype
diff --git a/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/contents.xhtml b/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/contents.xhtml
new file mode 100644
index 0000000..0e0340f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/contents.xhtml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <figure>
+ <figcaption>lorem</figcaption>
+ </figure>
+ <audio src="http://example.org/audio.mp3"/>
+ <video src="http://example.org/video.mp4"/>
+ <table>
+ <caption>table</caption>
+ <tr><td>foo</td></tr>
+ </table>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/package.opf b/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/package.opf
new file mode 100644
index 0000000..b3a2282
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-missing-lox/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav remote-resources" media-type="application/xhtml+xml" />
+ <item id="t002" href="http://example.org/audio.mp3" media-type="audio/mpeg" />
+ <item id="t003" href="http://example.org/video.mp4" media-type="video/mp4" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/edu-missing-lox/META-INF/container.xml b/src/test/resources/30/expanded/invalid/edu-missing-lox/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-missing-lox/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/edu-missing-lox/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/edu-missing-lox/mimetype
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/contents.xhtml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/contents.xhtml
new file mode 100644
index 0000000..56f2bfd
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/contents.xhtml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div epub:type="pagebreak"/>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/nav.xhtml
new file mode 100644
index 0000000..2797754
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/nav.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#toc">Lorem Ipsum</a></li>
+ <li><a href="contents.xhtml#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="contents.xhtml#ch1">Chapter 1</a></li>
+ <li><a href="contents.xhtml#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/package.opf b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/package.opf
new file mode 100644
index 0000000..c21c4fe
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/EPUB/package.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ <dc:source id="src">Encyclopaedia Britannica, 11th Edition</dc:source>
+ <meta property="source-of" refines="#src">pagination</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t002" href="contents.xhtml" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ <itemref idref="t002" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/META-INF/container.xml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/edu-pagination-nopagelist/mimetype
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/contents.xhtml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/contents.xhtml
new file mode 100644
index 0000000..eefd5a0
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/contents.xhtml
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <div id="p1" epub:type="pagebreak"/>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/nav.xhtml
new file mode 100644
index 0000000..6dc3fe4
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/nav.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="contents.xhtml#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="contents.xhtml#ch1">Chapter 1</a></li>
+ <li><a href="contents.xhtml#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ <nav epub:type="page-list">
+ <ol>
+ <li><a href="contents.xhtml#p1">1</a></li>
+ </ol>
+ </nav>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/package.opf b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/package.opf
new file mode 100644
index 0000000..cc80ce8
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t002" href="contents.xhtml" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ <itemref idref="t002" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/META-INF/container.xml b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/edu-pagination-nopagesource/mimetype
diff --git a/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/1-lorem.xhtml b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/1-lorem.xhtml
new file mode 100644
index 0000000..f8a2216
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/1-lorem.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p><a href="2-lorem.xhtml">Lorem ipsum</a> dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/2-lorem.xhtml b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/2-lorem.xhtml
new file mode 100644
index 0000000..3ea6a83
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/2-lorem.xhtml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="ch3">
+ <h2>Chapter 3</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch4">
+ <h2>Chapter 4</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/href-outofspine/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/lorem.opf
new file mode 100644
index 0000000..258e288
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/lorem.opf
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:661e8400-a29c-41d4-a716-2278971238567</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-04-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="1-lorem.xhtml" media-type="application/xhtml+xml" />
+ <item id="t2" href="2-lorem.xhtml" media-type="application/xhtml+xml" />
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+<!-- <itemref idref="t2" /> -->
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/nav.xhtml
new file mode 100644
index 0000000..cc4979e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/href-outofspine/EPUB/nav.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="1-lorem.xhtml#ch1">Chapter 1</a></li>
+ <li><a href="1-lorem.xhtml#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/href-outofspine/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/href-outofspine/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/href-outofspine/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/href-outofspine/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/content.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index1.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index1.xhtml
new file mode 100644
index 0000000..29ead23
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index1.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body epub:type="index">
+ <h2>Simplest index</h2>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index2.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index2.xhtml
new file mode 100644
index 0000000..b9d41b2
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/index2.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index (2)</title>
+ </head>
+
+ <body epub:type="index">
+ <section epub:type="index-group">
+ <h1>Group 2</h1>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/package.opf
new file mode 100644
index 0000000..bf37cf5
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/package.opf
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx1"/>
+ <itemref idref="idx2"/>
+ </spine>
+ <collection role="index">
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-collection-badidxcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/content.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index1.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index1.xhtml
new file mode 100644
index 0000000..dd5966a
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index1.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h2>Simplest index</h2>
+ <section>
+ <h1>Group 1</h1>
+ <ul>
+ <li><span>term 1</span>, <a href="content.xhtml#ch1">1</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index2.xhtml b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index2.xhtml
new file mode 100644
index 0000000..b9d41b2
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/index2.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index (2)</title>
+ </head>
+
+ <body epub:type="index">
+ <section epub:type="index-group">
+ <h1>Group 2</h1>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/package.opf
new file mode 100644
index 0000000..bf37cf5
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/package.opf
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx1"/>
+ <itemref idref="idx2"/>
+ </spine>
+ <collection role="index">
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-collection-noindex/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-collection-noindex/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-collection-noindex/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-collection-noindex/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-collection-noindex/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-collection-noindex/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/content.xhtml b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/index.xhtml b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/index.xhtml
new file mode 100644
index 0000000..29ead23
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/index.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body epub:type="index">
+ <h2>Simplest index</h2>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/package.opf
new file mode 100644
index 0000000..91651e9
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx" href="index.xhtml" properties="index" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-single-file-badidxcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/content.xhtml b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/index.xhtml b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/index.xhtml
new file mode 100644
index 0000000..dd5966a
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/index.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h2>Simplest index</h2>
+ <section>
+ <h1>Group 1</h1>
+ <ul>
+ <li><span>term 1</span>, <a href="content.xhtml#ch1">1</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/package.opf
new file mode 100644
index 0000000..91651e9
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx" href="index.xhtml" properties="index" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-single-file-noindex/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-single-file-noindex/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-single-file-noindex/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-single-file-noindex/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/index.xhtml b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/index.xhtml
new file mode 100644
index 0000000..e82599f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/index.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section epub:type="index">
+ <h2>Simplest index</h2>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/package.opf
new file mode 100644
index 0000000..9cfaa68
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:type>index</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="index.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-whole-pub-badidxcontent/mimetype
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/index.xhtml b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/index.xhtml
new file mode 100644
index 0000000..eb51ea0
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/index.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section>
+ <h2>Simplest index</h2>
+ <section>
+ <h1>Group 1</h1>
+ <ul>
+ <li><span>term 1</span>, <a href="#ch1">1</a></li>
+ </ul>
+ </section>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/package.opf b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/package.opf
new file mode 100644
index 0000000..9cfaa68
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:type>index</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="index.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/META-INF/container.xml b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/idx-whole-pub-noindex/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.opf
new file mode 100644
index 0000000..8753aee
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <link rel="xml-signature" href="licence.txt" />
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/link-missing/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/link-missing/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/link-missing/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/invalid/link-missing/mimetype b/src/test/resources/30/expanded/invalid/link-missing/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/link-missing/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/lorem-encryption/dropped text.txt b/src/test/resources/30/expanded/invalid/lorem-encryption/dropped text.txt
deleted file mode 100644
index effcdb6..0000000
--- a/src/test/resources/30/expanded/invalid/lorem-encryption/dropped text.txt
+++ /dev/null
@@ -1 +0,0 @@
-lorem-css-urls-2 (copy)
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/container.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/container.xml
new file mode 100644
index 0000000..3fedccc
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="text/html"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/metadata.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/OTHER/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/mapping.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/mapping.xhtml
new file mode 100644
index 0000000..3297648
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/mapping.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-nonxhtml/mimetype
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/container.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/container.xml
new file mode 100644
index 0000000..2dfa1a7
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/metadata.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/OTHER/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/mapping.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/mapping.xhtml
new file mode 100644
index 0000000..ab86675
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/mapping.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns:epub="http://www.idpf.org/2007/ops" xmlns="http://www.w3.org/1999/xhtml" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav epub:type="foo:bar">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noresourcemap/mimetype
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/container.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/container.xml
new file mode 100644
index 0000000..2dfa1a7
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/metadata.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/OTHER/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/mapping.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/mapping.xhtml
new file mode 100644
index 0000000..c2fe197
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/mapping.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-noversion/mimetype
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/container.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/container.xml
new file mode 100644
index 0000000..2dfa1a7
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/metadata.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/OTHER/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/mapping.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/mapping.xhtml
new file mode 100644
index 0000000..36bfdc3
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/mapping.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ <nav>
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/multiple-renditions-mapping-untypednav/mimetype
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/EPUB/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/container.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/container.xml
new file mode 100644
index 0000000..807b6c7
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/container.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ <link href="mapping2.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/metadata.xml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/nav.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/package.opf b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/OTHER/style.css
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping.xhtml
new file mode 100644
index 0000000..3297648
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping2.xhtml b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping2.xhtml
new file mode 100644
index 0000000..3297648
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mapping2.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/multiple-renditions-multiple-mappings/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.ncx b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.ncx
new file mode 100644
index 0000000..0886e24
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.ncx
@@ -0,0 +1,30 @@
+<?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">
+<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="urn:uuid:550e8400-e29b-41d4-a716-4466674412314"/>
+ <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>Chapter 1</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch1"/>
+ </navPoint>
+ <navPoint id="ch2" playOrder="2">
+ <navLabel>
+ <text>Chapter 2</text>
+ </navLabel>
+ <content src="lorem.xhtml#ch2"/>
+ </navPoint>
+ </navMap>
+</ncx>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.opf
new file mode 100644
index 0000000..c6dc7fb
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ <item id="ncx" href="lorem.ncx" media-type="application/x-dtbncx+xml" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="t1" />
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/ncx-external-identifier/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/ncx-external-identifier/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/ncx-external-identifier/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/ncx-external-identifier/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/ncx-external-identifier/mimetype
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter1.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter1.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter2.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter2.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter3.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/chapter3.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/lorem.opf
new file mode 100644
index 0000000..965a9ea
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/lorem.opf
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml" />
+ <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="c1" />
+ <itemref idref="c2" />
+ <itemref idref="c3" />
+ </spine>
+ <collection role="preview">
+ <collection role="manifest">
+ <link href="chapter1.xhtml" media-type="application/xhtml+xml"/>
+ <link href="chapter2.xhtml" media-type="application/xhtml+xml"/>
+ <link href="lorem.css" media-type="text/css"/>
+ </collection>
+ <link href="chapter1.xhtml#epubcfi(/6/2!/4/2/1:3"/>
+ </collection>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/nav.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/EPUB/nav.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-embedded-linkcfi/mimetype
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter1.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter1.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter2.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter2.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter3.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/chapter3.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/lorem.opf
new file mode 100644
index 0000000..bba3054
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/lorem.opf
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml" />
+ <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="c1" />
+ <itemref idref="c2" />
+ <itemref idref="c3" />
+ </spine>
+ <collection role="preview">
+ <collection role="manifest">
+ <link href="chapter1.xhtml" media-type="application/xhtml+xml"/>
+ <link href="chapter2.xhtml" media-type="application/xhtml+xml"/>
+ <link href="lorem.css" media-type="text/css"/>
+ </collection>
+ <link href="lorem.css"/>
+ </collection>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/nav.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/EPUB/nav.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-embedded-linknoCD/mimetype
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter1.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter1.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter2.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter2.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter3.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/chapter3.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/lorem.opf
new file mode 100644
index 0000000..db9292c
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/lorem.opf
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml" />
+ <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="c1" />
+ <itemref idref="c2" />
+ <itemref idref="c3" />
+ </spine>
+ <collection role="preview">
+ <collection role="manifest">
+ <link href="chapter1.xhtml" media-type="application/xhtml+xml"/>
+ <link href="chapter2.xhtml" media-type="application/xhtml+xml"/>
+ <link href="lorem.css" media-type="text/css"/>
+ </collection>
+ <!--<link href="chapter1.xhtml"/>-->
+ </collection>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/nav.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/EPUB/nav.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-embedded-nolinks/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-embedded-nolinks/mimetype
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter1.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter1.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter2.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter2.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter3.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/chapter3.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/lorem.opf
new file mode 100644
index 0000000..ad58630
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/lorem.opf
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml" />
+ <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="c1" />
+ <itemref idref="c2" />
+ <itemref idref="c3" />
+ </spine>
+ <collection role="preview">
+ <link href="chapter1.xhtml"/>
+ </collection>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/nav.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/EPUB/nav.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-embedded-nomanifest/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.opf
new file mode 100644
index 0000000..4497a0d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:type>preview</dc:type>
+
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <!--<dc:source>urn:isbn:9782367932095</dc:source>-->
+
+ <link href="http://example.org/book/9781448103706" rel="acquire" media-type="text/html"/>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="lorem.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/preview-pub-nosource/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-pub-nosource/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-pub-nosource/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-pub-nosource/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-pub-nosource/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.opf
new file mode 100644
index 0000000..61c05f9
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <!--<dc:type>preview</dc:type>-->
+
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:source>urn:isbn:9782367932095</dc:source>
+
+ <link href="http://example.org/book/9781448103706" rel="acquire" media-type="text/html"/>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="lorem.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/preview-pub-notype/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-pub-notype/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-pub-notype/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-pub-notype/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-pub-notype/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.opf
new file mode 100644
index 0000000..990c14e
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:type>preview</dc:type>
+
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:source>urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:source>
+
+ <link href="http://example.org/book/9781448103706" rel="acquire" media-type="text/html"/>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="lorem.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/preview-pub-samesourceid/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/preview-pub-samesourceid/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/preview-pub-samesourceid/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/preview-pub-samesourceid/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.opf
new file mode 100644
index 0000000..719a978
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="missing" href="missing.xhtml" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/invalid/resource-missing/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/resource-missing/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/resource-missing/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/resource-missing/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/resource-missing/mimetype
diff --git a/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.opf b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.opf
new file mode 100644
index 0000000..2b3357d
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="xpgt" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.xhtml b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.xhtml
new file mode 100644
index 0000000..e99556b
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/lorem.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/page-template.xpgt b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/page-template.xpgt
new file mode 100755
index 0000000..d260589
--- /dev/null
+++ b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/EPUB/page-template.xpgt
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <fo:layout-master-set>
+
+ <fo:simple-page-master master-name="single_column">
+ <fo:region-body margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column_head" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master>
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="single_column"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+
+ </fo:layout-master-set>
+
+ <ade:style>
+ <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
+ </ade:style>
+
+</ade:template>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/invalid/xpgt-no-fallback/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/invalid/xpgt-no-fallback/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/invalid/xpgt-no-fallback/mimetype
diff --git a/src/test/resources/30/expanded/valid/cc-shared-culture.txt b/src/test/resources/30/expanded/valid/cc-shared-culture.txt
index dec3393..2e279dc 100644
--- a/src/test/resources/30/expanded/valid/cc-shared-culture.txt
+++ b/src/test/resources/30/expanded/valid/cc-shared-culture.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Creative Commons - A Shared Culture
diff --git a/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..a1e2190
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/data-nav.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="foo:bar">
+ <a href="lorem.xhtml">anything</a>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.opf
new file mode 100644
index 0000000..a94f959
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.xhtml
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
copy to src/test/resources/30/expanded/valid/data-nav-basic/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/data-nav-basic/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/data-nav-basic/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/data-nav-basic/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/data-nav-basic/mimetype
diff --git a/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/data-nav.xhtml b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/data-nav.xhtml
new file mode 100644
index 0000000..6b5c0a9
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/data-nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Data Navigation Document</title>
+ </head>
+ <body>
+ <nav epub:type="region-based">
+ <ol>
+ <li>
+ <a href="page1.xhtml#xywh=percent:5,5,15,15"></a>
+ </li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/package.opf b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/package.opf
new file mode 100644
index 0000000..d349458
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="page1.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="data-nav.xhtml" properties="data-nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/page1.xhtml b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/page1.xhtml
new file mode 100644
index 0000000..5356f2f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/page1.xhtml
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/data-nav-regionbased/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/data-nav-regionbased/META-INF/container.xml b/src/test/resources/30/expanded/valid/data-nav-regionbased/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/data-nav-regionbased/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/data-nav-regionbased/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/data-nav-regionbased/mimetype
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict1.xhtml b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict1.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict1.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict2.xhtml b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict2.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/dict2.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/nav.xhtml
new file mode 100644
index 0000000..f861406
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/nav.xhtml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict1.xhtml">Dictionary 1</a></li>
+ <li><a href="dict2.xhtml">Dictionary 2</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/package.opf b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/package.opf
new file mode 100644
index 0000000..d348a2d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/package.opf
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search1.xml b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search1.xml
new file mode 100644
index 0000000..b443ad1
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search1.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict1.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search2.xml b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search2.xml
new file mode 100644
index 0000000..e918438
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/search2.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict2.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/dict-multiple/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/dict-multiple/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/dict-multiple/META-INF/container.xml b/src/test/resources/30/expanded/valid/dict-multiple/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-multiple/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/dict-multiple/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/dict-multiple/mimetype
diff --git a/src/test/resources/30/expanded/valid/dict-single/EPUB/dict.xhtml b/src/test/resources/30/expanded/valid/dict-single/EPUB/dict.xhtml
new file mode 100644
index 0000000..3a22517
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-single/EPUB/dict.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Dictionary</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body epub:type="dictionary">
+ <h2>English Monolingual EPUB Dictionary Example</h2>
+ <article id="dragon">
+ <dfn title="dragon">drag·on</dfn>
+ <span epub:type="phonetic-transcription" lang="en-fonipa">/ˈdrægən/</span>
+ <span epub:type="part-of-speech">noun</span>, <em>pl</em>
+ <strong>-ons</strong>
+ <span epub:type="gram-info">[count]</span>
+ <span epub:type="def"> : an imaginary animal that can breathe out fire and looks like a
+ very large lizard with wings, a long tail, and large claws</span>
+ </article>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/dict-single/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/dict-single/EPUB/nav.xhtml
new file mode 100644
index 0000000..921581d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-single/EPUB/nav.xhtml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Nav Doc</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Table of Contents</h1>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="dict.xhtml">Dictionary</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/dict-single/EPUB/package.opf b/src/test/resources/30/expanded/valid/dict-single/EPUB/package.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-single/EPUB/package.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/dict-single/EPUB/search.xml b/src/test/resources/30/expanded/valid/dict-single/EPUB/search.xml
new file mode 100644
index 0000000..bd837a4
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-single/EPUB/search.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<search-key-map xml:lang="en" xmlns="http://www.idpf.org/2007/ops">
+ <search-key-group href="dict.xhtml#dragon">
+ <match value="dragon">
+ <value value="dragons"/>
+ <value value="a dragon"/>
+ </match>
+ </search-key-group>
+</search-key-map>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/dict-single/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/dict-single/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/dict-single/META-INF/container.xml b/src/test/resources/30/expanded/valid/dict-single/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/dict-single/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/dict-single/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/dict-single/mimetype
diff --git a/src/test/resources/30/expanded/valid/edu-basic/EPUB/contents.xhtml b/src/test/resources/30/expanded/valid/edu-basic/EPUB/contents.xhtml
new file mode 100644
index 0000000..6386725
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-basic/EPUB/contents.xhtml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/edu-basic/EPUB/package.opf b/src/test/resources/30/expanded/valid/edu-basic/EPUB/package.opf
new file mode 100644
index 0000000..b2c10a9
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-basic/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/edu-basic/META-INF/container.xml b/src/test/resources/30/expanded/valid/edu-basic/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-basic/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/edu-basic/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/edu-basic/mimetype
diff --git a/src/test/resources/30/expanded/valid/edu-fxl/EPUB/contents.xhtml b/src/test/resources/30/expanded/valid/edu-fxl/EPUB/contents.xhtml
new file mode 100644
index 0000000..6d1241e
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-fxl/EPUB/contents.xhtml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <meta name="viewport" content="width=1200, height=600" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <p>Section with no heading OK in FXL</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/edu-fxl/EPUB/package.opf b/src/test/resources/30/expanded/valid/edu-fxl/EPUB/package.opf
new file mode 100644
index 0000000..441c69f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-fxl/EPUB/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/edu-fxl/META-INF/container.xml b/src/test/resources/30/expanded/valid/edu-fxl/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-fxl/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/edu-fxl/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/edu-fxl/mimetype
diff --git a/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/contents.xhtml b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/contents.xhtml
new file mode 100644
index 0000000..6386725
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/contents.xhtml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/nonlinear.xhtml b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/nonlinear.xhtml
new file mode 100644
index 0000000..94dcddb
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/nonlinear.xhtml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <!--EDUBPU structural requirements do not apply to non-linear content-->
+ <h3>Chapter 1</h3>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/package.opf b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/package.opf
new file mode 100644
index 0000000..13d493d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-non-linear/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t002" href="nonlinear.xhtml" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ <itemref idref="t002" linear="no" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/edu-non-linear/META-INF/container.xml b/src/test/resources/30/expanded/valid/edu-non-linear/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/edu-non-linear/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/edu-non-linear/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/edu-non-linear/mimetype
diff --git a/src/test/resources/30/expanded/valid/fallbacks.txt b/src/test/resources/30/expanded/valid/fallbacks.txt
index dc8b6c0..12d6a6d 100644
--- a/src/test/resources/30/expanded/valid/fallbacks.txt
+++ b/src/test/resources/30/expanded/valid/fallbacks.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/idx-collection/EPUB/content.xhtml b/src/test/resources/30/expanded/valid/idx-collection/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-collection/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-collection/EPUB/index1.xhtml b/src/test/resources/30/expanded/valid/idx-collection/EPUB/index1.xhtml
new file mode 100644
index 0000000..1bce9f1
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-collection/EPUB/index1.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body epub:type="index">
+ <h2>Simplest index</h2>
+ <section epub:type="index-group">
+ <h1>Group 1</h1>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 1</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch1">1</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-collection/EPUB/index2.xhtml b/src/test/resources/30/expanded/valid/idx-collection/EPUB/index2.xhtml
new file mode 100644
index 0000000..b9d41b2
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-collection/EPUB/index2.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index (2)</title>
+ </head>
+
+ <body epub:type="index">
+ <section epub:type="index-group">
+ <h1>Group 2</h1>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-collection/EPUB/package.opf b/src/test/resources/30/expanded/valid/idx-collection/EPUB/package.opf
new file mode 100644
index 0000000..bf37cf5
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-collection/EPUB/package.opf
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx1"/>
+ <itemref idref="idx2"/>
+ </spine>
+ <collection role="index">
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/idx-collection/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/idx-collection/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/idx-collection/META-INF/container.xml b/src/test/resources/30/expanded/valid/idx-collection/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-collection/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/idx-collection/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/idx-collection/mimetype
diff --git a/src/test/resources/30/expanded/valid/idx-single-file/EPUB/content.xhtml b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/content.xhtml
new file mode 100644
index 0000000..2bfd5a3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/content.xhtml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Title</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-single-file/EPUB/index.xhtml b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/index.xhtml
new file mode 100644
index 0000000..3b4470c
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/index.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body epub:type="index">
+ <h2>Simplest index</h2>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 1</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch1">1</a></li>
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-single-file/EPUB/package.opf b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/package.opf
new file mode 100644
index 0000000..91651e9
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/package.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx" href="index.xhtml" properties="index" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/idx-single-file/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/idx-single-file/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/idx-single-file/META-INF/container.xml b/src/test/resources/30/expanded/valid/idx-single-file/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-single-file/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/idx-single-file/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/idx-single-file/mimetype
diff --git a/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/index.xhtml b/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/index.xhtml
new file mode 100644
index 0000000..47ab43b
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/index.xhtml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h1>Title</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet.</p>
+ </section>
+ <section epub:type="index">
+ <h2>Simplest index</h2>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 1</span>, <a epub:type="index-locator"
+ href="#ch1">1</a></li>
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="#ch2">2</a></li>
+ </ul>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/package.opf b/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/package.opf
new file mode 100644
index 0000000..9cfaa68
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:type>index</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="index.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/idx-whole-pub/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/idx-whole-pub/META-INF/container.xml b/src/test/resources/30/expanded/valid/idx-whole-pub/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/idx-whole-pub/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/idx-whole-pub/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/idx-whole-pub/mimetype
diff --git a/src/test/resources/30/expanded/valid/issue267.txt b/src/test/resources/30/expanded/valid/issue267.txt
index 18fd414..9438b36 100644
--- a/src/test/resources/30/expanded/valid/issue267.txt
+++ b/src/test/resources/30/expanded/valid/issue267.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] My Main Title
[title] First Subtitle
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/A_cover.xhtml b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/A_cover.xhtml
new file mode 100644
index 0000000..b822659
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/A_cover.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Lorem ipsum dolor - couverture</title>
+ <link rel="stylesheet" href="../Style/style.css" type="text/css"/>
+ </head>
+ <body>
+ <div class="couverture"><a id="cover"><img src="../Image/cover.jpg" alt="cover" /></a>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/B_pagetitre.xhtml b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/B_pagetitre.xhtml
new file mode 100644
index 0000000..41bf429
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/B_pagetitre.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Lorem ipsum dolor - page de titre</title>
+ <link rel="stylesheet" href="../Style/style.css" type="text/css"/>
+ </head>
+ <body>
+ <div class="couverture">
+ <a id="pagetitre"><img src="../Image/pagetitre.jpg" alt="titlepage" /></a>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/C_bodymatter.xhtml b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/C_bodymatter.xhtml
new file mode 100644
index 0000000..f42fbb5
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Content/C_bodymatter.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Lorem ipsum dolor - bodymatter</title>
+ <link rel="stylesheet" href="../Style/style.css" type="text/css"/>
+ <meta charset="utf-8" />
+ </head>
+ <body>
+ <section>
+ <h1>Hello world test:</h1>
+ <p>Hello World !</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg
new file mode 100644
index 0000000..dba73b3
Binary files /dev/null and b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/cover.jpg differ
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/pagetitre.jpg b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/pagetitre.jpg
new file mode 100644
index 0000000..6122585
Binary files /dev/null and b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Image/pagetitre.jpg differ
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Navigation/nav.xhtml b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Navigation/nav.xhtml
new file mode 100644
index 0000000..0af41ac
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Navigation/nav.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="fr" xml:lang="fr">
+ <head>
+ <title>Lorem ipsum dolor - Navigation</title>
+ <meta http-equiv="default-style" content="text/html; charset=utf-8"/>
+ <meta name="dtb:uid" content="Lorem"/>
+ <meta name="dtb:depth" content="1"/>
+ <meta name="dtb:totalPageCount" content="0"/>
+ <meta name="dtb:maxPageNumber" content="0"/>
+ </head>
+ <body>
+ <nav epub:type="toc" id="toc">
+ <h2>Un titre h2</h2>
+ <ol style="list-style-type:none">
+ <li><a href="../Content/A_cover.xhtml">Couverture</a></li>
+ <li><a href="../Content/B_pagetitre.xhtml">Dédicace</a></li>
+ <li><a href="../Content/C_bodymatter.xhtml">Commencer la lecture</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Style/style.css b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Style/style.css
new file mode 100644
index 0000000..deebf9f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/Style/style.css
@@ -0,0 +1,3 @@
+body {
+ background-color: white;
+}
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/package.opf b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/package.opf
new file mode 100644
index 0000000..fbd5c39
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/EPUB/package.opf
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="unid" xml:lang="fr" id="package">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="unid">aSampleToCheck.epub3.spaces-in-attributes</dc:identifier>
+ <dc:title>ePub3</dc:title>
+ <dc:language id="language">fr</dc:language>
+ <dc:creator id="creator">Vincent Gros</dc:creator>
+ <meta refines="#creator" property="role" scheme="marc:relators">aut</meta>
+ <dc:date>2013-12-26T12:00+01:00</dc:date>
+ <meta property="dcterms:modified">2013-12-26T12:00:00Z</meta>
+ <dc:rights id="rights" xml:lang="en">This work is shared with the public using the Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) license.</dc:rights>
+ <meta name="cover" content="cover"/>
+ </metadata>
+ <manifest>
+ <item href="Style/style.css" id="stylesheet " media-type="text/css"/>
+ <item href="Navigation/nav.xhtml" id="nav" properties="nav" media-type="application/xhtml+xml"/>
+ <item href="Content/A_cover.xhtml" id="coverpage " media-type="application/xhtml+xml"/>
+ <item href="Image/cover.jpg" id=" cover" media-type="image/jpeg"/>
+ <item href="Content/B_pagetitre.xhtml" id="titlepage " media-type="application/xhtml+xml"/>
+ <item href="Image/pagetitre.jpg" id="title-jpg" media-type="image/jpeg"/>
+ <item href="Content/C_bodymatter.xhtml" id=" bodymatter" media-type="application/xhtml+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="coverpage"/>
+ <itemref idref="titlepage"/>
+ <itemref idref="bodymatter"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/META-INF/container.xml b/src/test/resources/30/expanded/valid/issue332-idspaces/META-INF/container.xml
new file mode 100644
index 0000000..65b893d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/META-INF/container.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/issue332-idspaces/mimetype b/src/test/resources/30/expanded/valid/issue332-idspaces/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue332-idspaces/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/issue419/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.opf
new file mode 100644
index 0000000..3b65af2
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.xhtml
new file mode 100644
index 0000000..768b976
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue419/EPUB/lorem.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ <meta name="viewport" content="width=device-width" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/issue419/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/issue419/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/issue419/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/issue419/mimetype
diff --git a/src/test/resources/30/expanded/valid/issue567/META-INF/container.xml b/src/test/resources/30/expanded/valid/issue567/META-INF/container.xml
new file mode 100644
index 0000000..eaf4fbc
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/META-INF/container.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
+ <rootfiles>
+ <rootfile full-path="OEBPS/package.opf" media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
diff --git a/src/test/resources/30/expanded/valid/issue567/OEBPS/html/Chapter.xhtml b/src/test/resources/30/expanded/valid/issue567/OEBPS/html/Chapter.xhtml
new file mode 100644
index 0000000..61f7720
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/OEBPS/html/Chapter.xhtml
@@ -0,0 +1,17 @@
+<!DOCTYPE html SYSTEM "about:legacy-compat">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="de">
+ <head>
+ <title>Image Test</title>
+ <meta charset="utf-8" />
+ </head>
+ <body epub:type="chapter">
+ <div class="Fulltext">
+ <div class="Section1">
+ <h2 class="Heading">Image Test</h2>
+ <div class="Figure" id="Fig1">
+ <img src="../images/image1.jpg" alt="../images/image1.jpg" />
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue567/OEBPS/images/image1.jpg b/src/test/resources/30/expanded/valid/issue567/OEBPS/images/image1.jpg
new file mode 100644
index 0000000..af403ba
Binary files /dev/null and b/src/test/resources/30/expanded/valid/issue567/OEBPS/images/image1.jpg differ
diff --git a/src/test/resources/30/expanded/valid/issue567/OEBPS/navigation.xhtml b/src/test/resources/30/expanded/valid/issue567/OEBPS/navigation.xhtml
new file mode 100644
index 0000000..0dbab5b
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/OEBPS/navigation.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en" xml:lang="en">
+ <head>
+ <meta http-equiv="default-style" content="text/html; charset=utf-8"/>
+ <title>Navigation</title>
+ </head>
+ <body>
+ <nav epub:type="toc">
+ <h1>Contents</h1>
+ <ol epub:type="list">
+ <li><a href="html/Chapter.xhtml">Image Test</a></li>
+ </ol>
+ </nav>
+ <nav epub:type="landmarks">
+ <h1>Landmarks</h1>
+ <ol epub:type="list">
+ <li><a epub:type="bodymatter" href="html/Chapter.xhtml">Body Matter</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/issue567/OEBPS/package.opf b/src/test/resources/30/expanded/valid/issue567/OEBPS/package.opf
new file mode 100644
index 0000000..d150b90
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/OEBPS/package.opf
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<package xmlns="http://www.idpf.org/2007/opf" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:dcterms="http://purl.org/dc/terms/" version="3.0" xml:lang="en"
+ unique-identifier="pub-identifier">
+ <metadata>
+ <dc:identifier id="pub-identifier">urn:isbn:123</dc:identifier>
+ <dc:title id="pub-title">Image Test</dc:title>
+ <dc:language id="pub-language">en</dc:language>
+ <meta property="dcterms:modified">2015-03-13T15:35:14Z</meta>
+ <dc:creator id="creator1">xyz</dc:creator>
+ <meta refines="#creator1" property="display-seq">1</meta>
+ <meta refines="#creator1" property="role" scheme="marc:relators">aut</meta>
+ <dc:publisher>xyz</dc:publisher>
+ <dc:rights>xyz</dc:rights>
+ </metadata>
+ <manifest>
+ <item id="nav" properties="nav" href="navigation.xhtml" media-type="application/xhtml+xml"/>
+ <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/>
+ <item id="Chapter" href="html/Chapter.xhtml" media-type="application/xhtml+xml"/>
+ <item id="image1" href="images/image1.jpg" media-type="image/jpeg"/>
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="Chapter"/>
+ </spine>
+ <guide>
+ <reference type="text" title="Body Matter" href="html/Chapter.xhtml"/>
+ </guide>
+</package>
diff --git a/src/test/resources/30/expanded/valid/issue567/OEBPS/toc.ncx b/src/test/resources/30/expanded/valid/issue567/OEBPS/toc.ncx
new file mode 100644
index 0000000..1b4b4a8
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/OEBPS/toc.ncx
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8'?>
+<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
+ <head>
+ <meta name="dtb:uid" content="urn:isbn:123"/>
+ </head>
+ <docTitle><text>xyz</text></docTitle>
+ <docAuthor><text>xyz</text></docAuthor>
+ <navMap>
+ <navPoint id="navpoint-1" playOrder="1">
+ <navLabel><text>Image Test</text></navLabel>
+ <content src="html/Chapter.xhtml"/>
+ </navPoint>
+ </navMap>
+</ncx>
diff --git a/src/test/resources/30/expanded/valid/issue567/mimetype b/src/test/resources/30/expanded/valid/issue567/mimetype
new file mode 100644
index 0000000..57ef03f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/issue567/mimetype
@@ -0,0 +1 @@
+application/epub+zip
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-audio.txt b/src/test/resources/30/expanded/valid/lorem-audio.txt
index 65bc8f5..922bd4a 100644
--- a/src/test/resources/30/expanded/valid/lorem-audio.txt
+++ b/src/test/resources/30/expanded/valid/lorem-audio.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-basic-dual.txt b/src/test/resources/30/expanded/valid/lorem-basic-dual.txt
index 9be38bf..f75da80 100644
--- a/src/test/resources/30/expanded/valid/lorem-basic-dual.txt
+++ b/src/test/resources/30/expanded/valid/lorem-basic-dual.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-basic-switch.txt b/src/test/resources/30/expanded/valid/lorem-basic-switch.txt
index f5d9231..d687ff3 100644
--- a/src/test/resources/30/expanded/valid/lorem-basic-switch.txt
+++ b/src/test/resources/30/expanded/valid/lorem-basic-switch.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] The Waste Land
[creator] T.S. Eliot
diff --git a/src/test/resources/30/expanded/valid/lorem-basic.txt b/src/test/resources/30/expanded/valid/lorem-basic.txt
index 9ab8173..88fd1c4 100644
--- a/src/test/resources/30/expanded/valid/lorem-basic.txt
+++ b/src/test/resources/30/expanded/valid/lorem-basic.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-bindings.txt b/src/test/resources/30/expanded/valid/lorem-bindings.txt
index e0e9f30..beb965f 100644
--- a/src/test/resources/30/expanded/valid/lorem-bindings.txt
+++ b/src/test/resources/30/expanded/valid/lorem-bindings.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
@@ -9,4 +9,4 @@
[declared mimetype] application/xhtml+xml
[declared mimetype] text/css
[declared mimetype] application/x-demo-slideshow
-[hasScripts] text/javascript
\ No newline at end of file
+[hasScripts] text/javascript
diff --git a/src/test/resources/30/expanded/valid/lorem-css-import.txt b/src/test/resources/30/expanded/valid/lorem-css-import.txt
index dc91df1..186392b 100644
--- a/src/test/resources/30/expanded/valid/lorem-css-import.txt
+++ b/src/test/resources/30/expanded/valid/lorem-css-import.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-foreign.txt b/src/test/resources/30/expanded/valid/lorem-foreign.txt
index 26ed94b..da5a174 100644
--- a/src/test/resources/30/expanded/valid/lorem-foreign.txt
+++ b/src/test/resources/30/expanded/valid/lorem-foreign.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/1-lorem.xhtml b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/1-lorem.xhtml
new file mode 100644
index 0000000..e54244e
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/1-lorem.xhtml
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ <iframe id="iframe" name="iframe" src="./2-lorem.xhtml"></iframe>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/2-lorem.xhtml b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/2-lorem.xhtml
new file mode 100644
index 0000000..3ea6a83
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/2-lorem.xhtml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="ch3">
+ <h2>Chapter 3</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch4">
+ <h2>Chapter 4</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/lorem-iframe/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/lorem.opf
new file mode 100644
index 0000000..5c6330b
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/lorem.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:661e8400-a29c-41d4-a716-2278971238567</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-04-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="1-lorem.xhtml" media-type="application/xhtml+xml"/>
+ <item id="t2" href="2-lorem.xhtml" media-type="application/xhtml+xml"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="lorem.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/nav.xhtml
new file mode 100644
index 0000000..cc4979e
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/lorem-iframe/EPUB/nav.xhtml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="1-lorem.xhtml#ch1">Chapter 1</a></li>
+ <li><a href="1-lorem.xhtml#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/lorem-iframe/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/lorem-iframe/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/lorem-iframe/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/lorem-iframe/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-link.txt b/src/test/resources/30/expanded/valid/lorem-link.txt
index 430c913..9c7fa97 100644
--- a/src/test/resources/30/expanded/valid/lorem-link.txt
+++ b/src/test/resources/30/expanded/valid/lorem-link.txt
@@ -1,13 +1,12 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
[date] 2011-09-01
[unique identifier] urn:uuid:550e8400-e29b-41d4-a716-4466674412314
-[items count] 3
+[items count] 2
# Not defined mimetype ...
-[declared mimetype] null
[declared mimetype] application/xhtml+xml
[declared mimetype] text/css
diff --git a/src/test/resources/30/expanded/valid/lorem-object-fallbacks.txt b/src/test/resources/30/expanded/valid/lorem-object-fallbacks.txt
index 6d286fb..608c343 100644
--- a/src/test/resources/30/expanded/valid/lorem-object-fallbacks.txt
+++ b/src/test/resources/30/expanded/valid/lorem-object-fallbacks.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-poster.txt b/src/test/resources/30/expanded/valid/lorem-poster.txt
index a85c5ea..a858f4d 100644
--- a/src/test/resources/30/expanded/valid/lorem-poster.txt
+++ b/src/test/resources/30/expanded/valid/lorem-poster.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
@@ -10,4 +10,4 @@
[declared mimetype] text/css
[declared mimetype] image/png
[declared mimetype] video/ogg
-[reference] http://test.com/lorem.ogg
\ No newline at end of file
+[reference] http://test.com/lorem.ogg
diff --git a/src/test/resources/30/expanded/valid/lorem-remote.txt b/src/test/resources/30/expanded/valid/lorem-remote.txt
index 7ccf243..f044777 100644
--- a/src/test/resources/30/expanded/valid/lorem-remote.txt
+++ b/src/test/resources/30/expanded/valid/lorem-remote.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
@@ -10,4 +10,4 @@
[declared mimetype] text/css
[declared mimetype] audio/mp4
-[reference] http://example.org/remote.mp4
\ No newline at end of file
+[reference] http://example.org/remote.mp4
diff --git a/src/test/resources/30/expanded/valid/lorem-svg-dual.txt b/src/test/resources/30/expanded/valid/lorem-svg-dual.txt
index dc91df1..186392b 100644
--- a/src/test/resources/30/expanded/valid/lorem-svg-dual.txt
+++ b/src/test/resources/30/expanded/valid/lorem-svg-dual.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-svg-hyperlink.txt b/src/test/resources/30/expanded/valid/lorem-svg-hyperlink.txt
index bb2b7c4..28a2e5d 100644
--- a/src/test/resources/30/expanded/valid/lorem-svg-hyperlink.txt
+++ b/src/test/resources/30/expanded/valid/lorem-svg-hyperlink.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-svg.txt b/src/test/resources/30/expanded/valid/lorem-svg.txt
index bb2b7c4..28a2e5d 100644
--- a/src/test/resources/30/expanded/valid/lorem-svg.txt
+++ b/src/test/resources/30/expanded/valid/lorem-svg.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.opf
deleted file mode 100644
index f90985c..0000000
--- a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.opf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
- <dc:title>Lorem Ipsum</dc:title>
- <dc:language>la</dc:language>
- <dc:date>2011-09-01</dc:date>
- <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
- </metadata>
- <manifest>
- <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
- <item id="css" href="lorem.css" media-type="text/css" />
- </manifest>
- <spine>
- <itemref idref="t1" />
- </spine>
-</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.opf b/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.opf
deleted file mode 100644
index a15889a..0000000
--- a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB_2/lorem.opf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:identifier id="uid">urn:uuid:E966656B-97C7-4C41-BF68-7EBA425E1A07</dc:identifier>
- <dc:title>Lorem Ipsum - alt</dc:title>
- <dc:language>la</dc:language>
- <dc:date>2011-09-01</dc:date>
- <meta property="dcterms:modified">2012-10-16T12:26:51Z</meta>
- </metadata>
- <manifest>
- <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
- <item id="css" href="lorem.css" media-type="text/css" />
- </manifest>
- <spine>
- <itemref idref="t1" />
- </spine>
-</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/META-INF/container.xml b/src/test/resources/30/expanded/valid/lorem-xrenditions/META-INF/container.xml
deleted file mode 100644
index 4cbd973..0000000
--- a/src/test/resources/30/expanded/valid/lorem-xrenditions/META-INF/container.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?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"/>
- <rootfile full-path="EPUB_2/lorem.opf" media-type="application/oebps-package+xml"/>
- </rootfiles>
-</container>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/package.opf b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/container.xml b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/container.xml
new file mode 100644
index 0000000..2dfa1a7
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/metadata.xml b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/nav.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/package.opf b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/OTHER/style.css
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/mapping.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/mapping.xhtml
new file mode 100644
index 0000000..aadf675
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/mapping.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns:epub="http://www.idpf.org/2007/ops" xmlns="http://www.w3.org/1999/xhtml"
+ epub:prefix="foo: http://example.org/foo/">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ <nav epub:type="foo:bar">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/multiple-renditions-mapping-multiplenavs/mimetype
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/nav.xhtml
new file mode 100644
index 0000000..28ee901
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/nav.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/package.opf b/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/package.opf
new file mode 100644
index 0000000..c0f507d
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/package.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/multiple-renditions/EPUB/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/multiple-renditions/EPUB/style.css
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/container.xml b/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/container.xml
new file mode 100644
index 0000000..2dfa1a7
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/container.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container"
+ xmlns:rendition="http://www.idpf.org/2013/rendition" version="1.0">
+ <rootfiles>
+ <rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
+ <rootfile full-path="OTHER/package.opf" media-type="application/oebps-package+xml"
+ rendition:media="(min-width: 1920px)"/>
+ </rootfiles>
+ <links>
+ <link href="mapping.xhtml" rel="mapping" media-type="application/xhtml+xml"/>
+ </links>
+</container>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/metadata.xml b/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/metadata.xml
new file mode 100644
index 0000000..6e3ac88
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/META-INF/metadata.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<metadata xmlns="http://www.idpf.org/2013/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/"
+ unique-identifier="uid">
+ <dc:identifier id="uid">013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+</metadata>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/nav.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/nav.xhtml
new file mode 100644
index 0000000..f68d16f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/nav.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="style.css" />
+ <meta name="viewport" content="width=1200, height=600"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/package.opf b/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/package.opf
new file mode 100644
index 0000000..606b6de
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:013D98A5-41BF-4CAD-B870-E3B0AB7A34D1</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2012-10-16T12:26:26Z</meta>
+ <meta property="rendition:layout">pre-paginated</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="style.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref id="s1" idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/multiple-renditions/OTHER/style.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/multiple-renditions/OTHER/style.css
diff --git a/src/test/resources/30/expanded/valid/multiple-renditions/mapping.xhtml b/src/test/resources/30/expanded/valid/multiple-renditions/mapping.xhtml
new file mode 100644
index 0000000..3297648
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/multiple-renditions/mapping.xhtml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="epub.multiple.renditions.version" content="1.0" />
+ </head>
+ <body>
+ <nav xmlns:epub="http://www.idpf.org/2007/ops" epub:type="resource-map">
+ <ul>
+ <li>
+ <a href="EPUB/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ <li>
+ <a href="EPUB_2/lorem.opf#epubcfi(/6/2[s1]!/4/2/1)"></a>
+ </li>
+ </ul>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/multiple-renditions/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/multiple-renditions/mimetype
diff --git a/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/contents.xhtml b/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/contents.xhtml
new file mode 100644
index 0000000..0e0340f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/contents.xhtml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section id="toc">
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Lorem Ipsum</a>
+ <ol>
+ <li><a href="#toc">ToC</a></li>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <figure>
+ <figcaption>lorem</figcaption>
+ </figure>
+ <audio src="http://example.org/audio.mp3"/>
+ <video src="http://example.org/video.mp4"/>
+ <table>
+ <caption>table</caption>
+ <tr><td>foo</td></tr>
+ </table>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/package.opf b/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/package.opf
new file mode 100644
index 0000000..fe4c85c
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/non-edu-missing-lox/EPUB/package.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav remote-resources" media-type="application/xhtml+xml" />
+ <item id="t002" href="http://example.org/audio.mp3" media-type="audio/mpeg" />
+ <item id="t003" href="http://example.org/video.mp4" media-type="video/mp4" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/non-edu-missing-lox/META-INF/container.xml b/src/test/resources/30/expanded/valid/non-edu-missing-lox/META-INF/container.xml
new file mode 100644
index 0000000..77a8bf3
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/non-edu-missing-lox/META-INF/container.xml
@@ -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/package.opf"
+ media-type="application/oebps-package+xml"/>
+ </rootfiles>
+</container>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/non-edu-missing-lox/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/non-edu-missing-lox/mimetype
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter1.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter1.xhtml
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter1.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter2.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter2.xhtml
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter2.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter3.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/chapter3.xhtml
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/chapter3.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/lorem.css
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.css
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/lorem.opf
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/lorem.opf
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/lorem.opf
diff --git a/src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml b/src/test/resources/30/expanded/valid/preview-embedded/EPUB/nav.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/EPUB/nav.xhtml
rename to src/test/resources/30/expanded/valid/preview-embedded/EPUB/nav.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/preview-embedded/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/preview-embedded/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/preview-embedded/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/preview-embedded/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.opf
new file mode 100644
index 0000000..88eca0f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:type>preview</dc:type>
+
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:source>urn:isbn:9782367932095</dc:source>
+
+ <link href="http://example.org/book/9781448103706" rel="acquire" media-type="text/html"/>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="css" href="lorem.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.xhtml
similarity index 100%
rename from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.xhtml
rename to src/test/resources/30/expanded/valid/preview-pub/EPUB/lorem.xhtml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/preview-pub/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/preview-pub/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/preview-pub/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/preview-pub/mimetype
diff --git a/src/test/resources/30/expanded/valid/svg-cover.txt b/src/test/resources/30/expanded/valid/svg-cover.txt
index bb2b7c4..28a2e5d 100644
--- a/src/test/resources/30/expanded/valid/svg-cover.txt
+++ b/src/test/resources/30/expanded/valid/svg-cover.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] Lorem Ipsum
[language] la
diff --git a/src/test/resources/30/expanded/valid/svg-in-spine.txt b/src/test/resources/30/expanded/valid/svg-in-spine.txt
index 3e30ca9..d054262 100644
--- a/src/test/resources/30/expanded/valid/svg-in-spine.txt
+++ b/src/test/resources/30/expanded/valid/svg-in-spine.txt
@@ -1,10 +1,10 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] SVG in Spine
-[creator] ePub Sample project
+[creator] EPUB Sample project
[language] en-US
-[publisher] ePub Sample
+[publisher] EPUB Sample
[contributor] Takeshi Kanai
[rights] This work is licensed under a Creative Commons Attribution (CC BY SA) license.
[unique identifier] code.google.com.epub-samples.svg-in-spine
diff --git a/src/test/resources/30/expanded/valid/svg-in-spine/OPS/content.opf b/src/test/resources/30/expanded/valid/svg-in-spine/OPS/content.opf
index 5d396ac..853dded 100755
--- a/src/test/resources/30/expanded/valid/svg-in-spine/OPS/content.opf
+++ b/src/test/resources/30/expanded/valid/svg-in-spine/OPS/content.opf
@@ -2,11 +2,11 @@
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="uid" prefix="cc: http://creativecommons.org/ns#">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="title">SVG in Spine</dc:title>
- <dc:creator>ePub Sample project</dc:creator>
+ <dc:creator>EPUB Sample project</dc:creator>
<dc:identifier id="uid">code.google.com.epub-samples.svg-in-spine</dc:identifier>
<dc:language>en-US</dc:language>
<meta property="dcterms:modified">2012-04-12T12:00:00Z</meta>
- <dc:publisher>ePub Sample</dc:publisher>
+ <dc:publisher>EPUB Sample</dc:publisher>
<dc:contributor>Takeshi Kanai</dc:contributor>
<dc:description>SVG files are directly called from spine. A page needs to be skipped to display when it is in landscape.</dc:description>
<dc:rights>This work is licensed under a Creative Commons Attribution (CC BY SA) license.</dc:rights>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/image.svg b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/image.svg
new file mode 100755
index 0000000..6635944
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/image.svg
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg version="1.1" baseProfile="basic"
+ xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
+ width="100%" height="100%" viewBox="0 0 1571 2068"
+ xml:space="preserve">
+<style type="text/css">
+ .st0{fill:#AAB2AB;}
+ .st1{fill:url(#path2455_2_);stroke:#000000;stroke-width:3;}
+ .st2{fill:url(#path3337_3_);stroke:#000000;stroke-width:3;}
+ .st3{fill:url(#path2429_2_);stroke:#000000;stroke-width:3;}
+ .st4{fill:url(#path3262_2_);stroke:#000000;stroke-width:3;}
+ .st5{opacity:0.6089;}
+ .st6{fill:url(#path3292_2_);stroke:#000000;stroke-width:3;}
+ .st7{fill:url(#path3385_2_);stroke:#000000;stroke-width:4;}
+ .st8{fill:url(#path2440_2_);stroke:#000000;stroke-width:3;}
+ .st9{fill:url(#path2455_3_);stroke:#000000;stroke-width:3;}
+ .st10{fill:url(#path2414_2_);stroke:#000000;stroke-width:3;}
+ .st11{fill:url(#path2429_3_);stroke:#000000;stroke-width:3;}
+ .st13{fill:url(#path3262_3_);stroke:#000000;stroke-width:3;}
+ .st14{fill:url(#path2382_2_);stroke:#000000;stroke-width:3;}
+ .st15{fill:url(#path3292_3_);stroke:#000000;stroke-width:3;}
+ .st16{fill:url(#path3279_2_);}
+ .st17{fill:url(#path3279_3_);}
+ .st18{fill:url(#path3385_3_);stroke:#000000;stroke-width:4;}
+ .st19{fill:url(#path3316_2_);stroke:#000000;stroke-width:4;}
+ .st20{fill:url(#path2440_3_);stroke:#000000;stroke-width:3;}
+ .st21{fill:url(#path2414_3_);stroke:#000000;stroke-width:3;}
+ .st22{fill:url(#path3373_2_);stroke:#000000;stroke-width:3;}
+ .st23{opacity:0.5;}
+ .st24{fill:#FFFFFF;}
+ .st25{fill:url(#path2460_2_);stroke:#000000;stroke-width:3;}
+ .st26{fill:url(#path2382_3_);stroke:#000000;stroke-width:3;}
+ .st27{fill:url(#path3316_3_);stroke:#000000;stroke-width:4;}
+ .st28{fill:none;stroke:#000000;stroke-width:3;}
+ .st29{fill:url(#path3350_2_);}
+ .st30{fill:url(#path3350_3_);}
+ .st31{fill:url(#path3303_2_);stroke:#000000;stroke-width:3;}
+ .st32{fill:url(#path3373_3_);stroke:#000000;stroke-width:3;}
+ .st33{fill:url(#path2477_2_);}
+ .st34{fill:url(#path2477_3_);}
+ .st35{fill:url(#path3337_2_);stroke:#000000;stroke-width:3;}
+ .st36{fill:url(#path2460_3_);stroke:#000000;stroke-width:3;}
+ .st37{fill:url(#path3303_3_);stroke:#000000;stroke-width:3;}
+</style>
+<defs>
+</defs>
+<path d="M830.432,1371.498c24.959-0.574,28.99,21.695,28.99,37.438l-20.351,1.921c0-9.406-1.345-20.351-8.255-20.351
+ c-5.376,0.191-7.104,5.951-7.104,14.015c0,9.6,8.255,20.352,16.318,32.062c9.6,14.398,19.391,28.414,19.391,43.58
+ c0,18.816-6.145,35.518-28.798,35.518c-26.688,0-30.143-20.157-30.143-41.084l20.352-1.92c0,11.711,1.151,23.998,9.791,23.998
+ c6.144,0,8.447-6.719,8.447-15.551c0-9.408-8.831-20.734-16.703-32.639c-9.791-14.398-19.006-28.797-19.006-43.965
+ C803.362,1389.162,810.85,1371.883,830.432,1371.498z"/>
+<path d="M908.188,1373.035h20.16l-21.504,141.109H886.11l-21.503-141.109h20.158l10.367,77.562l0.771,5.951h1.151l0.767-5.951
+ L908.188,1373.035z"/>
+<path d="M970.971,1423.719v-21.692c0,0,0.386-10.367-6.912-10.367c-7.293,0-6.909,10.367-6.909,10.367v84.856
+ c0,0-0.384,10.367,6.909,10.367c7.298,0,6.912-10.367,6.912-10.367v-25.535h-8.256v-17.471h28.992v70.268h-12.289l-2.496-6.719
+ c-3.84,4.799-9.598,8.254-16.125,8.254c-26.303,0-24.383-30.524-24.383-30.524v-83.129c0,0-0.191-30.527,27.645-30.527
+ c27.841,0,27.648,30.527,27.648,30.527v21.692H970.971z"/>
+<path d="M1036.441,1373.035h19.391v19.391h-19.391V1373.035z M1036.441,1514.145v-105.016h19.391v105.016H1036.441z"/>
+<path d="M1090.584,1431.398c0,59.516,0,60.858,0,82.745h-19.391v-105.016h19.391v8.83c1.535-0.959,9.023-10.367,15.742-10.367
+ c10.367,0,14.592,11.904,14.592,20.543v86.01h-19.391v-83.131c0-4.03-2.306-4.606-4.609-4.606
+ C1093.078,1426.406,1090.584,1431.398,1090.584,1431.398z"/>
+<path d="M1191.188,1371.498c24.959-0.574,28.99,21.695,28.99,37.438l-20.35,1.921c0-9.406-1.344-20.351-8.256-20.351
+ c-5.377,0.191-7.104,5.951-7.104,14.015c0,9.6,8.254,20.352,16.318,32.062c9.6,14.398,19.391,28.414,19.391,43.58
+ c0,18.816-6.143,35.518-28.799,35.518c-26.686,0-30.141-20.157-30.141-41.084l20.352-1.92c0,11.711,1.15,23.998,9.789,23.998
+ c6.146,0,8.449-6.719,8.449-15.551c0-9.408-8.832-20.734-16.703-32.639c-9.793-14.398-19.008-28.797-19.008-43.965
+ C1164.117,1389.162,1171.605,1371.883,1191.188,1371.498z"/>
+<path d="M1231.316,1409.129h19.391v6.91c0,0,8.254-8.447,15.357-8.447c10.561,0,14.975,11.904,14.975,20.543v67.004
+ c0,8.64-4.414,20.541-14.975,20.541c-7.104,0-15.357-8.446-15.357-8.446v43.006h-19.391V1409.129z M1250.707,1491.105
+ c0,3.071,2.879,6.336,5.758,6.336s5.185-2.688,5.185-6.336v-58.939c0-3.646-2.306-6.336-5.185-6.336
+ c-2.688,0-5.758,2.688-5.758,6.336C1250.707,1455.973,1250.707,1470.947,1250.707,1491.105z"/>
+<path d="M1295.633,1373.035h19.392v19.391h-19.392V1373.035z M1295.633,1514.145v-105.016h19.392v105.016H1295.633z"/>
+<path d="M1349.777,1431.398c0,59.516,0,60.858,0,82.745h-19.392v-105.016h19.392v8.83c1.535-0.959,9.022-10.367,15.741-10.367
+ c10.367,0,14.591,11.904,14.591,20.543v86.01h-19.392v-83.131c0-4.03-2.305-4.606-4.606-4.606
+ C1352.271,1426.406,1349.777,1431.398,1349.777,1431.398z"/>
+<path d="M1443.66,1476.516v12.097c0,0,0,27.067-25.15,27.067c-24.959,0-24.959-27.645-24.959-27.645v-52.797
+ c0,0,0.193-27.646,25.15-27.646c25.15,0,24.959,27.07,24.959,27.07v30.524h-32.062v22.849c0,0,0,10.559,7.104,10.559
+ c7.297,0,6.912-10.559,6.912-10.559v-11.521L1443.66,1476.516L1443.66,1476.516z M1411.598,1450.021h14.017v-14.783
+ c0,0,0.385-10.752-6.912-10.752c-7.104,0-7.104,10.752-7.104,10.752V1450.021z"/>
+<linearGradient id="path3337_2_" gradientUnits="userSpaceOnUse" x1="932.6846" y1="-3838.2734" x2="600.4062" y2="-3149.8252" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#EAEAEA"/>
+ <stop offset="0.8138" style="stop-color:#DDDDDD"/>
+ <stop offset="0.9069" style="stop-color:#B1B1B1"/>
+ <stop offset="0.9534" style="stop-color:#9B9B9B"/>
+ <stop offset="1" style="stop-color:#858585"/>
+</linearGradient>
+<path id="path3337_1_" class="st35" d="M1353.061,229.191l-634.88,296.985l-71.595,154.932l263.803,255.067l187.937-113.549
+ L1353.061,229.191z"/>
+<linearGradient id="path3350_2_" gradientUnits="userSpaceOnUse" x1="1157.3047" y1="-3609.6172" x2="428.555" y2="-3364.7397" gradientTransform="matrix(1 0 0 1 224.6709 4002.4297)">
+ <stop offset="0" style="stop-color:#E7E7E7"/>
+ <stop offset="0.8711" style="stop-color:#D0D0D0"/>
+ <stop offset="0.9071" style="stop-color:#FBFBFB"/>
+ <stop offset="1" style="stop-color:#FDFDFD"/>
+</linearGradient>
+<path id="path3350_1_" class="st29" d="M1350.137,232.287L719.857,527.295l-72.401,154.417l18.715,17.433l96.462,8.794
+ l114.44,25.759l473.062-501.411H1350.137z"/>
+<path id="path3259_1_" class="st28" d="M1350.885,231.45L822.578,792.6"/>
+<linearGradient id="path3385_2_" gradientUnits="userSpaceOnUse" x1="510.9668" y1="-3334.5342" x2="428.7348" y2="-3310.9626" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#FBFBFB"/>
+ <stop offset="1" style="stop-color:#EEEEEE"/>
+</linearGradient>
+<path id="path3385_1_" class="st7" d="M646.722,682.15l-1.54,18.817l114.366-42.635L646.722,682.15z"/>
+<linearGradient id="path3373_2_" gradientUnits="userSpaceOnUse" x1="621.335" y1="-3225.8447" x2="598.6064" y2="-3215.897" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#ACACAC"/>
+ <stop offset="1" style="stop-color:#877D7C"/>
+</linearGradient>
+<path id="path3373_1_" class="st22" d="M759.1,657.046l158.331,241.119l-118.187,43.941L759.1,657.046z"/>
+<linearGradient id="path3292_2_" gradientUnits="userSpaceOnUse" x1="634.895" y1="-2900.3848" x2="898.5454" y2="-3227.6746" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#7D7D7D"/>
+ <stop offset="1" style="stop-color:#818181"/>
+</linearGradient>
+<path id="path3292_1_" class="st6" d="M865.494,1117.352l272.563-321.498l-33.495-41.825l-270.847,332.403L865.494,1117.352z"/>
+<linearGradient id="path3316_2_" gradientUnits="userSpaceOnUse" x1="975.0586" y1="-3153.8574" x2="1027.5601" y2="-3209.0376" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#848484"/>
+ <stop offset="0.2936" style="stop-color:#D2D2D2"/>
+ <stop offset="1" style="stop-color:#ECECEC"/>
+</linearGradient>
+<path id="path3316_1_" class="st19" d="M1303.627,952.146l-129.742-196.791l-83.994-11.476l-6.504,21.499L1303.627,952.146z"/>
+<linearGradient id="path3303_2_" gradientUnits="userSpaceOnUse" x1="897.3359" y1="-3130.7104" x2="1090.8107" y2="-3164.666" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#808080"/>
+ <stop offset="0.0979" style="stop-color:#D1D1D1"/>
+ <stop offset="1" style="stop-color:#ECE4D7"/>
+</linearGradient>
+<path id="path3303_1_" class="st31" d="M1303.41,952.342l-211.633-175.228l18.205-19.354l5.36,3.226L1303.41,952.342
+ L1303.41,952.342z"/>
+<linearGradient id="path2429_2_" gradientUnits="userSpaceOnUse" x1="7.7139" y1="-3795.7832" x2="275.9096" y2="-3300.3032" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#E6E5E0"/>
+ <stop offset="1" style="stop-color:#F2EEEF"/>
+</linearGradient>
+<path id="path2429_1_" class="st3" d="M205.652,143.872l290.951,660.35l119.131,6.258L205.652,143.872z"/>
+<linearGradient id="path2460_2_" gradientUnits="userSpaceOnUse" x1="900.4668" y1="-3090.0889" x2="648.6813" y2="-3042.946" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9135" style="stop-color:#E6E6E6"/>
+ <stop offset="1" style="stop-color:#858585"/>
+</linearGradient>
+<path id="path2460_1_" class="st25" d="M823.172,1140.922l291.43-380.356l-25.713-17.142L756.745,955.566L823.172,1140.922
+ L823.172,1140.922z"/>
+<linearGradient id="path2477_2_" gradientUnits="userSpaceOnUse" x1="755.0024" y1="-3051.8447" x2="680.5519" y2="-3074.7996" gradientTransform="matrix(1 0 0 1 222.5278 4001)">
+ <stop offset="0" style="stop-color:#F6F6F6"/>
+ <stop offset="0.8583" style="stop-color:#E8E8E8"/>
+ <stop offset="1" style="stop-color:#848484"/>
+</linearGradient>
+<path id="path2477_1_" class="st33" d="M822.51,1139.691l290.197-378.936l-23.914-15.628L877.934,1006.93L822.51,1139.691z"/>
+<linearGradient id="path3262_2_" gradientUnits="userSpaceOnUse" x1="511.0596" y1="-2954.0752" x2="619.0073" y2="-2929.4319" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#F3F3F3"/>
+ <stop offset="0.9221" style="stop-color:#F6F6F6"/>
+ <stop offset="1" style="stop-color:#919191"/>
+</linearGradient>
+<path id="path3262_1_" class="st4" d="M822.258,1140.506L708.331,986.807l132.806,11.332l12.996,11.256L822.258,1140.506
+ L822.258,1140.506z"/>
+<linearGradient id="path3279_2_" gradientUnits="userSpaceOnUse" x1="513.9253" y1="-2870.145" x2="570.7205" y2="-3041.8015" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#F3F3F3"/>
+ <stop offset="0.6192" style="stop-color:#F6F6F6"/>
+ <stop offset="1" style="stop-color:#919191"/>
+</linearGradient>
+<path id="path3279_1_" class="st16" d="M837.387,1050.443l-129.056-63.637l132.806,11.332l11.859,9.521L837.387,1050.443
+ L837.387,1050.443z"/>
+<linearGradient id="path2440_2_" gradientUnits="userSpaceOnUse" x1="589.332" y1="-3269.6738" x2="473.4179" y2="-3132.5469" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9007" style="stop-color:#DEDEDE"/>
+ <stop offset="1" style="stop-color:#9E9E9E"/>
+</linearGradient>
+<path id="path2440_1_" class="st8" d="M530.292,738.309l229.001-80.127l94.618,349.51l-33.463-1.871L530.292,738.309z"/>
+<linearGradient id="path2455_2_" gradientUnits="userSpaceOnUse" x1="638.0103" y1="-3227.4702" x2="516.0342" y2="-3094.1296" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#FFFFFF"/>
+ <stop offset="0.9007" style="stop-color:#DEDEDE"/>
+ <stop offset="1" style="stop-color:#9E9E9E"/>
+</linearGradient>
+<path id="path2455_1_" class="st1" d="M718.029,947.681l41.062-290.169l94.819,350.18l-33.463-1.871L718.029,947.681
+ L718.029,947.681z"/>
+<linearGradient id="path2382_2_" gradientUnits="userSpaceOnUse" x1="-248.8364" y1="-3229.5376" x2="482.8853" y2="-3121.2249" gradientTransform="matrix(1 0 0 1 222.5283 4001)">
+ <stop offset="0" style="stop-color:#A1A1A1"/>
+ <stop offset="0.6384" style="stop-color:#ABABAB"/>
+ <stop offset="0.8293" style="stop-color:#C7C7C7"/>
+ <stop offset="1" style="stop-color:#E3E3E3"/>
+</linearGradient>
+<path id="path2382_1_" class="st14" d="M547.716,732.152l-132.961-37.69L42.198,878.373l731.477,153.795l79.407-23.627
+ L705.49,893.335L547.716,732.152L547.716,732.152z"/>
+<linearGradient id="path2414_2_" gradientUnits="userSpaceOnUse" x1="131.9819" y1="-2957.0391" x2="215.4882" y2="-3202.2952" gradientTransform="matrix(1 0 0 1 272.0254 4028.2734)">
+ <stop offset="0" style="stop-color:#A6A6A6"/>
+ <stop offset="0.6456" style="stop-color:#B5B5B5"/>
+ <stop offset="0.8757" style="stop-color:#D4D4D4"/>
+ <stop offset="1" style="stop-color:#E1E1E1"/>
+</linearGradient>
+<path id="path2414_1_" class="st10" d="M42.198,878.373l731.477,153.795l79.17-23.676L705.489,893.335L42.198,878.373
+ L42.198,878.373z"/>
+<path id="path3817_1_" class="st0" d="M67.316,1935.454l226.709,0.404c3.166,0,5.999-0.471,5.999,6.318l-0.277,74.659H61.594V1941.9
+ C61.594,1938.551,61.918,1935.454,67.316,1935.454z"/>
+<path id="path5906_1_" class="st24" d="M129.544,1973.651c0.009,15.059-12.193,27.273-27.254,27.282
+ c-15.061,0.01-27.277-12.19-27.287-27.25c0-0.011,0-0.021,0-0.032c-0.008-15.062,12.195-27.274,27.254-27.283
+ c15.062-0.01,27.277,12.192,27.287,27.25C129.544,1973.628,129.544,1973.64,129.544,1973.651z"/>
+<path id="path5708_1_" d="M124.441,1951.442c6.047,6.047,9.072,13.452,9.072,22.209c0,8.76-2.971,16.084-8.917,21.977
+ c-6.305,6.202-13.762,9.304-22.363,9.304c-8.496,0-15.82-3.073-21.973-9.228c-6.152-6.151-9.227-13.502-9.227-22.053
+ c0-8.549,3.074-15.953,9.227-22.209c5.996-6.049,13.32-9.072,21.973-9.072C110.994,1942.37,118.395,1945.394,124.441,1951.442z
+ M84.332,1955.509c-5.111,5.165-7.668,11.213-7.668,18.15s2.531,12.934,7.59,17.992c5.061,5.059,11.085,7.588,18.074,7.588
+ c6.988,0,13.064-2.555,18.229-7.666c4.904-4.746,7.355-10.715,7.355-17.914c0-7.144-2.492-13.207-7.475-18.188
+ c-4.98-4.98-11.015-7.473-18.109-7.473S89.234,1950.503,84.332,1955.509z M97.787,1970.608c-0.782-1.704-1.951-2.555-3.51-2.555
+ c-2.758,0-4.137,1.855-4.137,5.566s1.379,5.565,4.137,5.565c1.82,0,3.121-0.903,3.9-2.715l3.822,2.035
+ c-1.82,3.236-4.554,4.855-8.199,4.855c-2.809,0-5.063-0.861-6.752-2.584c-1.693-1.723-2.538-4.1-2.538-7.127
+ c0-2.975,0.871-5.338,2.613-7.088c1.746-1.747,3.917-2.623,6.521-2.623c3.852,0,6.609,1.519,8.275,4.552L97.787,1970.608z
+ M115.767,1970.608c-0.783-1.704-1.928-2.555-3.439-2.555c-2.812,0-4.219,1.855-4.219,5.566s1.406,5.565,4.219,5.565
+ c1.824,0,3.101-0.903,3.828-2.715l3.908,2.035c-1.818,3.236-4.549,4.855-8.186,4.855c-2.804,0-5.053-0.861-6.742-2.584
+ c-1.688-1.723-2.532-4.1-2.532-7.127c0-2.975,0.857-5.338,2.572-7.088c1.712-1.747,3.897-2.623,6.547-2.623
+ c3.846,0,6.6,1.519,8.26,4.552L115.767,1970.608z"/>
+<path id="path294_1_" d="M296.008,1934.501H64.992c-2.477,0-4.492,2.015-4.492,4.494v78.49c0,0.561,0.453,1.016,1.014,1.016h237.971
+ c0.561,0,1.016-0.455,1.016-1.016v-78.49C300.5,1936.516,298.484,1934.501,296.008,1934.501z M64.992,1936.53h231.015
+ c1.357,0,2.461,1.104,2.461,2.464c0,0,0,31.637,0,54.49H133.356c-6.051,10.939-17.711,18.369-31.094,18.369
+ c-13.387,0-25.043-7.422-31.089-18.369h-8.645c0-22.854,0-54.49,0-54.49C62.527,1937.636,63.634,1936.53,64.992,1936.53z"/>
+<path id="path298_1_" class="st24" d="M233.027,2009.966c0.16,0.31,0.373,0.559,0.639,0.753c0.266,0.191,0.577,0.333,0.933,0.425
+ c0.36,0.094,0.73,0.142,1.111,0.142c0.259,0,0.537-0.022,0.833-0.066c0.295-0.043,0.573-0.128,0.832-0.25
+ c0.259-0.123,0.477-0.293,0.647-0.51c0.176-0.216,0.261-0.491,0.261-0.825c0-0.358-0.115-0.649-0.344-0.872
+ c-0.229-0.225-0.53-0.408-0.898-0.556c-0.371-0.148-0.791-0.277-1.258-0.391c-0.471-0.111-0.945-0.235-1.428-0.371
+ c-0.494-0.123-0.977-0.273-1.447-0.453c-0.467-0.18-0.886-0.412-1.258-0.697c-0.371-0.283-0.67-0.64-0.898-1.066
+ c-0.229-0.425-0.344-0.943-0.344-1.549c0-0.68,0.146-1.271,0.435-1.772c0.291-0.499,0.672-0.918,1.143-1.252
+ c0.467-0.334,1-0.582,1.594-0.742c0.59-0.16,1.184-0.242,1.777-0.242c0.692,0,1.355,0.078,1.993,0.234
+ c0.637,0.154,1.204,0.404,1.695,0.753c0.496,0.346,0.886,0.788,1.178,1.325c0.289,0.538,0.435,1.191,0.435,1.958h-2.826
+ c-0.026-0.396-0.109-0.724-0.249-0.982c-0.142-0.26-0.332-0.465-0.562-0.613c-0.236-0.147-0.504-0.254-0.805-0.314
+ c-0.303-0.062-0.631-0.094-0.988-0.094c-0.233,0-0.469,0.026-0.7,0.074c-0.237,0.051-0.447,0.138-0.637,0.26
+ c-0.194,0.125-0.352,0.279-0.473,0.463c-0.121,0.188-0.184,0.423-0.184,0.707c0,0.259,0.046,0.471,0.146,0.631
+ c0.1,0.159,0.295,0.309,0.584,0.445c0.289,0.135,0.691,0.271,1.203,0.408c0.514,0.135,1.184,0.309,2.012,0.52
+ c0.247,0.049,0.588,0.138,1.027,0.27c0.438,0.129,0.874,0.335,1.305,0.621c0.433,0.285,0.807,0.665,1.123,1.141
+ c0.314,0.476,0.471,1.086,0.471,1.828c0,0.607-0.117,1.17-0.352,1.689c-0.237,0.52-0.586,0.967-1.049,1.343
+ c-0.463,0.379-1.039,0.672-1.724,0.884c-0.688,0.21-1.482,0.313-2.383,0.313c-0.73,0-1.438-0.09-2.125-0.269
+ c-0.686-0.181-1.293-0.462-1.82-0.846c-0.524-0.385-0.941-0.876-1.25-1.469c-0.309-0.594-0.457-1.299-0.445-2.116h2.826
+ C232.787,2009.28,232.867,2009.657,233.027,2009.966z"/>
+<path id="path300_1_" class="st24" d="M249.438,1999.995l4.957,13.244h-3.027l-1-2.949h-4.957l-1.038,2.949h-2.932l5.01-13.244
+ H249.438z M249.605,2008.116l-1.668-4.855h-0.039l-1.726,4.855H249.605z"/>
+<path id="path304_1_" class="st24" d="M180.492,1999.995c0.633,0,1.208,0.057,1.729,0.168c0.521,0.111,0.967,0.293,1.337,0.546
+ c0.371,0.254,0.66,0.591,0.866,1.01c0.203,0.421,0.307,0.94,0.307,1.56c0,0.668-0.152,1.222-0.457,1.668
+ c-0.301,0.445-0.752,0.809-1.346,1.094c0.818,0.235,1.43,0.647,1.833,1.234c0.402,0.589,0.605,1.295,0.605,2.126
+ c0,0.667-0.129,1.245-0.391,1.733c-0.259,0.488-0.611,0.887-1.05,1.197c-0.439,0.31-0.941,0.538-1.503,0.686
+ c-0.566,0.148-1.145,0.223-1.74,0.223h-6.432v-13.244H180.492L180.492,1999.995z M180.121,2005.353c0.52,0,0.945-0.123,1.281-0.369
+ c0.336-0.248,0.501-0.648,0.501-1.203c0-0.309-0.057-0.562-0.166-0.76c-0.113-0.197-0.262-0.35-0.447-0.461
+ c-0.186-0.111-0.401-0.19-0.641-0.232c-0.243-0.043-0.494-0.064-0.752-0.064h-2.731v3.089L180.121,2005.353L180.121,2005.353z
+ M180.291,2010.974c0.285,0,0.557-0.027,0.818-0.083c0.257-0.057,0.49-0.148,0.688-0.277c0.2-0.132,0.355-0.308,0.475-0.528
+ c0.12-0.223,0.176-0.506,0.176-0.854c0-0.678-0.192-1.164-0.577-1.455c-0.382-0.289-0.892-0.436-1.523-0.436h-3.18v3.635h3.124
+ V2010.974z"/>
+<path id="path306_1_" class="st24" d="M185.881,1999.995h3.267l3.102,5.23l3.082-5.23h3.246l-4.914,8.162v5.082h-2.922v-5.156
+ L185.881,1999.995z"/>
+<path id="path6318_2_" class="st24" d="M265.307,1964.461c0.008,11.692-9.463,21.176-21.154,21.185
+ c-11.691,0.01-21.176-9.461-21.188-21.153c0-0.01,0-0.021,0-0.031c-0.008-11.691,9.465-21.173,21.156-21.184
+ c11.691-0.008,21.178,9.463,21.186,21.153C265.307,1964.442,265.307,1964.452,265.307,1964.461z"/>
+<path id="path6322_2_" d="M243.984,1941.271c-6.426,0-11.861,2.242-16.313,6.725c-4.566,4.639-6.85,10.127-6.85,16.466
+ s2.283,11.789,6.85,16.349c4.566,4.562,10.004,6.843,16.313,6.843c6.387,0,11.919-2.302,16.605-6.9
+ c4.41-4.367,6.617-9.797,6.617-16.291c0-6.493-2.246-11.982-6.737-16.466C255.98,1943.514,250.486,1941.271,243.984,1941.271z
+ M244.043,1945.446c5.264,0,9.734,1.855,13.412,5.566c3.713,3.672,5.57,8.154,5.57,13.449c0,5.334-1.816,9.76-5.456,13.276
+ c-3.832,3.787-8.341,5.68-13.527,5.68c-5.188,0-9.656-1.873-13.411-5.621c-3.754-3.75-5.631-8.193-5.631-13.336
+ c0-5.139,1.896-9.623,5.689-13.449C234.328,1947.302,238.779,1945.446,244.043,1945.446z"/>
+<path id="path6324_2_" d="M233.705,1961.188c0.924-5.834,5.034-8.953,10.182-8.953c7.403,0,11.915,5.373,11.915,12.535
+ c0,6.99-4.801,12.42-12.032,12.42c-4.976,0-9.428-3.061-10.238-9.068h5.841c0.174,3.119,2.2,4.217,5.092,4.217
+ c3.295,0,5.438-3.061,5.438-7.742c0-4.908-1.852-7.508-5.324-7.508c-2.542,0-4.742,0.924-5.205,4.1l1.701-0.008l-4.602,4.598
+ l-4.597-4.598L233.705,1961.188z"/>
+<circle id="circle315_1_" class="st24" cx="187.219" cy="1964.935" r="21.473"/>
+<path id="path319_1_" d="M193.436,1958.72c0-0.826-0.672-1.497-1.498-1.497h-9.486c-0.826,0-1.498,0.67-1.498,1.497v9.486h2.645
+ v11.232h7.191v-11.232h2.646V1958.72L193.436,1958.72z"/>
+<circle id="circle321_1_" cx="187.195" cy="1952.729" r="3.243"/>
+<path id="path323_1_" d="M187.164,1941.271c-6.422,0-11.864,2.242-16.313,6.725c-4.566,4.637-6.849,10.127-6.849,16.465
+ s2.283,11.789,6.849,16.351c4.566,4.561,10.005,6.839,16.313,6.839c6.387,0,11.921-2.298,16.603-6.897
+ c4.415-4.367,6.62-9.797,6.62-16.292c0-6.494-2.244-11.982-6.735-16.465C199.164,1943.515,193.667,1941.271,187.164,1941.271z
+ M187.223,1945.446c5.264,0,9.734,1.855,13.41,5.566c3.717,3.67,5.574,8.154,5.574,13.449c0,5.332-1.819,9.76-5.457,13.277
+ c-3.832,3.787-8.34,5.681-13.527,5.681s-9.656-1.874-13.41-5.624c-3.753-3.748-5.63-8.193-5.63-13.334
+ c0-5.14,1.896-9.622,5.689-13.449C177.507,1947.302,181.96,1945.446,187.223,1945.446z"/>
+</svg>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.css b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.css
new file mode 100644
index 0000000..bf5face
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.css
@@ -0,0 +1,7 @@
+body {
+ margin-left : 6em;
+ margin-right : 16em;
+ color:black;
+ font-family: arial, helvetica, sans-serif;
+ background-image: url('image.svg');
+}
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.opf
new file mode 100644
index 0000000..da8d38f
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.opf
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t2" href="svg-img-not-declared.xhtml" media-type="application/xhtml+xml" />
+ <item id="t3" href="svg-img-declared.xhtml" properties="svg" media-type="application/xhtml+xml" />
+ <item id="t4" href="svg-imgdata-not-declared.xhtml" media-type="application/xhtml+xml" />
+ <item id="t5" href="svg-imgdata-declared.xhtml" properties="svg" media-type="application/xhtml+xml" />
+ <item id="t6" href="svg-embed-not-declared.xhtml" media-type="application/xhtml+xml" />
+ <item id="t7" href="svg-embed-declared.xhtml" properties="svg" media-type="application/xhtml+xml" />
+ <item id="t8" href="svg-object-not-declared.xhtml" media-type="application/xhtml+xml" />
+ <item id="t9" href="svg-object-declared.xhtml" properties="svg" media-type="application/xhtml+xml" />
+ <item id="t10" href="svg-iframe-not-declared.xhtml" media-type="application/xhtml+xml" />
+ <item id="t11" href="svg-iframe-declared.xhtml" properties="svg" media-type="application/xhtml+xml" />
+ <item id="svg" href="image.svg" media-type="image/svg+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ <itemref idref="t2" />
+ <itemref idref="t3" />
+ <itemref idref="t4" />
+ <itemref idref="t5" />
+ <itemref idref="t6" />
+ <itemref idref="t7" />
+ <itemref idref="t8" />
+ <itemref idref="t9" />
+ <itemref idref="t10" />
+ <itemref idref="t11" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.xhtml
new file mode 100644
index 0000000..6b9bcb8
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/lorem.xhtml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-declared.xhtml
new file mode 100644
index 0000000..57ca219
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <embed src="image.svg" type="image/svg+xml"></embed>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-not-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-not-declared.xhtml
new file mode 100644
index 0000000..57ca219
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-embed-not-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <embed src="image.svg" type="image/svg+xml"></embed>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-declared.xhtml
new file mode 100644
index 0000000..6a0e862
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <iframe src="image.svg" width="256" height="256"></iframe>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-not-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-not-declared.xhtml
new file mode 100644
index 0000000..6a0e862
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-iframe-not-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <iframe src="image.svg" width="256" height="256"></iframe>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-declared.xhtml
new file mode 100644
index 0000000..0439ed9
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <img src="image.svg" alt="" />
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-not-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-not-declared.xhtml
new file mode 100644
index 0000000..0439ed9
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-img-not-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <img src="image.svg" alt="" />
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-declared.xhtml
new file mode 100644
index 0000000..22ea7f2
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-declared.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <img
+ src="data:image/svg+xml,%3C%3Fxml%20version%3D%271.0%27%20encoding%3D%27UTF-8%27%3F%3E%0A%3Csvg%20width%3D%27256%27%20height%3D%27256%27%20version%3D%271.1%27%0A%20%20%20%20%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%27%3E%0A%09%3Crect%20fill%3D%27plum%27%20height%3D%27256px%27%20width%3D%27256px%27%2F%3E%0A%3C%2Fsvg%3E"
+ alt="" />
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-not-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-not-declared.xhtml
new file mode 100644
index 0000000..22ea7f2
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-imgdata-not-declared.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <img
+ src="data:image/svg+xml,%3C%3Fxml%20version%3D%271.0%27%20encoding%3D%27UTF-8%27%3F%3E%0A%3Csvg%20width%3D%27256%27%20height%3D%27256%27%20version%3D%271.1%27%0A%20%20%20%20%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20xmlns%3Axlink%3D%27http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%27%3E%0A%09%3Crect%20fill%3D%27plum%27%20height%3D%27256px%27%20width%3D%27256px%27%2F%3E%0A%3C%2Fsvg%3E"
+ alt="" />
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-declared.xhtml
new file mode 100644
index 0000000..29f58c8
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <object data="image.svg" type="image/svg+xml"></object>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-not-declared.xhtml b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-not-declared.xhtml
new file mode 100644
index 0000000..29f58c8
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/svg-referenced/EPUB/svg-object-not-declared.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <object data="image.svg" type="image/svg+xml"></object>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/svg-referenced/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/svg-referenced/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/svg-referenced/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/svg-referenced/mimetype
diff --git a/src/test/resources/30/expanded/valid/wasteland-basic.txt b/src/test/resources/30/expanded/valid/wasteland-basic.txt
index d7b1b0a..83f66af 100644
--- a/src/test/resources/30/expanded/valid/wasteland-basic.txt
+++ b/src/test/resources/30/expanded/valid/wasteland-basic.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] The Waste Land
[creator] T.S. Eliot
diff --git a/src/test/resources/30/expanded/valid/wasteland-otf.txt b/src/test/resources/30/expanded/valid/wasteland-otf.txt
index 9cc5341..aefd390 100644
--- a/src/test/resources/30/expanded/valid/wasteland-otf.txt
+++ b/src/test/resources/30/expanded/valid/wasteland-otf.txt
@@ -1,5 +1,5 @@
# creation date is not stable between different runs
-[format version] 3.0
+[format version] 3.0.1
[format name] application/epub+zip
[title] The Waste Land
[creator] T.S. Eliot
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.css
similarity index 100%
copy from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
copy to src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.opf
new file mode 100644
index 0000000..d5747a5
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ <item id="xpgt" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml" fallback="css"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.xhtml
new file mode 100644
index 0000000..e99556b
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/lorem.xhtml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/page-template.xpgt b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/page-template.xpgt
new file mode 100755
index 0000000..d260589
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/EPUB/page-template.xpgt
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <fo:layout-master-set>
+
+ <fo:simple-page-master master-name="single_column">
+ <fo:region-body margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column_head" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master>
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="single_column"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+
+ </fo:layout-master-set>
+
+ <ade:style>
+ <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
+ </ade:style>
+
+</ade:template>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/META-INF/container.xml
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
copy to src/test/resources/30/expanded/valid/xpgt-explicit-fallback/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/xpgt-explicit-fallback/mimetype
similarity index 100%
copy from src/test/resources/30/expanded/valid/collections-preview/mimetype
copy to src/test/resources/30/expanded/valid/xpgt-explicit-fallback/mimetype
diff --git a/src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.css
similarity index 100%
rename from src/test/resources/30/expanded/valid/lorem-xrenditions/EPUB/lorem.css
rename to src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.css
diff --git a/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.opf b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.opf
new file mode 100644
index 0000000..948982e
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="css" href="lorem.css" media-type="text/css" />
+ <item id="xpgt" href="page-template.xpgt" media-type="application/vnd.adobe-page-template+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.xhtml b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.xhtml
new file mode 100644
index 0000000..17f76c2
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/lorem.xhtml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la"
+ xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>Lorem Ipsum</title>
+ <link type="text/css" rel="stylesheet" href="lorem.css" />
+ <link rel="stylesheet" type="application/vnd.adobe-page-template+xml" href="page-template.xpgt"/>
+ </head>
+ <body>
+ <h1>Lorem Ipsum</h1>
+ <section>
+ <h2>Table of Contents</h2>
+ <nav epub:type="toc">
+ <ol>
+ <li><a href="#ch1">Chapter 1</a></li>
+ <li><a href="#ch2">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </section>
+ <section id="ch1">
+ <h2>Chapter 1</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut
+ auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante,
+ auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur
+ condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium.
+ Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna
+ vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc
+ condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla
+ quis sagittis nec, viverra et nibh.</p>
+
+ <p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum
+ bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum
+ fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit.
+ Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non
+ vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed
+ sed est justo, in lacinia nulla.</p>
+
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus
+ ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat.
+ Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada
+ venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
+ ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula
+ pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere
+ metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam
+ neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis
+ quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies
+ ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent
+ convallis lacus vitae justo lobortis euismod. In at ante elit.</p>
+
+ <p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a
+ scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus
+ hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam
+ pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis
+ dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p>
+
+ <p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna
+ aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum
+ felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus
+ lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra
+ accumsan. Nullam suscipit tellus felis.</p>
+ </section>
+ <section id="ch2">
+ <h2>Chapter 2</h2>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis.
+ Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia
+ Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi
+ ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus
+ metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id
+ faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies
+ quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis
+ a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare
+ leo ipsum ut nisl.</p>
+
+ <p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna
+ massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit
+ amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor
+ cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur
+ eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum
+ sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin
+ vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt
+ tincidunt.</p>
+
+ <p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque
+ dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id,
+ condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue
+ turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo
+ sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p>
+
+ <p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at.
+ Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
+ egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum
+ laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per
+ conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem
+ ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo
+ pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem.
+ Nam a lectus sit amet justo facilisis suscipit.</p>
+
+ <p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur
+ sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed
+ scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut
+ et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed.
+ Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor,
+ pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus
+ cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis
+ quis metus.</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/page-template.xpgt b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/page-template.xpgt
new file mode 100755
index 0000000..d260589
--- /dev/null
+++ b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/EPUB/page-template.xpgt
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<ade:template xmlns="http://www.w3.org/1999/xhtml" xmlns:ade="http://ns.adobe.com/2006/ade" xmlns:fo="http://www.w3.org/1999/XSL/Format">
+
+ <fo:layout-master-set>
+
+ <fo:simple-page-master master-name="single_column">
+ <fo:region-body margin-bottom="1.5em" margin-top="1.5em" margin-left="1.5em" margin-right="1.5em"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="two_column_head" margin-bottom="1em" margin-top="1em" margin-left="1em" margin-right="1em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="2" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:simple-page-master master-name="three_column_head" margin-bottom="0.5em" margin-top="0.5em" margin-left="0.5em" margin-right="0.5em">
+ <fo:region-before extent="8.3em"/>
+ <fo:region-body column-count="3" column-gap="10pt"/>
+ </fo:simple-page-master>
+
+ <fo:page-sequence-master>
+ <fo:repeatable-page-master-alternatives>
+ <fo:conditional-page-master-reference master-reference="three_column_head" page-position="first" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="three_column" ade:min-page-width="80em"/>
+ <fo:conditional-page-master-reference master-reference="two_column_head" page-position="first" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="two_column" ade:min-page-width="50em"/>
+ <fo:conditional-page-master-reference master-reference="single_column"/>
+ </fo:repeatable-page-master-alternatives>
+ </fo:page-sequence-master>
+
+ </fo:layout-master-set>
+
+ <ade:style>
+ <ade:styling-rule selector=".title_box" display="adobe-other-region" adobe-region="xsl-region-before"/>
+ </ade:style>
+
+</ade:template>
\ No newline at end of file
diff --git a/src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/META-INF/container.xml
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/META-INF/container.xml
rename to src/test/resources/30/expanded/valid/xpgt-implicit-fallback/META-INF/container.xml
diff --git a/src/test/resources/30/expanded/valid/collections-preview/mimetype b/src/test/resources/30/expanded/valid/xpgt-implicit-fallback/mimetype
similarity index 100%
rename from src/test/resources/30/expanded/valid/collections-preview/mimetype
rename to src/test/resources/30/expanded/valid/xpgt-implicit-fallback/mimetype
diff --git a/src/test/resources/30/single/nav/valid/issue538.xhtml b/src/test/resources/30/single/nav/valid/issue538.xhtml
new file mode 100644
index 0000000..daec3a7
--- /dev/null
+++ b/src/test/resources/30/single/nav/valid/issue538.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+
+ </head>
+ <body>
+ <nav epub:type="toc">
+ <h1><img src="image.png" alt="heading"/></h1>
+ <ol>
+ <li><a href="chap1.xhtml"><img src="image.png" aria-label="Chapter 1"/></a>
+ <ol>
+ <li><a href="chap1.1.xhtml">Chapter 1.1</a></li>
+ <li><a href="chap1.2.xhtml">Chapter 1.2</a></li>
+ </ol>
+ </li>
+ <li><a href="chap2.xhtml">Chapter 2</a></li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/opf/invalid/collection-foreign-idpf.org.opf b/src/test/resources/30/single/opf/invalid/collection-foreign-idpf.org.opf
new file mode 100644
index 0000000..ace3282
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/collection-foreign-idpf.org.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Previews</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2014-07-29</dc:date>
+ <meta property="dcterms:modified">2014-07-29T15:47:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="EPUB/xhtml/lorem1.xhtml" properties="nav"
+ media-type="application/xhtml+xml"/>
+ <item id="t2" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ <item id="img" href="image1.jpg" media-type="image/jpeg"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+ <collection role="http://idpf.org.example.org/">
+ <link href="http://example.org/resource"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/collection-foreign-invalid-uri.opf b/src/test/resources/30/single/opf/invalid/collection-foreign-invalid-uri.opf
new file mode 100644
index 0000000..4a1a473
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/collection-foreign-invalid-uri.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Previews</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2014-07-29</dc:date>
+ <meta property="dcterms:modified">2014-07-29T15:47:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="EPUB/xhtml/lorem1.xhtml" properties="nav"
+ media-type="application/xhtml+xml"/>
+ <item id="t2" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ <item id="img" href="image1.jpg" media-type="image/jpeg"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+ <collection role="http://invalid%">
+ <link href="http://example.org/resource"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/collection-invalid-manifest-001.opf b/src/test/resources/30/single/opf/invalid/collection-manifest-toplevel.opf
similarity index 100%
rename from src/test/resources/30/single/opf/invalid/collection-invalid-manifest-001.opf
rename to src/test/resources/30/single/opf/invalid/collection-manifest-toplevel.opf
diff --git a/src/test/resources/30/single/opf/invalid/collection-unknown-role.opf b/src/test/resources/30/single/opf/invalid/collection-unknown-role.opf
new file mode 100644
index 0000000..ce170d7
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/collection-unknown-role.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Previews</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2014-07-29</dc:date>
+ <meta property="dcterms:modified">2014-07-29T15:47:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="EPUB/xhtml/lorem1.xhtml" properties="nav"
+ media-type="application/xhtml+xml"/>
+ <item id="t2" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ <item id="img" href="image1.jpg" media-type="image/jpeg"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+ <collection role="foo">
+ <link href="http://example.org/resource"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-invalidcollection.opf b/src/test/resources/30/single/opf/invalid/dict-lang-invalidcollection.opf
new file mode 100644
index 0000000..bd8b176
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-invalidcollection.opf
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <dc:language>fr</dc:language>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">fr</meta>
+ </metadata>
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">fr</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-invalidtoplevel.opf b/src/test/resources/30/single/opf/invalid/dict-lang-invalidtoplevel.opf
new file mode 100644
index 0000000..cab2cbc
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-invalidtoplevel.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-missingcollection.opf b/src/test/resources/30/single/opf/invalid/dict-lang-missingcollection.opf
new file mode 100644
index 0000000..206c926
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-missingcollection.opf
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <!--<meta property="target-language">en</meta>-->
+ </metadata>
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-missingtoplevel.opf b/src/test/resources/30/single/opf/invalid/dict-lang-missingtoplevel.opf
new file mode 100644
index 0000000..eb593f2
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-missingtoplevel.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <!--<meta property="source-language">en</meta>-->
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredcollection.opf b/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredcollection.opf
new file mode 100644
index 0000000..9079420
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredcollection.opf
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">fr</meta>
+ </metadata>
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredtoplevel.opf b/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredtoplevel.opf
new file mode 100644
index 0000000..a2724b8
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-lang-undeclaredtoplevel.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">fr</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-missingresource.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-missingresource.opf
new file mode 100644
index 0000000..8cccc2b
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-missingresource.opf
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm3" href="search3.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="mssing.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-morethanoneskm.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-morethanoneskm.opf
new file mode 100644
index 0000000..bc3044b
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-morethanoneskm.opf
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm3" href="search3.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="search3.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-nonxhtml.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-nonxhtml.opf
new file mode 100644
index 0000000..86300b1
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-nonxhtml.opf
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm3" href="search3.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="style.css"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-noskm.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-noskm.opf
new file mode 100644
index 0000000..f7acc8c
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-noskm.opf
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-sharedskm.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-sharedskm.opf
new file mode 100644
index 0000000..c9e0cfe
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-sharedskm.opf
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-multiple-subcollection.opf b/src/test/resources/30/single/opf/invalid/dict-multiple-subcollection.opf
new file mode 100644
index 0000000..d1b0ddf
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-multiple-subcollection.opf
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm3" href="search3.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <collection role="manifest">
+ <link href="dict2.xhtml"/>
+ </collection>
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-nodctype.opf b/src/test/resources/30/single/opf/invalid/dict-nodctype.opf
new file mode 100644
index 0000000..b40248e
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-nodctype.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <!--<dc:type>dictionary</dc:type>-->
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-single-noskm-2.opf b/src/test/resources/30/single/opf/invalid/dict-single-noskm-2.opf
new file mode 100644
index 0000000..ede14ba
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-single-noskm-2.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-single-noskm.opf b/src/test/resources/30/single/opf/invalid/dict-single-noskm.opf
new file mode 100644
index 0000000..dc6c86a
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-single-noskm.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <!--<item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>-->
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-skm-badmediatype.opf b/src/test/resources/30/single/opf/invalid/dict-skm-badmediatype.opf
new file mode 100644
index 0000000..25180c7
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-skm-badmediatype.opf
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="search-key-map"
+ media-type="application/xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-type-unknown.opf b/src/test/resources/30/single/opf/invalid/dict-type-unknown.opf
new file mode 100644
index 0000000..a9777ef
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-type-unknown.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ <meta property="dictionary-type">foo</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/dict-undeclaredcollection.opf b/src/test/resources/30/single/opf/invalid/dict-undeclaredcollection.opf
new file mode 100644
index 0000000..b40248e
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/dict-undeclaredcollection.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <!--<dc:type>dictionary</dc:type>-->
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/edupub-accessFeature-none.opf b/src/test/resources/30/single/opf/invalid/edupub-accessFeature-none.opf
new file mode 100644
index 0000000..41eab82
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/edupub-accessFeature-none.opf
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">none</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/edupub-missing-dc-type.opf b/src/test/resources/30/single/opf/invalid/edupub-missing-dc-type.opf
new file mode 100644
index 0000000..0ff2206
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/edupub-missing-dc-type.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/edupub-no-accessFeature.opf b/src/test/resources/30/single/opf/invalid/edupub-no-accessFeature.opf
new file mode 100644
index 0000000..98416bf
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/edupub-no-accessFeature.opf
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-no-dc-type.opf b/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-no-dc-type.opf
new file mode 100644
index 0000000..3d3985f
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-no-dc-type.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>teacher-edition</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <dc:source>foo.student.edition</dc:source>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-nosource.opf b/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-nosource.opf
new file mode 100644
index 0000000..572a085
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/edupub-teacher-edition-nosource.opf
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:type>teacher-edition</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/id-unique-spaces.opf b/src/test/resources/30/single/opf/invalid/id-unique-spaces.opf
new file mode 100644
index 0000000..fe70f46
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/id-unique-spaces.opf
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../../src/schema/package-30.rnc" type="compact"?>
+<?oxygen SCHSchema="../../../src/schema/package-30.sch"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0"
+ unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <!-- dupe arbitrary IDs -->
+ <metadata>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-446655440000</dc:identifier>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="text001" href="text001.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="text002" href="text002.xhtml" media-type="application/xhtml+xml" />
+ <item id="img001" href="image.png" media-type="image/png" />
+ <item id=" img001" href="image.jpg" media-type="image/jpg" />
+ <item id="ncx" href="ncx.ncx" media-type="application/x-dtbncx+xml" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="text001" />
+ <itemref idref="text002" />
+ </spine>
+ <guide>
+ <reference href="text001.xhtml" type="cover" title="Cover"/>
+ </guide>
+
+
+
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/idx-collection-indexgroup-withchild.opf b/src/test/resources/30/single/opf/invalid/idx-collection-indexgroup-withchild.opf
new file mode 100644
index 0000000..33d6fd9
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/idx-collection-indexgroup-withchild.opf
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+ <collection role="index">
+ <collection role="index-group">
+ <collection role="http://example.org">
+ <link href="http://exemple.org"/>
+ </collection>
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+ </collection>
+
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/idx-collection-invalidchild.opf b/src/test/resources/30/single/opf/invalid/idx-collection-invalidchild.opf
new file mode 100644
index 0000000..d2b5ae9
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/idx-collection-invalidchild.opf
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+ <collection role="index">
+ <collection role="http://example.org">
+ <link href="http://exemple.org"/>
+ </collection>
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/idx-collection-resource-noxhtml.opf b/src/test/resources/30/single/opf/invalid/idx-collection-resource-noxhtml.opf
new file mode 100644
index 0000000..f836d15
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/idx-collection-resource-noxhtml.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+ <collection role="index">
+ <link href="http://example.org/index.xhtml"/>
+ <link href="style.css"/>
+ </collection>
+
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/idx-collection-toplevel-indexgroup.opf b/src/test/resources/30/single/opf/invalid/idx-collection-toplevel-indexgroup.opf
new file mode 100644
index 0000000..12ac801
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/idx-collection-toplevel-indexgroup.opf
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx-a01" href="subjectIndex-a01.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-a02" href="subjectIndex-a02.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-a03" href="subjectIndex-a03.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-b" href="subjectIndex-b.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c01" href="subjectIndex-c01.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c02" href="subjectIndex-c02.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c03" href="subjectIndex-c03.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-d" href="subjectIndex-d.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-e" href="subjectIndex-e.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+ <collection role="index-group">
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/item-nomediatype.opf b/src/test/resources/30/single/opf/invalid/item-nomediatype.opf
new file mode 100644
index 0000000..88945f7
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/item-nomediatype.opf
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../../src/schema/package-30.rnc" type="compact"?>
+<?oxygen SCHSchema="../../../src/schema/package-30.sch"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0"
+ xml:lang="en-GB" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-446655440000</dc:identifier>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:creator>Haruki Murakami</dc:creator>
+ <dc:language>en</dc:language>
+ <dc:date>2010-02-01</dc:date>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <link href="http://example.org/#foo" rel="onix-record"/>
+ </metadata>
+ <manifest>
+ <item id="text001" href="text001.xhtml" properties="nav scripted" media-type="application/xhtml+xml" />
+ <item id="text002" href="text002.xhtml" media-type="application/xhtml+xml" />
+ <item id="img001" href="image.png" media-type="image/png" properties="cover-image" />
+ <item id="img002" href="image.jpg" />
+ <item id="ncx" href="ncx.ncx" media-type="application/x-dtbncx+xml" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="text001" />
+ <itemref idref="text002" />
+ </spine>
+ <guide>
+ <reference href="text001.xhtml" type="cover" title="Cover"/>
+ </guide>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/item-properties.opf b/src/test/resources/30/single/opf/invalid/item-properties.opf
index e0b170a..89251a6 100644
--- a/src/test/resources/30/single/opf/invalid/item-properties.opf
+++ b/src/test/resources/30/single/opf/invalid/item-properties.opf
@@ -15,6 +15,7 @@
<manifest>
<item id="text001" href="text001.xhtml" properties="nav scripted cover-image" media-type="application/xhtml+xml" />
<item id="text002" href="text002.xhtml" media-type="application/xhtml+xml" />
+ <item id="mo001" href="mo001.smil" properties="remote-resources" media-type="application/smil+xml" />
<item id="img002" href="image.jpg" media-type="image/jpg" />
<item id="ncx" href="ncx.ncx" media-type="application/x-dtbncx+xml" />
</manifest>
diff --git a/src/test/resources/30/single/opf/invalid/link-in-manifest.opf b/src/test/resources/30/single/opf/invalid/link-in-manifest.opf
new file mode 100644
index 0000000..196c2f9
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/link-in-manifest.opf
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid"
+ prefix="foo: http://example.org/foo#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <link rel="foo:bar" href="contents.xhtml#ch1"/>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="t001"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/invalid/manifest-duplicate-resource.opf b/src/test/resources/30/single/opf/invalid/manifest-duplicate-resource.opf
new file mode 100644
index 0000000..cb9d0e4
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/manifest-duplicate-resource.opf
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../../src/schema/package-30.rnc" type="compact"?>
+<?oxygen SCHSchema="../../../src/schema/package-30.sch"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="t002" href="contents.xhtml" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/meta-refines-cycle.opf b/src/test/resources/30/single/opf/invalid/meta-refines-cycle.opf
new file mode 100644
index 0000000..d64d3aa
--- /dev/null
+++ b/src/test/resources/30/single/opf/invalid/meta-refines-cycle.opf
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../../src/schema/package-30.rnc" type="compact"?>
+<?oxygen SCHSchema="../../../src/schema/package-30.sch"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="belongs-to-collection" id="c01" refines="#c02">col1</meta>
+ <meta property="belongs-to-collection" id="c02" refines="#c03">col2</meta>
+ <meta property="belongs-to-collection" id="c03" refines="#c01">col3</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/invalid/prefix-declaration.opf b/src/test/resources/30/single/opf/invalid/prefix-declaration.opf
index 23758a0..a305119 100644
--- a/src/test/resources/30/single/opf/invalid/prefix-declaration.opf
+++ b/src/test/resources/30/single/opf/invalid/prefix-declaration.opf
@@ -13,8 +13,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/prefixes-001.opf b/src/test/resources/30/single/opf/invalid/prefixes-001.opf
index 9b7b056..90d26b8 100644
--- a/src/test/resources/30/single/opf/invalid/prefixes-001.opf
+++ b/src/test/resources/30/single/opf/invalid/prefixes-001.opf
@@ -16,7 +16,7 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/prefixes-002.opf b/src/test/resources/30/single/opf/invalid/prefixes-002.opf
index f0aad5c..8de6185 100644
--- a/src/test/resources/30/single/opf/invalid/prefixes-002.opf
+++ b/src/test/resources/30/single/opf/invalid/prefixes-002.opf
@@ -15,8 +15,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid invalid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid invalid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/prefixes-003.opf b/src/test/resources/30/single/opf/invalid/prefixes-003.opf
index 201367d..8157a41 100644
--- a/src/test/resources/30/single/opf/invalid/prefixes-003.opf
+++ b/src/test/resources/30/single/opf/invalid/prefixes-003.opf
@@ -16,8 +16,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/prefixes-004.opf b/src/test/resources/30/single/opf/invalid/prefixes-004.opf
index cdaad75..01bff7f 100644
--- a/src/test/resources/30/single/opf/invalid/prefixes-004.opf
+++ b/src/test/resources/30/single/opf/invalid/prefixes-004.opf
@@ -15,8 +15,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/prefixes-redeclare.opf b/src/test/resources/30/single/opf/invalid/prefixes-redeclare.opf
index 84445ad..602c37b 100644
--- a/src/test/resources/30/single/opf/invalid/prefixes-redeclare.opf
+++ b/src/test/resources/30/single/opf/invalid/prefixes-redeclare.opf
@@ -17,8 +17,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/scheme-001.opf b/src/test/resources/30/single/opf/invalid/scheme-001.opf
index 1fb3bce..bc54794 100644
--- a/src/test/resources/30/single/opf/invalid/scheme-001.opf
+++ b/src/test/resources/30/single/opf/invalid/scheme-001.opf
@@ -16,8 +16,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/invalid/scheme-002.opf b/src/test/resources/30/single/opf/invalid/scheme-002.opf
index 40dea37..0013adb 100644
--- a/src/test/resources/30/single/opf/invalid/scheme-002.opf
+++ b/src/test/resources/30/single/opf/invalid/scheme-002.opf
@@ -16,8 +16,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/valid/collection-valid-do-001.opf b/src/test/resources/30/single/opf/valid/collection-do.opf
similarity index 100%
rename from src/test/resources/30/single/opf/valid/collection-valid-do-001.opf
rename to src/test/resources/30/single/opf/valid/collection-do.opf
diff --git a/src/test/resources/30/single/opf/valid/collection-foreign.opf b/src/test/resources/30/single/opf/valid/collection-foreign.opf
new file mode 100644
index 0000000..ddaa4d7
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/collection-foreign.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Previews</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2014-07-29</dc:date>
+ <meta property="dcterms:modified">2014-07-29T15:47:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="t1" href="EPUB/xhtml/lorem1.xhtml" properties="nav"
+ media-type="application/xhtml+xml"/>
+ <item id="t2" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ <item id="img" href="image1.jpg" media-type="image/jpeg"/>
+ </manifest>
+ <spine>
+ <itemref idref="t1"/>
+ </spine>
+ <collection role="http://example.org/">
+ <link href="http://example.org/resource"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/collection-preview.opf b/src/test/resources/30/single/opf/valid/collection-preview.opf
new file mode 100644
index 0000000..a7ab003
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/collection-preview.opf
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>Lorem Ipsum</dc:title>
+ <dc:language>la</dc:language>
+ <dc:date>2014-08-29</dc:date>
+ <meta property="dcterms:modified">2014-08-29T15:47:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
+ <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml"/>
+ <item id="c4" href="chapter4.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="stylesheet.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="c2"/>
+ <itemref idref="c3"/>
+ <itemref idref="c4"/>
+ </spine>
+ <collection role="preview">
+ <collection role="manifest">
+ <link href="chapter1.xhtml" media-type="application/xhtml+xml"/>
+ <link href="chapter2.xhtml" media-type="application/xhtml+xml"/>
+ <link href="stylesheet.css" media-type="text/css"/>
+ </collection>
+ <link href="chapter1.xhtml"/>
+ <link href="chapter2.xhtml"/>
+ <link href="chapter3.xhtml#preview"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/collection-valid-001.opf b/src/test/resources/30/single/opf/valid/collection-valid-001.opf
deleted file mode 100644
index 28b7347..0000000
--- a/src/test/resources/30/single/opf/valid/collection-valid-001.opf
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
- <dc:title>Lorem Ipsum</dc:title>
- <dc:language>la</dc:language>
- <dc:date>2014-08-29</dc:date>
- <meta property="dcterms:modified">2014-08-29T15:47:00Z</meta>
- </metadata>
- <manifest>
- <item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
- <item id="c1" href="chapter1.xhtml" media-type="application/xhtml+xml"/>
- <item id="c2" href="chapter2.xhtml" media-type="application/xhtml+xml"/>
- <item id="c3" href="chapter3.xhtml" media-type="application/xhtml+xml"/>
- <item id="c4" href="chapter4.xhtml" media-type="application/xhtml+xml"/>
- <item id="c5" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
- <item id="css" href="stylesheet.css" media-type="text/css"/>
- </manifest>
- <spine>
- <itemref idref="c1"/>
- <itemref idref="c2"/>
- <itemref idref="c3"/>
- <itemref idref="c4"/>
- <itemref idref="c5"/>
- </spine>
- <collection role="preview">
- <collection role="manifest">
- <link href="chapter1.xhtml" media-type="application/xhtml+xml"/>
- <link href="chapter2.xhtml" media-type="application/xhtml+xml"/>
- <link href="stylesheet.css" media-type="text/css"/>
- </collection>
- <link href="chapter1.xhtml"/>
- <link href="chapter2.xhtml"/>
- <link href="chapter3.xhtml#preview"/>
- </collection>
-</package>
diff --git a/src/test/resources/30/single/opf/valid/collection-valid-002.opf b/src/test/resources/30/single/opf/valid/collection-valid-002.opf
deleted file mode 100644
index 97dfff8..0000000
--- a/src/test/resources/30/single/opf/valid/collection-valid-002.opf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
- <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
- <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
- <dc:title>Previews</dc:title>
- <dc:language>la</dc:language>
- <dc:date>2014-07-29</dc:date>
- <meta property="dcterms:modified">2014-07-29T15:47:00Z</meta>
- </metadata>
- <manifest>
- <item id="t1" href="EPUB/xhtml/lorem1.xhtml" properties="nav"
- media-type="application/xhtml+xml"/>
- <item id="t2" href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
- <item id="css" href="stylesheet.css" media-type="text/css"/>
- <item id="img" href="image1.jpg" media-type="image/jpeg"/>
- </manifest>
- <spine>
- <itemref idref="t1"/>
- </spine>
- <collection role="preview">
- <collection role="manifest">
- <link href="EPUB/xhtml/lorem1.xhtml" media-type="application/xhtml+xml"/>
- <link href="EPUB/xhtml/lorem2.xhtml" media-type="application/xhtml+xml"/>
- <link href="stylesheet.css" media-type="text/css"/>
- <link href="image1.jpg" media-type="image/jpeg"/>
- </collection>
- <link href="EPUB/xhtml/lorem1.xhtml"/>
- <link href="EPUB/xhtml/lorem2.xhtml#preview"/>
- </collection>
-</package>
diff --git a/src/test/resources/30/single/opf/valid/dict-multiple-dedicatedlang.opf b/src/test/resources/30/single/opf/valid/dict-multiple-dedicatedlang.opf
new file mode 100644
index 0000000..34ed329
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/dict-multiple-dedicatedlang.opf
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <dc:language>fr</dc:language>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">fr</meta>
+ </metadata>
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <metadata>
+ <meta property="source-language">fr</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/dict-multiple.opf b/src/test/resources/30/single/opf/valid/dict-multiple.opf
new file mode 100644
index 0000000..d348a2d
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/dict-multiple.opf
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict1" href="dict1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="dict2" href="dict2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm1" href="search1.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ <item id="skm2" href="search2.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict1"/>
+ <itemref idref="dict2"/>
+ </spine>
+ <collection role="dictionary">
+ <link href="search1.xml"/>
+ <link href="dict1.xhtml"/>
+ </collection>
+ <collection role="dictionary">
+ <link href="search2.xml"/>
+ <link href="dict2.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/dict-single-typed.opf b/src/test/resources/30/single/opf/valid/dict-single-typed.opf
new file mode 100644
index 0000000..8cdc8fc
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/dict-single-typed.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ <meta property="dictionary-type">monolingual</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/dict-single.opf b/src/test/resources/30/single/opf/valid/dict-single.opf
new file mode 100644
index 0000000..bb89e9d
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/dict-single.opf
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>DICT</dc:title>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ <dc:type>dictionary</dc:type>
+ <dc:language>en</dc:language>
+ <meta property="source-language">en</meta>
+ <meta property="target-language">en</meta>
+ </metadata>
+ <manifest>
+ <item id="css" href="style.css" media-type="text/css"/>
+ <item id="nav" href="nav.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="dict" href="dict.xhtml" media-type="application/xhtml+xml"/>
+ <item id="skm" href="search.xml" properties="dictionary search-key-map"
+ media-type="application/vnd.epub.search-key-map+xml"/>
+ </manifest>
+ <spine>
+ <itemref idref="dict"/>
+ </spine>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/edupub-minimal.opf b/src/test/resources/30/single/opf/valid/edupub-minimal.opf
new file mode 100644
index 0000000..3ddb819
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/edupub-minimal.opf
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/valid/edupub-teacher-edition.opf b/src/test/resources/30/single/opf/valid/edupub-teacher-edition.opf
new file mode 100644
index 0000000..384cdd0
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/edupub-teacher-edition.opf
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.rnc" type="application/relax-ng-compact-syntax"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/package-30.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/edupub/edu-opf.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata>
+ <dc:type>edupub</dc:type>
+ <dc:type>teacher-edition</dc:type>
+ <dc:identifier id="uid">urn:uuid:550e8412-e29b-41d4-a716-446655441234</dc:identifier>
+ <dc:title>Textbook</dc:title>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ <dc:source>foo.student.edition</dc:source>
+ <meta property="schema:accessibilityFeature">tableOfContents</meta>
+ </metadata>
+ <manifest>
+ <item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ </manifest>
+ <spine>
+ <itemref idref="t001" />
+ </spine>
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/valid/id-spaces.opf b/src/test/resources/30/single/opf/valid/id-spaces.opf
new file mode 100644
index 0000000..cb540d5
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/id-spaces.opf
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?oxygen RNGSchema="../../../src/schema/package-30.rnc" type="compact"?>
+<?oxygen SCHSchema="../../../src/schema/package-30.sch"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0"
+ unique-identifier="uid" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <!-- dupe arbitrary IDs -->
+ <metadata>
+ <dc:title>Norwegian Wood</dc:title>
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-446655440000</dc:identifier>
+ <dc:language>en</dc:language>
+ <meta property="dcterms:modified">2011-08-19T12:00:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id=" text001" href="text001.xhtml" properties="nav" media-type="application/xhtml+xml" />
+ <item id="text002 " href="text002.xhtml" media-type="application/xhtml+xml" />
+ <item id=" img001 " href="image.png" media-type="image/png" />
+ <item id="ncx" href="ncx.ncx" media-type="application/x-dtbncx+xml" />
+ </manifest>
+ <spine toc="ncx">
+ <itemref idref="text001 " />
+ <itemref idref=" text002" />
+ </spine>
+ <guide>
+ <reference href="text001.xhtml" type="cover" title="Cover"/>
+ </guide>
+
+
+
+</package>
\ No newline at end of file
diff --git a/src/test/resources/30/single/opf/valid/idx-collection-indexgroup.opf b/src/test/resources/30/single/opf/valid/idx-collection-indexgroup.opf
new file mode 100644
index 0000000..f5178f1
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/idx-collection-indexgroup.opf
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx-a01" href="subjectIndex-a01.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-a02" href="subjectIndex-a02.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-a03" href="subjectIndex-a03.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-b" href="subjectIndex-b.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c01" href="subjectIndex-c01.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c02" href="subjectIndex-c02.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-c03" href="subjectIndex-c03.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-d" href="subjectIndex-d.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx-e" href="subjectIndex-e.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ <itemref idref="idx-a01"/>
+ <itemref idref="idx-a02"/>
+ <itemref idref="idx-a03"/>
+ <itemref idref="idx-b"/>
+ <itemref idref="idx-c01"/>
+ <itemref idref="idx-c02"/>
+ <itemref idref="idx-c03"/>
+ <itemref idref="idx-d"/>
+ <itemref idref="idx-e"/>
+ </spine>
+ <collection role="index">
+ <collection role="index-group">
+ <link href="subjectIndex-a01.xhtml"/>
+ <link href="subjectIndex-a02.xhtml"/>
+ <link href="subjectIndex-a03.xhtml"/>
+ </collection>
+ <collection role="index-group">
+ <link href="subjectIndex-b.xhtml"/>
+ </collection>
+ <collection role="index-group">
+ <link href="subjectIndex-c01.xhtml"/>
+ <link href="subjectIndex-c02.xhtml"/>
+ <link href="subjectIndex-c03.xhtml"/>
+ </collection>
+ <link href="subjectIndex-d.xhtml"/>
+ <link href="subjectIndex-e.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/idx-collection.opf b/src/test/resources/30/single/opf/valid/idx-collection.opf
new file mode 100644
index 0000000..74f590d
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/idx-collection.opf
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier>
+ <dc:title>EpubCheck Test</dc:title>
+ <dc:language>en</dc:language>
+ <dc:date>2011-09-01</dc:date>
+ <meta property="dcterms:modified">2011-09-01T17:18:00Z</meta>
+ </metadata>
+ <manifest>
+ <item id="c1" href="content.xhtml" properties="nav" media-type="application/xhtml+xml"/>
+ <item id="idx1" href="index1.xhtml" media-type="application/xhtml+xml"/>
+ <item id="idx2" href="index2.xhtml" media-type="application/xhtml+xml"/>
+ <item id="css" href="style.css" media-type="text/css"/>
+ </manifest>
+ <spine>
+ <itemref idref="c1"/>
+ </spine>
+ <collection role="index">
+ <link href="index1.xhtml"/>
+ <link href="index2.xhtml"/>
+ </collection>
+
+</package>
diff --git a/src/test/resources/30/single/opf/valid/prefixes.opf b/src/test/resources/30/single/opf/valid/prefixes.opf
index 05b766c..07c11cd 100644
--- a/src/test/resources/30/single/opf/valid/prefixes.opf
+++ b/src/test/resources/30/single/opf/valid/prefixes.opf
@@ -15,9 +15,9 @@
</metadata>
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
- <item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="scripted mathml" id="c2" href="c1.xhtml" media-type="application/xhtml+xml" />
<item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c3.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/opf/valid/sc-embedded.opf b/src/test/resources/30/single/opf/valid/sc-embedded.opf
new file mode 100644
index 0000000..b63c624
--- /dev/null
+++ b/src/test/resources/30/single/opf/valid/sc-embedded.opf
@@ -0,0 +1,54 @@
+<?xml version="1.0"?>
+<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="pub-id" version="3.0">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
+
+ <!--General -->
+ <dc:identifier id="pub-id">urn:uuid:2FF31B77-955D-4624-BF5D-DBFC3CD5769D</dc:identifier>
+ <meta property="dcterms:modified">2015-05-26T00:12:53Z</meta>
+ <dc:type>scriptable-component</dc:type>
+ <dc:title>My Embedded Component</dc:title>
+ <dc:creator>John Doe</dc:creator>
+ <dc:description>Demo of the Logger Widget</dc:description>
+ <dc:publisher>ACME</dc:publisher>
+ <dc:date>2015-05-26</dc:date>
+ <dc:language>en</dc:language>
+ </metadata>
+
+ <manifest>
+ <item id="content" href="xhtml/content.xhtml" media-type="application/xhtml+xml"
+ properties="scripted"/>
+ <item id="nav" href="xhtml/nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
+ <item id="css" href="css/comp.css" media-type="text/css"/>
+ <item id="js" href="js/main.js" media-type="text/javascript"/>
+
+ <!-- Scriped Component items -->
+ <item id="comp_6E693C5D58E5" href="components/acme/comp/EPUB/xhtml/comp.xhtml"
+ media-type="application/xhtml+xml" properties="scripted"/>
+ <item id="css_6E693C5D58E5" href="components/acme/comp/EPUB/css/comp.css"
+ media-type="text/css"/>
+ <item id="js_6E693C5D58E5" href="components/acme/comp/EPUB/js/comp.js"
+ media-type="text/javascript"/>
+ </manifest>
+
+ <spine>
+ <itemref idref="content"/>
+ </spine>
+
+ <collection role="scriptable-component">
+ <metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <dc:type>scriptable-component</dc:type>
+ <dc:title>comp</dc:title>
+ <dc:creator>acme</dc:creator>
+ <dc:language>en</dc:language>
+ <meta property="epubsc:version">1.0.1</meta>
+ </metadata>
+
+ <collection role="manifest">
+ <link href="components/acme/comp/xhtml/comp.xhtml"/>
+ <link href="components/acme/comp/css/comp.css"/>
+ <link href="components/acme/comp/js/comp.js"/>
+ </collection>
+
+ <link href="components/acme/comp/xhtml/comp.xhtml"/>
+ </collection>
+</package>
diff --git a/src/test/resources/30/single/opf/valid/scheme-001.opf b/src/test/resources/30/single/opf/valid/scheme-001.opf
index 806d154..9948f78 100644
--- a/src/test/resources/30/single/opf/valid/scheme-001.opf
+++ b/src/test/resources/30/single/opf/valid/scheme-001.opf
@@ -16,8 +16,8 @@
<manifest>
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" />
<item properties="scripted mathml" id="c2" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:valid" id="c3" href="c2.xhtml" media-type="application/xhtml+xml" />
- <item properties="foaf:invalid" id="c5" href="c2.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:valid" id="c3" href="c3.xhtml" media-type="application/xhtml+xml" />
+ <item properties="foaf:invalid" id="c5" href="c5.xhtml" media-type="application/xhtml+xml" />
<item id="css" href="lorem.css" media-type="text/css" />
</manifest>
<spine>
diff --git a/src/test/resources/30/single/xhtml/invalid/duplicate-id.xhtml b/src/test/resources/30/single/xhtml/invalid/duplicate-id.xhtml
new file mode 100644
index 0000000..8c189f7
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/duplicate-id.xhtml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>duplicate ID</title>
+ </head>
+ <body>
+ <p id="p1">p1</p>
+ <p id="p1">p2</p>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-heading-imgnoalt.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-heading-imgnoalt.xhtml
new file mode 100644
index 0000000..d70aa39
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-heading-imgnoalt.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <section>
+ <h1>
+ <img alt="" src="./img.png" />
+ </h1>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-arialabel-heading.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-arialabel-heading.xhtml
new file mode 100644
index 0000000..4363d3a
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-arialabel-heading.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body aria-label="Body">
+ <h1>Body</h1>
+ <!-- all subsequent headings should be h3 and lower -->
+ <nav epub:type="toc">
+ <h2>Table of Contents</h2>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </nav>
+ <section aria-label="Subsection">
+ <h2>Subsection</h2>
+ <p>Content.</p>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-explicit-body.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-explicit-body.xhtml
new file mode 100644
index 0000000..085cfdf
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-explicit-body.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <h2>Explicit body section</h2>
+ <!-- all subsequent headings should be h3 and lower -->
+ <nav epub:type="toc">
+ <h2>Table of Contents</h2>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </nav>
+ <section aria-label="test">
+ <section aria-label="implied grouping">
+ <aside>
+ <header>
+ <h4>Prelim</h4>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ <section>
+ <h3>Sub-sub-subsection</h3>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </section>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body-aria-heading.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body-aria-heading.xhtml
new file mode 100644
index 0000000..c8b857e
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body-aria-heading.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body aria-label="implied heading">
+ <!-- non-section element means topmost should be h1 -->
+ <p>Lorem Ipsum Dolor...</p>
+ <section>
+ <h3>Sub-sub-subsection</h3>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body.xhtml
new file mode 100644
index 0000000..aa480d3
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-implicit-body.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <!-- non-section element means topmost should be h1 -->
+ <p>Lorem Ipsum Dolor...</p>
+ <section>
+ <h3>Sub-sub-subsection</h3>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-subtitle.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-subtitle.xhtml
new file mode 100644
index 0000000..d5846c8
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning-subtitle.xhtml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<?xml-model href="../../../../../../../../../git-local/epubcheck/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <section aria-label="assd">
+ <h1>Sub-sub-subsection</h1>
+ <p epub:type="subtitle">Need a header!</p>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/edupub-sectioning.xhtml b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning.xhtml
new file mode 100644
index 0000000..085cfdf
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/edupub-sectioning.xhtml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <h2>Explicit body section</h2>
+ <!-- all subsequent headings should be h3 and lower -->
+ <nav epub:type="toc">
+ <h2>Table of Contents</h2>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </nav>
+ <section aria-label="test">
+ <section aria-label="implied grouping">
+ <aside>
+ <header>
+ <h4>Prelim</h4>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ <section>
+ <h3>Sub-sub-subsection</h3>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </section>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/invalid/http-equiv-1.xhtml b/src/test/resources/30/single/xhtml/invalid/http-equiv-1.xhtml
index 10aaed3..808e129 100644
--- a/src/test/resources/30/single/xhtml/invalid/http-equiv-1.xhtml
+++ b/src/test/resources/30/single/xhtml/invalid/http-equiv-1.xhtml
@@ -1,7 +1,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<!-- Encoding declaration state not allowed in xhtml docs -->
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta http-equiv="Content-Type" content="text/html; charset=latin1" />
<title>TOC</title>
</head>
<body>
diff --git a/src/test/resources/30/single/xhtml/invalid/http-equiv-2.xhtml b/src/test/resources/30/single/xhtml/invalid/http-equiv-2.xhtml
new file mode 100644
index 0000000..df7a92b
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/http-equiv-2.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <!-- Encoding declaration state not allowed in xhtml docs -->
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <meta charset="utf-8" />
+ <title>TOC</title>
+ </head>
+ <body>
+ <nav epub:type="toc" id="toc">
+ <ol>
+ <li>
+ <a href="navigation.xhtml#toc">TOC</a>
+ </li>
+ </ol>
+ </nav>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/invalid/index-noindex.xhtml b/src/test/resources/30/single/xhtml/invalid/index-noindex.xhtml
new file mode 100644
index 0000000..acf0a09
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/index-noindex.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <h2>Simplest index</h2>
+ <p>No Index</p>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/invalid/index-notonbody.xhtml b/src/test/resources/30/single/xhtml/invalid/index-notonbody.xhtml
new file mode 100644
index 0000000..4d192b2
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/index-notonbody.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?xml-model href="../../../../../../main/resources/com/adobe/epubcheck/schema/30/idx/idx-xhtml-index.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body>
+ <div>
+ <span> </span>
+ </div>
+ <div>
+ <section epub:type="index">
+ <h2>Simplest index</h2>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 1</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch1">1</a></li>
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </section>
+ </div>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/invalid/issue288-invalid-uri.xhtml b/src/test/resources/30/single/xhtml/invalid/issue288-invalid-uri.xhtml
new file mode 100644
index 0000000..b3bc05e
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/invalid/issue288-invalid-uri.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Title</title>
+ </head>
+
+ <body>
+ <h2>Title</h2>
+ <a href=" http://idpf.org">Valid URI</a>
+ <a href="http:// idpf.org">Invalid URI</a>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/valid/edupub-heading-img.xhtml b/src/test/resources/30/single/xhtml/valid/edupub-heading-img.xhtml
new file mode 100644
index 0000000..aa621d2
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/edupub-heading-img.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <h1>
+ <img alt="some text" src="./img.png" />
+ </h1>
+ <section>
+ <h2>
+ <img alt="some text" src="./img.png" />
+ </h2>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-body.xhtml b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-body.xhtml
new file mode 100644
index 0000000..c4cee38
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-body.xhtml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <h1>test</h1>
+ <nav epub:type="toc">
+ <h2>Table of Contents</h2>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </nav>
+ <aside>
+ <h2>Aside</h2>
+ <p>Lorem Ispum Dolor...</p>
+ <section>
+ <h3>Aside Subsect</h3>
+ <p>Lorem Ispum Dolor...</p>
+ <aside>
+ <h4>Aside in aside</h4>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ </section>
+ <section aria-label="untitled subsection">
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </aside>
+ <section>
+ <header>
+ <h2>Subsection</h2>
+ </header>
+ <section aria-label="implied grouping">
+ <aside>
+ <header>
+ <h4>Prelim</h4>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ <section>
+ <h4>Sub-sub-subsection</h4>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </section>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-sections.xhtml b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-sections.xhtml
new file mode 100644
index 0000000..5edc963
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-explicit-sections.xhtml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <section epub:type="subchapter">
+ <h1>Table of Contents</h1>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </section>
+ <section epub:type="subchapter">
+ <header>
+ <h1>Subsection</h1>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/edupub-sectioning-implicit-body.xhtml b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-implicit-body.xhtml
new file mode 100644
index 0000000..d55fb4a
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-implicit-body.xhtml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <nav epub:type="toc">
+ <h2>Table of Contents</h2>
+ <ol>
+ <li>Subsection 1</li>
+ </ol>
+ </nav>
+ <aside>
+ <h2>Aside</h2>
+ <p>Lorem Ispum Dolor...</p>
+ <section>
+ <h3>Aside Subsect</h3>
+ <p>Lorem Ispum Dolor...</p>
+ <aside>
+ <h4>Aside in aside</h4>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ </section>
+ <section aria-label="untitled subsection">
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </aside>
+ <section>
+ <header>
+ <h2>Subsection</h2>
+ </header>
+ <section aria-label="implied grouping">
+ <aside>
+ <header>
+ <h4>Prelim</h4>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ </aside>
+ <section>
+ <h4>Sub-sub-subsection</h4>
+ <p>Lorem Ispum Dolor...</p>
+ </section>
+ </section>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/edupub-sectioning-subtitle.xhtml b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-subtitle.xhtml
new file mode 100644
index 0000000..1627662
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/edupub-sectioning-subtitle.xhtml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<?xml-model href="../../../../../../../../../git-local/epubcheck/src/main/resources/com/adobe/epubcheck/schema/30/edupub/edu-structure.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops">
+ <head>
+ <title>EDUPUB headings test</title>
+ </head>
+ <body>
+ <section>
+ <header>
+ <h1>Sub-sub-subsection</h1>
+ <p epub:type="subtitle">Need a header!</p>
+ </header>
+ <p>Lorem Ispum Dolor...</p>
+ <figure>
+ <p>some figure</p>
+ <figcaption>
+ <p epub:type="title">Figure title</p>
+ <p epub:type="subtitle">Figure subtitle</p>
+ <p>blah blah blah</p>
+ </figcaption>
+ </figure>
+ </section>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/http-equiv-1.xhtml b/src/test/resources/30/single/xhtml/valid/http-equiv-1.xhtml
index 935910e..231f165 100644
--- a/src/test/resources/30/single/xhtml/valid/http-equiv-1.xhtml
+++ b/src/test/resources/30/single/xhtml/valid/http-equiv-1.xhtml
@@ -2,6 +2,7 @@
<head>
<meta http-equiv="Default-Style" content="foo" />
<meta http-equiv="Refresh" content="300" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>TOC</title>
</head>
<body>
diff --git a/src/test/resources/30/single/xhtml/valid/index.xhtml b/src/test/resources/30/single/xhtml/valid/index.xhtml
new file mode 100644
index 0000000..3b4470c
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/index.xhtml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Simplest Index</title>
+ </head>
+
+ <body epub:type="index">
+ <h2>Simplest index</h2>
+ <ul epub:type="index-entry-list">
+ <li><span epub:type="index-term">term 1</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch1">1</a></li>
+ <li><span epub:type="index-term">term 2</span>, <a epub:type="index-locator"
+ href="content.xhtml#ch2">2</a></li>
+ </ul>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/valid/issue282-object-typemustmatch.xhtml b/src/test/resources/30/single/xhtml/valid/issue282-object-typemustmatch.xhtml
new file mode 100644
index 0000000..c22ca2d
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/issue282-object-typemustmatch.xhtml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Object typemustmatch attribute</title>
+ </head>
+ <body>
+ <object data="http://example.org/video.mp4" type="video/mp4" typemustmatch=""/>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/issue296-irc-uri.xhtml b/src/test/resources/30/single/xhtml/valid/issue296-irc-uri.xhtml
new file mode 100644
index 0000000..bb4ed71
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/issue296-irc-uri.xhtml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops"
+ xml:lang="en-US" lang="en-US">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Title</title>
+ </head>
+
+ <body>
+ <h2>Title</h2>
+ <a href="irc://irc.freenode.net">Text</a>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/valid/issue340.xhtml b/src/test/resources/30/single/xhtml/valid/issue340.xhtml
new file mode 100644
index 0000000..744da2f
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/issue340.xhtml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>HTML5 main</title>
+ </head>
+ <body>
+ <main> hello </main>
+ </body>
+</html>
diff --git a/src/test/resources/30/single/xhtml/valid/issue341.xhtml b/src/test/resources/30/single/xhtml/valid/issue341.xhtml
new file mode 100644
index 0000000..94530ad
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/issue341.xhtml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>HTML5 date type</title>
+ </head>
+ <body>
+ <time datetime="2014-03">March 2014</time>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/issue355.xhtml b/src/test/resources/30/single/xhtml/valid/issue355.xhtml
new file mode 100644
index 0000000..2be1ca1
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/issue355.xhtml
@@ -0,0 +1,8 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>HTML5 ID</title>
+ </head>
+ <body>
+ <div id=",!@"></div>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/30/single/xhtml/valid/mathml.xhtml b/src/test/resources/30/single/xhtml/valid/mathml.xhtml
new file mode 100644
index 0000000..60d64fc
--- /dev/null
+++ b/src/test/resources/30/single/xhtml/valid/mathml.xhtml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Math ML</title>
+ </head>
+ <body>
+ <p><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" alttext="dummy">
+ <mml:mrow>
+ <mml:msup>
+ <mml:mi>a</mml:mi>
+ <mml:mn>2</mml:mn>
+ </mml:msup>
+ <mml:mo>=</mml:mo>
+ <mml:msup>
+ <mml:mi>b</mml:mi>
+ <mml:mn>2</mml:mn>
+ </mml:msup>
+ <mml:mo>+</mml:mo>
+ <mml:msup id="foo">
+ <mml:mi>c</mml:mi>
+ <mml:mn>2</mml:mn>
+ </mml:msup>
+ <mml:mspace indenttarget="foo" indentalign="id"></mml:mspace>
+ </mml:mrow>
+ </mml:math>
+ </p>
+ </body>
+</html>
\ No newline at end of file
diff --git a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/AreYouReadyV3.xml b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/AreYouReadyV3.xml
index ea435cf..71133c7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/AreYouReadyV3.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/AreYouReadyV3.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<!DOCTYPE dtbook PUBLIC "-//NISO//DTD dtbook 2005-3//EN" "http://www.daisy.org/z3986/2005/dtbook-2005-3.dtd">
+<!DOCTYPE dtbook PUBLIC "-//NISO//DTD dtbook 2005-3//EN" "http://www.daisy.org/z3986/2005/dtbook-2005-2.dtd">
<?xml-stylesheet href="dtbookbasic.css" type="text/css"?>
<dtbook xmlns="http://www.daisy.org/z3986/2005/dtbook/" version="2005-2" xml:lang="en-IN">
<head>
diff --git a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/toc.ncx
index 9a8eb11..cbd7942 100644
--- a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.json
index fed79ca..0966f61 100644
--- a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/DTBook/Basic.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/DTBook/Basic.epub",
"filename" : "Basic.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:21",
- "elapsedTime" : 1431,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:34",
+ "elapsedTime" : 1188,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 1,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 334,
- "uncompressedSize" : 724,
+ "compressedSize" : 337,
+ "uncompressedSize" : 742,
"compressionMethod" : "Deflated",
- "checkSum" : "b7bd5d8e269562df5f13cc40b5f3679c5e1489731d6fcc9fc38d1f30dbcb",
+ "checkSum" : "80a3ec58dd6b7d3780c781384d741ed86696cd027ec2bdc80f9e31f7899",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -126,7 +126,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/page01.xhtml", "OPS/AreYouReadyV3.xml" ]
+ "referencedItems" : [ "OPS/AreYouReadyV3.xml", "OPS/page01.xhtml" ]
}, {
"id" : "opf-36",
"fileName" : "OPS/image1.jpg",
@@ -376,7 +376,7 @@
"compressedSize" : 23421,
"uncompressedSize" : 89409,
"compressionMethod" : "Deflated",
- "checkSum" : "d8f1175d81204f68f9a12eeeeaa65eeff0ae6434d3e5c91fdd602938f296bd5",
+ "checkSum" : "4a76e8882143e89e4c4bd421210a0f4a06761f7d957fded14347613b7a2caab",
"isSpineItem" : true,
"spineIndex" : 1,
"isLinear" : true,
@@ -390,7 +390,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/image11.jpg", "OPS/image12.jpg", "OPS/image3.jpg", "OPS/image1.jpg", "OPS/image13.jpg", "OPS/image2.jpg", "OPS/image5.jpg", "OPS/image4.jpg", "OPS/image14.jpg" ]
+ "referencedItems" : [ "OPS/image1.jpg", "OPS/image11.jpg", "OPS/image12.jpg", "OPS/image13.jpg", "OPS/image14.jpg", "OPS/image2.jpg", "OPS/image3.jpg", "OPS/image4.jpg", "OPS/image5.jpg" ]
} ],
"messages" : [ {
"ID" : "HTM-010",
@@ -398,7 +398,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -410,7 +410,7 @@
"message" : "Use of non-registered URI scheme type in href: 'waka://barnesandnoble.com'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/AreYouReadyV3.xml",
+ "path" : "OPS/AreYouReadyV3.xml",
"line" : 25,
"column" : 69,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.xml
index 6217f15..bfea498 100644
--- a/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/DTBook/Basic_expected_results.xml
@@ -4,7 +4,7 @@
<repInfo uri="Basic.epub">
<created>2014-09-05T01:49:14Z</created>
<format>application/epub+zip</format>
- <version>2.0</version>
+ <version>2.0.1</version>
<status>Well-formed</status>
<messages>
<message>OPF-021, WARN, [Use of non-registered URI scheme type in href: 'waka://barnesandnoble.com'.], OPS/AreYouReadyV3.xml (25-69)</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/failonwarnings_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/command_line/failonwarnings_expected_results.json
index b103c76..dd30cd4 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/failonwarnings_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/failonwarnings_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/command_line/failonwarnings.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/command_line/failonwarnings.epub",
"filename" : "failonwarnings.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:32:18",
- "elapsedTime" : 3687,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:20",
+ "elapsedTime" : 62,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 1,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "failonwarnings.epub",
+ "path" : "failonwarnings.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,22 +278,22 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 119,
"context" : "-webkit-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 11,
"column" : 115,
"context" : "-ms-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 116,
"context" : "-moz-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 114,
"context" : "-o-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
@@ -305,7 +305,7 @@
"message" : "CSS position:fixed property should not be used in EPUBs.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 9,
"column" : 5,
"context" : "position : fixed ;"
@@ -317,27 +317,27 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 23,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 8,
"column" : 23,
"context" : "-webkit-transform : rotatex(90deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 5,
"column" : 28,
"context" : ".rotateY {\n background-color:yellow;\n -webkit-transform:rotateY(180deg);\n }\n\n .rotateX {\n background-color:yellow;\n -webkit-transform:rotateX(180deg);\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 31,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 31,
"context" : "-webkit-transform : rotatex(180deg) ;"
@@ -349,7 +349,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -358,19 +358,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/jsonfile_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/command_line/jsonfile_expected_results.json
index 0c63ee1..bcfb738 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/jsonfile_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/jsonfile_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/command_line/jsonfile.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/command_line/jsonfile.epub",
"filename" : "jsonfile.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:27:51",
- "elapsedTime" : 130,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:20",
+ "elapsedTime" : 58,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "jsonfile.epub",
+ "path" : "jsonfile.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,22 +278,22 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 119,
"context" : "-webkit-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 11,
"column" : 115,
"context" : "-ms-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 116,
"context" : "-moz-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 114,
"context" : "-o-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
@@ -305,27 +305,27 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 23,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 8,
"column" : 23,
"context" : "-webkit-transform : rotatex(90deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 5,
"column" : 28,
"context" : ".rotateY {\n background-color:yellow;\n -webkit-transform:rotateY(180deg);\n }\n\n .rotateX {\n background-color:yellow;\n -webkit-transform:rotateX(180deg);\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 31,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 31,
"context" : "-webkit-transform : rotatex(180deg) ;"
@@ -337,7 +337,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -346,19 +346,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt
index f62671b..88a62eb 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/listSeverities_expected_results.txt
@@ -12,10 +12,10 @@ ACC-010 SUPPRESSED Headings should not be used within blockquote and figure elem
ACC-011 WARNING Link elements within SVG should include an xlink:title attribute.
ACC-012 SUPPRESSED Table elements should include a caption element.
ACC-013 USAGE Content file contains at least one inline style declaration. Inline styles are not compatible with accessibility settings and display personalization. Use CSS Styles instead.
-ACC-014 USAGE CSS Selector font-size attribute value does not use a relative size. Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-ACC-015 USAGE CSS Selector font line-height attribute value does not use a relative size. Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
-ACC-016 USAGE CSS Selector font-size attribute value should use a relative size. Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-ACC-017 USAGE CSS Selector font line-height attribute value does not use a relative size. Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
+ACC-014 USAGE Value of CSS property 'font-size' does not use a relative size. Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
+ACC-015 USAGE Value of CSS property 'line-height' does not use a relative size. Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
+ACC-016 USAGE Value of CSS property 'font-size' should use a relative size. Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
+ACC-017 USAGE Value of CSS property 'line-height' does not use a relative size. Acceptable values include percentages, numeric multiples, em multiples, 'normal', or 'inherit'.
CHK-001 ERROR The custom message overrides file was not found.
CHK-002 ERROR Unrecognized custom message id %1$s encountered in message overrides file '%2$s'.
CHK-003 ERROR Unrecognized custom message severity '%1$s' encountered in message overrides file '%2$s'.
@@ -23,7 +23,7 @@ CHK-004 ERROR The custom message contains too many parameters in message overrid
CHK-005 ERROR The custom suggestion contains too many parameters in message overrides file '%1$s'.
CHK-006 ERROR Unable to parse the custom format parameter in message overrides file '%1$s'.
CHK-007 ERROR Error encountered while processing custom message file '%1$s': "%2$s".
-CSS-001 ERROR The '%1$s' property must not be included in an ePub Style Sheet.
+CSS-001 ERROR The '%1$s' property must not be included in an EPUB Style Sheet.
CSS-002 ERROR Empty or NULL reference found.
CSS-003 ERROR Only UTF-8 and UTF-16 encodings are allowed, detected %1$s.
CSS-004 ERROR Only UTF-8 and UTF-16 encodings are allowed, detected %1$s BOM.
@@ -35,22 +35,22 @@ CSS-009 USAGE Use of certain CSS such as Columns, Transforms, Transitions, box-s
CSS-010 WARNING Use of non-standard stylesheet.
CSS-011 SUPPRESSED Excessive number of css files. Consider merging CSS files to reduce the number of CSS files.
CSS-012 USAGE Document links to multiple CSS files.
-CSS-013 USAGE CSS Selector attribute is declared !Important.
+CSS-013 USAGE CSS property is declared !Important.
CSS-015 ERROR Alternate Stylesheet has no title.
CSS-016 SUPPRESSED Alternate Stylesheet precedes primary stylesheet.
-CSS-017 WARNING CSS Selector specifies absolute position.
+CSS-017 WARNING CSS selector specifies absolute position.
CSS-019 WARNING CSS font-face declaration has no attributes.
CSS-020 USAGE CSS font selector declaration uses unexpected font-size value '%1$s'. Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'.
-CSS-021 USAGE CSS Selector font shorthand specifies an invalid System Font. Acceptable values include 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', or 'inherit'.
-CSS-022 USAGE CSS Selector specifies global margin setting.
-CSS-023 USAGE CSS Selector specifies media query.
+CSS-021 USAGE Shorthand CSS property 'font-family' specifies an invalid System Font. Acceptable values include 'caption', 'icon', 'menu', 'message-box', 'small-caption', 'status-bar', or 'inherit'.
+CSS-022 USAGE CSS selector specifies global margin setting.
+CSS-023 USAGE CSS selector specifies media query.
CSS-024 USAGE CSS class Selector is not used. Remove unused CSS selectors.
-CSS-025 USAGE CSS class Selector is not found. Check for typos or define a class selector to document the use of the class.
-CSS-027 USAGE CSS Selector specifies absolute position.
+CSS-025 USAGE CSS class Selector could not be found. Check for typos or define a class selector to document the use of the class.
+CSS-027 USAGE CSS selector specifies absolute position.
CSS-028 USAGE Use of Font-face declaration.
HTM-001 ERROR Any publication resource that is an XML-based media type must be a valid XML 1.0 document. XML version found: %1$s.
HTM-002 WARNING The installed xml parser doesn't support xml version verification. Xml files must be a valid XML 1.0 document.
-HTM-003 ERROR External entities are not allowed in ePub v3 documents. External entity declaration found: %1$s.
+HTM-003 ERROR External entities are not allowed in EPUB v3 documents. External entity declaration found: %1$s.
HTM-004 ERROR Irregular DOCTYPE: found '%1$s', expected '%2$s'.
HTM-005 USAGE An external reference was found.
HTM-006 USAGE An XHTML Named Entity was found.
@@ -63,8 +63,8 @@ HTM-012 USAGE Found a link to a CFI in an external book.
HTM-013 USAGE Intra-Publication CFIs found in document.
HTM-014 WARNING Invalid file extension for HTML file, expecting (html, htm or xhtml).
HTM-014a WARNING XHTML Content Document file name '%1$s' should have the extension '.xhtml'.
-HTM-015 WARNING HTML4 DOCTYPE definition within ePub v3.
-HTM-016 WARNING HTML5 DOCTYPE definition within ePub v2.
+HTM-015 WARNING HTML4 DOCTYPE definition within EPUB v3.
+HTM-016 WARNING HTML5 DOCTYPE definition within EPUB v2.
HTM-017 ERROR Content file has different language value in attributes xml:lang and lang.
HTM-018 ERROR Content file has invalid language value at attribute xml:lang.
HTM-019 ERROR Content file has invalid language definition at attribute lang.
@@ -94,16 +94,15 @@ MED-003 ERROR Non-standard image resource of type %1$s found.
MED-004 ERROR Image file header may be corrupted.
MED-005 ERROR Media Overlay audio reference %1$s to non-standard audio type %2$s found.
MED_006 USAGE Some browsers do not support rendering SVG images which use a filename in the xlink:href property.
-NAV-001 ERROR The nav file is not supported for ePub v2.
+NAV-001 ERROR The nav file is not supported for EPUB v2.
NAV-002 USAGE Found epub:type="page-list" in nav document
-NAV-003 SUPPRESSED Found both epub:type="page-list" in nav document and epub:type="pagebreak" in content document(s) Using multiple paging constructs can cause unpredictable paging behavior in some epub readers.
+NAV-003 ERROR The Navigation Document must have a page list when content document(s) contain page breaks (epub:type="pagebreak").
NCX-002 ERROR toc attribute was not found on the spine element.
-NCX-003 USAGE An .NCX file is required for TOC navigation on ePub v2 readers.
+NCX-003 USAGE An .NCX file is required for TOC navigation on EPUB v2 readers.
NCX-005 USAGE Found ncx "page-list" in .ncx file
-NCX-006 USAGE Found both "page-list" construct in ncx document and Adobe page-map attribute on the spine. Using multiple paging constructs can cause unpredictable paging behavior in some readers.
-OPF-001 ERROR There was an error when parsing the ePub version: %1$s.
-OPF-002 FATAL The OPF file '%1$s' was not found in the ePub.
-OPF-003 WARNING Item '%1$s' exists in the ePub, but is not declared in the OPF manifest.
+OPF-001 ERROR There was an error when parsing the EPUB version: %1$s.
+OPF-002 FATAL The OPF file '%1$s' was not found in the EPUB.
+OPF-003 WARNING Item '%1$s' exists in the EPUB, but is not declared in the OPF manifest.
OPF-004 WARNING Invalid prefix declaration: leading or trailing whitespace is not allowed.
OPF-004a ERROR Invalid prefix declaration: found empty prefix.
OPF-004b ERROR Invalid prefix '%1$s': must be a valid non-colonized name (aka 'NCName').
@@ -115,7 +114,7 @@ OPF-005 ERROR Invalid prefix declaration: URI for prefix '%1$s' doesn't exist.
OPF-006 ERROR Invalid prefix declaration: URI '%1$s' is not a valid URI.
OPF-007 WARNING Re-declaration of reserved prefix '%1$s'.
OPF-007a ERROR Invalid prefix mapping: prefix '_' must not be declared.
-OPF-007b ERROR Invalid prefix mapping: default vocabulary '%1$s' must not be re-declared.
+OPF-007b WARNING Invalid prefix mapping: default vocabulary '%1$s' must not be re-declared.
OPF-008 ERROR Handler binding for core Media-type '%1$s' is not allowed.
OPF-009 ERROR The media-type %1$s has already been assigned handler '%2$s'.
OPF-010 ERROR Error resolving reference: '%1$s'.
@@ -130,8 +129,6 @@ OPF-018 WARNING The 'remote-resources' property was declared in the OPF, but no
OPF-019 FATAL Spine tag was not found in the OPF file.
OPF-020 SUPPRESSED Excessive number of spine items.
OPF-021 WARNING Use of non-registered URI scheme type in href: '%1$s'.
-OPF-022 ERROR Invalid path: '%1$s'.
-OPF-024 ERROR Found unknown ePub version %1$s.
OPF-025 ERROR Property '%1$s' can take only one value.
OPF-026 ERROR Found malformed property value: '%1$s'.
OPF-027 ERROR Undefined property: '%1$s'.
@@ -166,38 +163,40 @@ OPF-055 WARNING %1$s tag is empty.
OPF-056 WARNING Media type '%1$s' is not an appropriate audio mimetype. Use 'audio/mp3', 'audio/mp4' or 'audio/ogg' instead.
OPF-057 SUPPRESSED Image file length exceeds recommended size.
OPF-058 USAGE Spine item has no TOC entry reference. Every spine item in the manifest should be referenced by at least one TOC entry.
-OPF-059 USAGE Spine item has no NAV entry reference. Every spine item in the manifest should be referenced by at least one NAV entry.
+OPF-059 USAGE Spine item has no NCX entry reference. Every spine item in the manifest should be referenced by at least one NCX entry.
OPF-060 ERROR Duplicate entry in the ZIP file: '%1$f'.
OPF-061 WARNING Duplicate entry in the ZIP file (after Unicode NFC normalization) '%1$f'.
OPF-062 USAGE Found Adobe page-map attribute on spine element in opf file.
OPF-063 WARNING Referenced Adobe page-map item '%1$s' was not found in the manifest.
-PKG-001 WARNING Validating the ePub against version %1$s but detected version %2$s.
-PKG-003 ERROR Unable to read ePub file header. This is likely a corrupted ePub file.
-PKG-004 FATAL Corrupted ePub ZIP header.
-PKG-005 ERROR The mimetype file has an extension of length %1$s. No filename extensions are permitted for the mimetype file.
+OPF-064 INFO OPF declares type '%1$s', validating using profile '%2$s'.
+PKG-001 WARNING Validating the EPUB against version %1$s but detected version %2$s.
+PKG-003 ERROR Unable to read EPUB file header. This is likely a corrupted EPUB file.
+PKG-004 FATAL Corrupted EPUB ZIP header.
+PKG-005 ERROR The mimetype file has an extra field of length %1$s. The use of the extra field feature of the ZIP format is not permitted for the mimetype file.
PKG-006 ERROR Mimetype file entry is missing or is not the first file in the archive.
-PKG-007 ERROR Mimetype file should only contain the string 'application/epub+zip'.
+PKG-007 ERROR Mimetype file should only contain the string 'application/epub+zip' and should not be compressed.
PKG-008 FATAL Unable to read file '%1$s'.
PKG-009 ERROR File name contains characters that are not allowed in OCF file names: '%1$s'.
PKG-010 WARNING Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.
PKG-011 ERROR Filename is not allowed to end with '.'.
PKG-012 WARNING File name contains the following non-ascii characters: %1$s. Consider changing the filename.
-PKG-013 ERROR The ePub file includes multiple OPS renditions.
-PKG-014 WARNING The ePub contains empty directory '%1$s'.
-PKG-015 FATAL Unable to read ePub contents: %1$s
-PKG-016 WARNING Use only lowercase characters for the ePub file extension for maximum compatibility. For maximum compatibility, use '.epub'.
-PKG-017 WARNING Uncommon ePub file extension. For maximum compatibility, use '.epub'.
-PKG-018 FATAL The ePub file is not found.
-PKG-020 ERROR OPF file '%1$s' is not found.
+PKG-013 ERROR The EPUB file includes multiple OPS renditions.
+PKG-014 WARNING The EPUB contains empty directory '%1$s'.
+PKG-015 FATAL Unable to read EPUB contents: %1$s
+PKG-016 WARNING Use only lowercase characters for the EPUB file extension for maximum compatibility. For maximum compatibility, use '.epub'.
+PKG-017 WARNING Uncommon EPUB file extension. For maximum compatibility, use '.epub'.
+PKG-018 FATAL The EPUB file could not be found.
+PKG-020 ERROR OPF file '%1$s' could not be found.
PKG-021 ERROR Corrupted image file encountered.
-PKG-022 WARNING Wrong file extension for image. The image is a '%1$s' file but has the file extension '%2$s'.
-RSC-001 ERROR File '%1$s' is not found.
-RSC-002 FATAL Required META-INF/container.xml resource is not found.
+PKG-022 WARNING Wrong file extension for image. The image is a '%1$s' file but has the file extension '%2$s'.
+PKG-023 USAGE Validating the EPUB against version 2.0, default validation profile will be used.
+RSC-001 ERROR File '%1$s' could not be found.
+RSC-002 FATAL Required META-INF/container.xml resource could not be found.
RSC-003 ERROR No rootfile tag with media type 'application/oebps-package+xml' was found in the container.
RSC-004 ERROR File '%1$s' could not be decrypted.
RSC-005 ERROR Error while parsing file '%1$s'.
RSC-006 ERROR Remote resource reference not allowed; resource must be placed in the OCF. Only audio and video remote resources are permitted.
-RSC-007 ERROR Referenced resource is not found in the ePub.
+RSC-007 ERROR Referenced resource could not be found in the EPUB.
RSC-008 ERROR Referenced resource is not declared in the OPF manifest.
RSC-009 ERROR A fragment identifier should not be used with an img src attribute.
RSC-010 ERROR Reference to non-standard resource type found.
@@ -208,11 +207,11 @@ RSC-014 ERROR Fragment identifier defines an incompatible resource type.
RSC-015 ERROR A fragment identifier is required for svg use tag references.
RSC-016 FATAL Fatal Error while parsing file '%1$s'.
RSC-017 WARNING Warning while parsing file '%1$s'.
-RSC-018 WARNING Altimg file '%1$s' is not found.
-SCP-001 USAGE Use of Javascript eval() function in ePub scripts is a security risk.
-SCP-002 USAGE Use of XMLHttpRequest in ePub scripts is a security risk.
+RSC-018 WARNING Altimg file '%1$s' could not be found.
+SCP-001 USAGE Use of Javascript eval() function in EPUB scripts is a security risk.
+SCP-002 USAGE Use of XMLHttpRequest in EPUB scripts is a security risk.
SCP-003 USAGE Local and Session Storage is not currently supported.
-SCP-004 ERROR Content file contains script which is not supported in ePub v2.
+SCP-004 ERROR Content file contains script which is not supported in EPUB v2.
SCP-005 ERROR Content file contains script but it is not marked as scripted.
SCP-006 USAGE Inline scripts found.
SCP-007 USAGE Script references 'innerHtml'. Use a DOM instead.
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/passonwarnings_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/command_line/passonwarnings_expected_results.json
index 1c424e5..976a767 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/passonwarnings_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/passonwarnings_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/command_line/passonwarnings.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/command_line/passonwarnings.epub",
"filename" : "passonwarnings.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:54",
- "elapsedTime" : 134,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:20",
+ "elapsedTime" : 68,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "passonwarnings.epub",
+ "path" : "passonwarnings.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,22 +278,22 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 119,
"context" : "-webkit-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 11,
"column" : 115,
"context" : "-ms-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 116,
"context" : "-moz-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 114,
"context" : "-o-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
@@ -305,27 +305,27 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 23,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 8,
"column" : 23,
"context" : "-webkit-transform : rotatex(90deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 5,
"column" : 28,
"context" : ".rotateY {\n background-color:yellow;\n -webkit-transform:rotateY(180deg);\n }\n\n .rotateX {\n background-color:yellow;\n -webkit-transform:rotateX(180deg);\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 31,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 31,
"context" : "-webkit-transform : rotatex(180deg) ;"
@@ -337,7 +337,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -346,19 +346,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_error_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_error_expected_results.txt
index e5291ed..e52c551 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_error_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_error_expected_results.txt
@@ -1,10 +1,9 @@
Start command_line test('severity_error')
-Validating against EPUB version 3.0 - custom validation
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_fatal_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_fatal_expected_results.txt
index bb5c43d..99a6773 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_fatal_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_fatal_expected_results.txt
@@ -1,5 +1,4 @@
Start command_line test('severity_fatal')
-Validating against EPUB version 3.0 - custom validation
No errors or warnings detected.
epubcheck completed
Completed command_line test('severity_fatal')
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadId_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadId_expected_results.txt
index 0772a50..f5daa96 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadId_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadId_expected_results.txt
@@ -1,45 +1,56 @@
Start command_line test('severity_overrideBadId')
ERROR(CHK-002): ./com/adobe/epubcheck/test/command_line/severity/(1,0): Unrecognized custom message id BogusID encountered in message overrides file './com/adobe/epubcheck/test/command_line/severity_overrideBadId.txt'.
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): Document links to multiple CSS files.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): Document links to multiple CSS files.
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): CSS Selector font shorthand specifies an invalid System Font.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): Shorthand CSS property 'font-family' specifies an invalid System Font.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -64,18 +75,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadMessage_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadMessage_expected_results.txt
index 300c3b8..6acca8a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadMessage_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadMessage_expected_results.txt
@@ -1,46 +1,57 @@
Start command_line test('severity_overrideBadMessage')
ERROR(CHK-004): ./com/adobe/epubcheck/test/command_line/severity/(1,0): The custom message contains too many parameters in message overrides file './com/adobe/epubcheck/test/command_line/severity_overrideBadMessage.txt'.
ERROR(CHK-005): ./com/adobe/epubcheck/test/command_line/severity/(2,0): The custom suggestion contains too many parameters in message overrides file './com/adobe/epubcheck/test/command_line/severity_overrideBadMessage.txt'.
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): Document links to multiple CSS files.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): Document links to multiple CSS files.
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): This is an overridden message.
-USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): CSS Selector font shorthand specifies an invalid System Font.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
+USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): Shorthand CSS property 'font-family' specifies an invalid System Font.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): This is an overridden message.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): This is an overridden message.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -65,18 +76,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadSeverity_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadSeverity_expected_results.txt
index ffbdb81..49801b6 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadSeverity_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideBadSeverity_expected_results.txt
@@ -1,45 +1,56 @@
Start command_line test('severity_overrideBadSeverity')
ERROR(CHK-003): ./com/adobe/epubcheck/test/command_line/severity/(1,8): Unrecognized custom message severity 'BogusSeverity' encountered in message overrides file './com/adobe/epubcheck/test/command_line/severity_overrideBadSeverity.txt'.
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): Document links to multiple CSS files.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): Document links to multiple CSS files.
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): CSS Selector font shorthand specifies an invalid System Font.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): Shorthand CSS property 'font-family' specifies an invalid System Font.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -64,18 +75,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideMissingFile_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideMissingFile_expected_results.txt
index 6d0100d..7e77939 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideMissingFile_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideMissingFile_expected_results.txt
@@ -1,45 +1,56 @@
Start command_line test('severity_overrideMissingFile')
ERROR(CHK-001): ./com/adobe/epubcheck/test/command_line/severity/./com/adobe/epubcheck/test/command_line/severity_overrideMissingFile.txt(-1,-1): The custom message overrides file was not found.
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): Document links to multiple CSS files.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): Document links to multiple CSS files.
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): CSS Selector font shorthand specifies an invalid System Font.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): Shorthand CSS property 'font-family' specifies an invalid System Font.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -64,18 +75,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideOk_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideOk_expected_results.txt
index 8b02b29..f0a2d50 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideOk_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_overrideOk_expected_results.txt
@@ -1,43 +1,54 @@
Start command_line test('severity_overrideOk')
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
ERROR(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): (severity overridden from USAGE) This is an overridden message
ERROR(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): (severity overridden from USAGE) This is an overridden message
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -62,18 +73,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_usage_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_usage_expected_results.txt
index f25a87a..ec934a8 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_usage_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_usage_expected_results.txt
@@ -1,44 +1,55 @@
Start command_line test('severity_usage')
-Validating against EPUB version 3.0 - custom validation
+Validating using EPUB version 3.0.1 rules.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
+USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
+WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
USAGE(HTM-010): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(2,68): Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
-USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NAV entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
+USAGE(OPF-059): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/toc.ncx(-1,-1): Spine item has no NCX entry reference.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(6,62): Document links to multiple CSS files.
USAGE(CSS-012): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(7,66): Document links to multiple CSS files.
USAGE(ACC-008): ./com/adobe/epubcheck/test/command_line/severity.epub/severity.epub(-1,-1): Navigation Document has no 'landmarks nav' element.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): CSS Selector font shorthand specifies an invalid System Font.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): CSS Selector font-size attribute value does not use a relative size.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): CSS Selector font line-height attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS Selector attribute is declared !Important.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS Selector specifies media query.
-USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): CSS Selector font-size attribute value does not use a relative size.
-USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS Selector attribute is declared !Important.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS Selector specifies media query.
-USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector is not found.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(2,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(7,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-021): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(11,5): Shorthand CSS property 'font-family' specifies an invalid System Font.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(15,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(19,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(27,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(35,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(39,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(79,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(90,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(97,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(99,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(8,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(14,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(23,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(32,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(38,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(51,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(58,5): Value of CSS property 'font-size' does not use a relative size.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(ACC-015): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(10,5): Value of CSS property 'line-height' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(15,5): CSS property is declared !Important.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(27,5): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(33,1): CSS selector specifies media query.
+USAGE(ACC-014): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(35,9): Value of CSS property 'font-size' does not use a relative size.
+USAGE(CSS-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(9,13): CSS property is declared !Important.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
+USAGE(CSS-023): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(20,9): CSS selector specifies media query.
+USAGE(CSS-025): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(54,24): CSS class Selector could not be found.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(14,9): CSS class Selector is not used.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(10,54): Content file contains at least one inline style declaration.
USAGE(ACC-013): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(11,97): Content file contains at least one inline style declaration.
@@ -63,18 +74,6 @@ USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(98,5): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(62,1): CSS class Selector is not used.
USAGE(CSS-024): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/unused.css(66,3): CSS class Selector is not used.
-Validating using EPUB version 3.0 rules.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/external_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-USAGE(ACC-007): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(-1,-1): Content Documents do not use 'epub:type' attributes for semantic inflection.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
-WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_warning_expected_results.txt b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_warning_expected_results.txt
index 3cafc7d..9979863 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/severity_warning_expected_results.txt
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/severity_warning_expected_results.txt
@@ -1,16 +1,15 @@
Start command_line test('severity_warning')
-Validating against EPUB version 3.0 - custom validation
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS Selector specifies absolute position.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS Selector specifies absolute position.
-WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS Selector specifies absolute position.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(27,13): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(38,13): CSS position:fixed property should not be used in EPUBs.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an ePub Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,1): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(14,22): The 'direction' property must not be included in an EPUB Style Sheet.
WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/inline_css.xhtml(15,1): CSS position:fixed property should not be used in EPUBs.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an ePub Style Sheet.
-ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an ePub Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(55,5): The 'unicode-bidi' property must not be included in an EPUB Style Sheet.
+ERROR(CSS-001): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(56,5): The 'direction' property must not be included in an EPUB Style Sheet.
WARNING(CSS-006): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(66,5): CSS position:fixed property should not be used in EPUBs.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style.css(70,5): CSS selector specifies absolute position.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/cssStyles.css(2,5): CSS selector specifies absolute position.
+WARNING(CSS-017): ./com/adobe/epubcheck/test/command_line/severity.epub/OPS/style_tag_css.xhtml(17,13): CSS selector specifies absolute position.
Check finished with errors
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xml
index 9fb58c5..577250d 100644
--- a/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xml
@@ -5,12 +5,12 @@
<created>2014-09-05T03:24:40Z</created>
<lastModified>2012-10-10T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Well-formed</status>
<messages>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS/toc.ncx (2-68)</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS/toc.ncx</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS/toc.ncx</message>
<message>ACC-008, HINT, [Navigation Document has no 'landmarks nav' element.], xmlfile.epub</message>
<message>CSS-009, HINT, [Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.], OPS/style.css (3-23)</message>
<message>CSS-009, HINT, [Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.], OPS/style.css (8-23)</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xmp b/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xmp
new file mode 100644
index 0000000..80ffb67
--- /dev/null
+++ b/src/test/resources/com/adobe/epubcheck/test/command_line/xmlfile_expected_results.xmp
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:stFnt="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:extended-properties="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/" xmlns:premis="http://www.loc.gov/premis/rdf/v1#" dc:format="application/epub+zip;version=3.0.1" xmp:CreateDate="2015-03-30T16:14:34Z" extended-properties:Characters="648 [...]
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">Transform Sample Book</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ <premis:hasEvent rdf:parseType="Resource">
+ <premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-03-30T23:58:11+02:00</premis:hasEventDateTime>
+ <premis:hasEventType rdf:resource="http://id.loc.gov/vocabulary/preservation/eventType/val" />
+ <premis:hasEventDetail>Well-formed</premis:hasEventDetail>
+ <premis:hasEventOutcomeInformation>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-007, HINT, Content Documents do not use 'epub:type' attributes for semantic inflection.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>HTM-010, HINT, Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx (2-68)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>OPF-059, HINT, Spine item has no NCX entry reference.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-008, HINT, Navigation Document has no 'landmarks nav' element.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="xmlfile.epub" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-009, HINT, Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style.css (3-23)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style.css (8-23)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (8-31)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (13-31)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (5-28)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-013, HINT, Content file contains at least one inline style declaration.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml (10-119)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml (11-115)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml (14-116)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml (15-114)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ </rdf:Seq>
+ </premis:hasEventOutcomeInformation>
+ <premis:hasEventRelatedAgent rdf:parseType="Resource">
+ <premis:hasAgentType rdf:resource="http://id.loc.gov/vocabulary/preservation/agentType/sof" />
+ <premis:hasAgentName>epubcheck 4.0.0-alpha12-SNAPSHOT</premis:hasAgentName>
+ </premis:hasEventRelatedAgent>
+ </premis:hasEvent>
+ <premis:hasSignificantProperties>
+ <rdf:Bag>
+ <rdf:li premis:hasSignificantPropertiesType="renditionLayout" premis:hasSignificantPropertiesValue="reflowable" />
+ <rdf:li premis:hasSignificantPropertiesType="isScripted" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasEncryption" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAudio" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasVideo" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasSignatures" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAllFontsEmbedded" premis:hasSignificantPropertiesValue="true" />
+ </rdf:Bag>
+ </premis:hasSignificantProperties>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/alternate_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/alternate_expected_results.json
index a147d79..bdb8b86 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/alternate_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/alternate_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/alternate.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/alternate.epub",
"filename" : "alternate.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:17",
- "elapsedTime" : 384,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 57,
"nFatal" : 0,
"nError" : 1,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -148,7 +148,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/styles/chocolate.css", "OPS/styles/style.css", "OPS/styles/midnight.css" ]
+ "referencedItems" : [ "OPS/styles/chocolate.css", "OPS/styles/midnight.css", "OPS/styles/style.css" ]
}, {
"id" : "page02",
"fileName" : "OPS/page02.xhtml",
@@ -266,12 +266,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -283,7 +283,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "alternate.epub",
+ "path" : "alternate.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -295,7 +295,7 @@
"message" : "Alternate Stylesheet has no title.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : 6,
"column" : 67,
"context" : "styles/chocolate.css"
@@ -307,42 +307,42 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 217,
"column" : 1,
"context" : ".warning"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 234,
"column" : 17,
"context" : ".note"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 290,
"column" : 2,
"context" : ".offsite"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 330,
"column" : 59,
"context" : ".initial"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 489,
"column" : 1,
"context" : ".subhead"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 498,
"column" : 1,
"context" : ".stb"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 508,
"column" : 1,
"context" : ".mtb"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 518,
"column" : 1,
"context" : ".ltb"
@@ -354,7 +354,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -366,7 +366,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
@@ -375,14 +375,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/columns_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/columns_expected_results.json
index c71a731..509ba34 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/columns_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/columns_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/columns.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/columns.epub",
"filename" : "columns.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:14",
- "elapsedTime" : 345,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 44,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "columns.epub",
+ "path" : "columns.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,7 +278,7 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 103,
"context" : "-webkit-column-count:3;-webkit-column-gap:normal;-webkit-column-rule:1px outset #ff00ff;"
@@ -290,47 +290,47 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 103,
"context" : "-webkit-column-count:3;-webkit-column-gap:normal;-webkit-column-rule:1px outset #ff00ff;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 2,
"column" : 5,
"context" : "-moz-column-count : 3 ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 5,
"context" : "-webkit-column-count : 3 ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 4,
"column" : 5,
"context" : "column-count : 3 ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 5,
"column" : 5,
"context" : "-webkit-column-gap : 50px ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 6,
"column" : 12,
"context" : ".newspaper {\n -moz-column-count: 3; /* Firefox */\n -webkit-column-count: 3; /* Safari and Chrome */\n column-count: 3;\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 13,
"context" : "-moz-column-count : 3 ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 9,
"column" : 13,
"context" : "-webkit-column-count : 3 ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 10,
"column" : 13,
"context" : "column-count : 3 ;"
@@ -339,10 +339,10 @@
}, {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 12,
"column" : 24,
"context" : ".newspaper"
@@ -354,7 +354,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -366,7 +366,7 @@
"message" : "Ensure b, i, em, and strong elements are used in compliance with W3C HTML5 directives.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 16,
"column" : 7,
"context" : "b"
@@ -375,19 +375,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.json
index 1f13bbe..0872824 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/discouraged.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/discouraged.epub",
"filename" : "discouraged.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:16",
- "elapsedTime" : 270,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 46,
"nFatal" : 0,
"nError" : 2,
"nWarning" : 2,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -148,7 +148,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/style.css", "OPS/cssStyles.css" ]
+ "referencedItems" : [ "OPS/cssStyles.css", "OPS/style.css" ]
}, {
"id" : "page02",
"fileName" : "OPS/style_tag_css.xhtml",
@@ -280,7 +280,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -288,17 +288,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -310,7 +310,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "discouraged.epub",
+ "path" : "discouraged.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -322,22 +322,22 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 54,
"context" : "position: absolute;top: 80px;left: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 11,
"column" : 97,
"context" : "color: #006400 !important; background-color: #fafad2 !important; font-size: 18pt"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 50,
"context" : "unicode-bidi: embed; direction: rtl"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 41,
"context" : "position:fixed; left: 5px;"
@@ -346,100 +346,100 @@
}, {
"ID" : "ACC-014",
"severity" : "USAGE",
- "message" : "CSS Selector font-size attribute value does not use a relative size.",
+ "message" : "Value of CSS property 'font-size' does not use a relative size.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 10,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
}, {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 27,
"column" : 5,
"context" : "font-size : large ;"
}, {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 35,
"column" : 9,
"context" : "font-size : large ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 2,
"column" : 5,
"context" : "font-size : 14px ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 7,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 15,
"column" : 5,
"context" : "font : 18px joke ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 19,
"column" : 5,
"context" : "font : 18px ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 27,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 35,
"column" : 5,
"context" : "font : x-large / 110% 'New Century Schoolbook' , serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 39,
"column" : 5,
"context" : "font : bold italic large Palatino , serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 90,
"column" : 5,
"context" : "font-size : large ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 99,
"column" : 9,
"context" : "font-size : large ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 8,
"column" : 5,
"context" : "font-size : 12px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 14,
"column" : 5,
"context" : "font-size : 22px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 23,
"column" : 5,
"context" : "font-size : 14px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 32,
"column" : 5,
"context" : "font-size : 12px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 38,
"column" : 5,
"context" : "font-size : 12px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 51,
"column" : 5,
"context" : "font-size : 11px ;"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 58,
"column" : 5,
"context" : "font-size : 10px ;"
@@ -448,20 +448,20 @@
}, {
"ID" : "ACC-015",
"severity" : "USAGE",
- "message" : "CSS Selector font line-height attribute value does not use a relative size.",
+ "message" : "Value of CSS property 'line-height' does not use a relative size.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 10,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 7,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 27,
"column" : 5,
"context" : "font : 600 12px / 14px sans-serif ;"
@@ -470,15 +470,15 @@
}, {
"ID" : "CSS-001",
"severity" : "ERROR",
- "message" : "The 'direction' property must not be included in an ePub Style Sheet.",
+ "message" : "The 'direction' property must not be included in an EPUB Style Sheet.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 22,
"context" : "direction : rtl ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 56,
"column" : 5,
"context" : "direction : rtl ;"
@@ -487,20 +487,20 @@
}, {
"ID" : "CSS-001",
"severity" : "ERROR",
- "message" : "The 'unicode-bidi' property must not be included in an ePub Style Sheet.",
+ "message" : "The 'unicode-bidi' property must not be included in an EPUB Style Sheet.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 1,
"context" : "unicode-bidi : embed ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 55,
"column" : 5,
"context" : "unicode-bidi : embed ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 27,
"column" : 13,
"context" : "unicode-bidi : normal ;"
@@ -512,17 +512,17 @@
"message" : "CSS position:fixed property should not be used in EPUBs.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 1,
"context" : "position : fixed ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 66,
"column" : 5,
"context" : "position : fixed ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 38,
"column" : 13,
"context" : "position : fixed ;"
@@ -534,12 +534,12 @@
"message" : "Document links to multiple CSS files.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 6,
"column" : 62,
"context" : "style.css"
}, {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 7,
"column" : 66,
"context" : "cssStyles.css"
@@ -548,20 +548,20 @@
}, {
"ID" : "CSS-013",
"severity" : "USAGE",
- "message" : "CSS Selector attribute is declared !Important.",
+ "message" : "CSS property is declared !Important.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 15,
"column" : 5,
"context" : "color : #006400 !important ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 79,
"column" : 5,
"context" : "color : #006400 !important ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 9,
"column" : 13,
"context" : "color : #006400 !important ;"
@@ -570,20 +570,20 @@
}, {
"ID" : "CSS-017",
"severity" : "WARNING",
- "message" : "CSS Selector specifies absolute position.",
+ "message" : "CSS selector specifies absolute position.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 2,
"column" : 5,
"context" : "position : absolute ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 70,
"column" : 5,
"context" : "position : absolute ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 17,
"column" : 13,
"context" : "position : absolute ;"
@@ -592,10 +592,10 @@
}, {
"ID" : "CSS-021",
"severity" : "USAGE",
- "message" : "CSS Selector font shorthand specifies an invalid System Font.",
+ "message" : "Shorthand CSS property 'font-family' specifies an invalid System Font.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 11,
"column" : 5,
"context" : "font : joke ;"
@@ -604,20 +604,20 @@
}, {
"ID" : "CSS-023",
"severity" : "USAGE",
- "message" : "CSS Selector specifies media query.",
+ "message" : "CSS selector specifies media query.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/cssStyles.css",
+ "path" : "OPS/cssStyles.css",
"line" : 33,
"column" : 1,
"context" : "@media screen and (orientation : landscape)"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 97,
"column" : 1,
"context" : "@media screen and (orientation : landscape)"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 20,
"column" : 9,
"context" : "@media screen and (orientation : landscape)"
@@ -629,102 +629,102 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 6,
"column" : 1,
"context" : ".p"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 10,
"column" : 1,
"context" : ".x"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 14,
"column" : 1,
"context" : ".w"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 18,
"column" : 1,
"context" : ".y"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 22,
"column" : 1,
"context" : ".v"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 30,
"column" : 1,
"context" : ".q"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 34,
"column" : 1,
"context" : ".r"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 38,
"column" : 1,
"context" : ".s"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 42,
"column" : 1,
"context" : ".t"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 46,
"column" : 1,
"context" : ".u"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 82,
"column" : 1,
"context" : ".unused"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 98,
"column" : 5,
"context" : ".foo"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 14,
"column" : 9,
"context" : ".unused"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 1,
"column" : 1,
"context" : ".otherstyle"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 30,
"column" : 1,
"context" : ".TableText"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 36,
"column" : 1,
"context" : ".sideBarLink"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 49,
"column" : 1,
"context" : ".bodyText"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 56,
"column" : 1,
"context" : ".copyright"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 62,
"column" : 1,
"context" : ".unusedStyle"
}, {
- "fileName" : "OPS/unused.css",
+ "path" : "OPS/unused.css",
"line" : 66,
"column" : 3,
"context" : ".unusedStyle2"
@@ -733,10 +733,10 @@
}, {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 54,
"column" : 24,
"context" : ".undefined"
@@ -748,7 +748,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -757,19 +757,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.xml
index a1e662f..3c7b20a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/css/discouraged_expected_results.xml
@@ -5,56 +5,56 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2012-10-10T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Not well-formed</status>
<messages>
- <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an ePub Style Sheet.], OPS/style_tag_css.xhtml (27-13)</message>
- <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an ePub Style Sheet.], OPS/inline_css.xhtml (14-1)</message>
- <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an ePub Style Sheet.], OPS/style.css (55-5)</message>
- <message>CSS-001, ERROR, [The 'direction' property must not be included in an ePub Style Sheet.], OPS/inline_css.xhtml (14-22)</message>
- <message>CSS-001, ERROR, [The 'direction' property must not be included in an ePub Style Sheet.], OPS/style.css (56-5)</message>
- <message>CSS-017, WARN, [CSS Selector specifies absolute position.], OPS/style.css (70-5)</message>
- <message>CSS-017, WARN, [CSS Selector specifies absolute position.], OPS/cssStyles.css (2-5)</message>
- <message>CSS-017, WARN, [CSS Selector specifies absolute position.], OPS/style_tag_css.xhtml (17-13)</message>
+ <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an EPUB Style Sheet.], OPS/style_tag_css.xhtml (27-13)</message>
+ <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an EPUB Style Sheet.], OPS/inline_css.xhtml (14-1)</message>
+ <message>CSS-001, ERROR, [The 'unicode-bidi' property must not be included in an EPUB Style Sheet.], OPS/style.css (55-5)</message>
+ <message>CSS-001, ERROR, [The 'direction' property must not be included in an EPUB Style Sheet.], OPS/inline_css.xhtml (14-22)</message>
+ <message>CSS-001, ERROR, [The 'direction' property must not be included in an EPUB Style Sheet.], OPS/style.css (56-5)</message>
+ <message>CSS-017, WARN, [CSS selector specifies absolute position.], OPS/style.css (70-5)</message>
+ <message>CSS-017, WARN, [CSS selector specifies absolute position.], OPS/cssStyles.css (2-5)</message>
+ <message>CSS-017, WARN, [CSS selector specifies absolute position.], OPS/style_tag_css.xhtml (17-13)</message>
<message>CSS-006, WARN, [CSS position:fixed property should not be used in EPUBs.], OPS/style_tag_css.xhtml (38-13)</message>
<message>CSS-006, WARN, [CSS position:fixed property should not be used in EPUBs.], OPS/inline_css.xhtml (15-1)</message>
<message>CSS-006, WARN, [CSS position:fixed property should not be used in EPUBs.], OPS/style.css (66-5)</message>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS/toc.ncx (2-68)</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS/toc.ncx</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS/toc.ncx</message>
<message>CSS-012, HINT, [Document links to multiple CSS files.], OPS/external_css.xhtml (6-62)</message>
<message>CSS-012, HINT, [Document links to multiple CSS files.], OPS/external_css.xhtml (7-66)</message>
<message>ACC-008, HINT, [Navigation Document has no 'landmarks nav' element.], discouraged.epub</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (2-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (7-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (15-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (19-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (27-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (35-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (39-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (90-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/style.css (99-9)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (8-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (14-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (23-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (32-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (38-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (51-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/unused.css (58-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/cssStyles.css (10-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/cssStyles.css (27-5)</message>
- <message>ACC-014, HINT, [CSS Selector font-size attribute value does not use a relative size.], OPS/cssStyles.css (35-9)</message>
- <message>ACC-015, HINT, [CSS Selector font line-height attribute value does not use a relative size.], OPS/style.css (7-5)</message>
- <message>ACC-015, HINT, [CSS Selector font line-height attribute value does not use a relative size.], OPS/style.css (27-5)</message>
- <message>ACC-015, HINT, [CSS Selector font line-height attribute value does not use a relative size.], OPS/cssStyles.css (10-5)</message>
- <message>CSS-021, HINT, [CSS Selector font shorthand specifies an invalid System Font.], OPS/style.css (11-5)</message>
- <message>CSS-013, HINT, [CSS Selector attribute is declared !Important.], OPS/style.css (79-5)</message>
- <message>CSS-013, HINT, [CSS Selector attribute is declared !Important.], OPS/cssStyles.css (15-5)</message>
- <message>CSS-013, HINT, [CSS Selector attribute is declared !Important.], OPS/style_tag_css.xhtml (9-13)</message>
- <message>CSS-023, HINT, [CSS Selector specifies media query.], OPS/style.css (97-1)</message>
- <message>CSS-023, HINT, [CSS Selector specifies media query.], OPS/cssStyles.css (33-1)</message>
- <message>CSS-023, HINT, [CSS Selector specifies media query.], OPS/style_tag_css.xhtml (20-9)</message>
- <message>CSS-025, HINT, [CSS class Selector is not found.], OPS/style_tag_css.xhtml (54-24)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (2-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (7-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (15-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (19-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (27-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (35-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (39-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (90-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/style.css (99-9)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (8-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (14-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (23-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (32-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (38-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (51-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/unused.css (58-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/cssStyles.css (10-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/cssStyles.css (27-5)</message>
+ <message>ACC-014, HINT, [Value of CSS property 'font-size' does not use a relative size.], OPS/cssStyles.css (35-9)</message>
+ <message>ACC-015, HINT, [Value of CSS property 'line-height' does not use a relative size.], OPS/style.css (7-5)</message>
+ <message>ACC-015, HINT, [Value of CSS property 'line-height' does not use a relative size.], OPS/style.css (27-5)</message>
+ <message>ACC-015, HINT, [Value of CSS property 'line-height' does not use a relative size.], OPS/cssStyles.css (10-5)</message>
+ <message>CSS-021, HINT, [Shorthand CSS property 'font-family' specifies an invalid System Font.], OPS/style.css (11-5)</message>
+ <message>CSS-013, HINT, [CSS property is declared !Important.], OPS/style.css (79-5)</message>
+ <message>CSS-013, HINT, [CSS property is declared !Important.], OPS/cssStyles.css (15-5)</message>
+ <message>CSS-013, HINT, [CSS property is declared !Important.], OPS/style_tag_css.xhtml (9-13)</message>
+ <message>CSS-023, HINT, [CSS selector specifies media query.], OPS/style.css (97-1)</message>
+ <message>CSS-023, HINT, [CSS selector specifies media query.], OPS/cssStyles.css (33-1)</message>
+ <message>CSS-023, HINT, [CSS selector specifies media query.], OPS/style_tag_css.xhtml (20-9)</message>
+ <message>CSS-025, HINT, [CSS class Selector could not be found.], OPS/style_tag_css.xhtml (54-24)</message>
<message>CSS-024, HINT, [CSS class Selector is not used.], OPS/style_tag_css.xhtml (14-9)</message>
<message>CSS-024, HINT, [CSS class Selector is not used.], OPS/unused.css (1-1)</message>
<message>CSS-024, HINT, [CSS class Selector is not used.], OPS/style.css (22-1)</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/excessive_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/excessive_epub3_expected_results.json
index dcdaf95..8915afe 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/excessive_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/excessive_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -420,7 +420,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -432,7 +432,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "excessive_epub3.epub",
+ "path" : "excessive_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -444,7 +444,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json
index d949892..817502e 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/font-face.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/font-face.epub",
"filename" : "font-face.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:15",
- "elapsedTime" : 306,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 54,
"nFatal" : 0,
"nError" : 4,
"nWarning" : 2,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -214,7 +214,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "http://fonts.googleapis.com/css?family=Chela+One", "OPS/styles/style.css" ]
+ "referencedItems" : [ "OPS/styles/style.css", "http://fonts.googleapis.com/css?family=Chela+One" ]
}, {
"id" : "page02",
"fileName" : "OPS/style_tag_css.xhtml",
@@ -280,7 +280,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/fonts/badaboom.woff", "OPS/fonts/Fummel.otf", "OPS/styles/fonts/bloody.woff", "OPS/fonts/bloody.woff", "http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf", "OPS/fonts/brankovic.ttf" ]
+ "referencedItems" : [ "OPS/fonts/Fummel.otf", "OPS/fonts/badaboom.woff", "OPS/fonts/bloody.woff", "OPS/fonts/brankovic.ttf", "OPS/styles/fonts/bloody.woff", "http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf" ]
}, {
"id" : "toc",
"fileName" : "OPS/toc.xhtml",
@@ -302,7 +302,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -310,17 +310,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -332,7 +332,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "font-face.epub",
+ "path" : "font-face.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -344,7 +344,7 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 60,
"column" : 65,
"context" : "font-family: 'Chela One', cursive;"
@@ -353,30 +353,30 @@
}, {
"ID" : "ACC-014",
"severity" : "USAGE",
- "message" : "CSS Selector font-size attribute value does not use a relative size.",
+ "message" : "Value of CSS property 'font-size' does not use a relative size.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 59,
"column" : 5,
"context" : "font-size : xx-large ;"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 65,
"column" : 5,
"context" : "font-size : xx-large ;"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 71,
"column" : 5,
"context" : "font-size : xx-large ;"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 77,
"column" : 5,
"context" : "font-size : xx-large ;"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 83,
"column" : 5,
"context" : "font-size : xx-large ;"
@@ -388,7 +388,7 @@
"message" : "Empty or NULL reference found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 18,
"column" : 5,
"context" : "url('')"
@@ -400,7 +400,7 @@
"message" : "Font-face reference OPS/fonts/brankovic.ttf refers to non-standard font type application/x-font-truetype.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 3,
"column" : 5,
"context" : "src : url('../fonts/brankovic.ttf') ;"
@@ -412,7 +412,7 @@
"message" : "An error occurred while parsing the CSS: Token '}' not allowed here, expecting a property value.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 50,
"column" : 1,
"context" : null
@@ -424,12 +424,12 @@
"message" : "Document links to multiple CSS files.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 6,
"column" : 69,
"context" : "styles/style.css"
}, {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 7,
"column" : 101,
"context" : "http://fonts.googleapis.com/css?family=Chela+One"
@@ -441,7 +441,7 @@
"message" : "CSS font-face declaration has no attributes.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 31,
"column" : 1,
"context" : "@font-face"
@@ -453,7 +453,7 @@
"message" : "CSS font selector declaration uses unexpected font-size value '5'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 45,
"column" : 5,
"context" : "font : 5 arial , sans-serif ;"
@@ -465,12 +465,12 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 44,
"column" : 1,
"context" : ".ex2"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 48,
"column" : 1,
"context" : ".ex3"
@@ -479,10 +479,10 @@
}, {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 15,
"column" : 37,
"context" : ".myFont"
@@ -494,112 +494,112 @@
"message" : "Use of Font-face declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 13,
"context" : "null"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 9,
"column" : 13,
"context" : "OPS/fonts/bloody.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 13,
"context" : "OPS/fonts/bloody.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 14,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 18,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 19,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 20,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 21,
"column" : 13,
"context" : "http://themes.googleusercontent.com/static/fonts/chelaone/v1/DHUBEAsCcSRMyWTJ6sisfj8E0i7KZn-EPnyo3HZu7kw.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 2,
"column" : 5,
"context" : "null"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 3,
"column" : 5,
"context" : "OPS/fonts/brankovic.ttf"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 7,
"column" : 5,
"context" : "OPS/fonts/brankovic.ttf"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 8,
"column" : 5,
"context" : "OPS/fonts/Fummel.otf"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 12,
"column" : 5,
"context" : "OPS/fonts/Fummel.otf"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 13,
"column" : 5,
"context" : "OPS/fonts/bloody.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 17,
"column" : 5,
"context" : "OPS/fonts/bloody.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 18,
"column" : 5,
"context" : "OPS/styles/"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 22,
"column" : 5,
"context" : "OPS/styles/"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 23,
"column" : 5,
"context" : "OPS/styles/fonts/bloody.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 27,
"column" : 5,
"context" : "OPS/styles/fonts/bloody.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 28,
"column" : 5,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 35,
"column" : 5,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 36,
"column" : 5,
"context" : "http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf"
@@ -611,7 +611,7 @@
"message" : "An external reference was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 60,
"column" : 131,
"context" : "http://www.google.com/fonts"
@@ -623,7 +623,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -635,7 +635,7 @@
"message" : "Ensure b, i, em, and strong elements are used in compliance with W3C HTML5 directives.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 39,
"column" : 7,
"context" : "b"
@@ -644,37 +644,37 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-006",
"severity" : "ERROR",
"message" : "Remote resource reference not allowed; resource must be placed in the OCF.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 7,
"column" : 101,
"context" : "http://fonts.googleapis.com/css?family=Chela+One"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 21,
"column" : 13,
"context" : "http://themes.googleusercontent.com/static/fonts/chelaone/v1/DHUBEAsCcSRMyWTJ6sisfj8E0i7KZn-EPnyo3HZu7kw.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 36,
"column" : 5,
"context" : "http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf"
@@ -683,20 +683,20 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
- "message" : "Referenced resource is not found in the ePub.",
+ "message" : "Referenced resource could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 14,
"column" : 13,
"context" : "OPS/fonts/badaboom.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 23,
"column" : 5,
"context" : "OPS/styles/fonts/bloody.woff"
}, {
- "fileName" : "OPS/styles/style.css",
+ "path" : "OPS/styles/style.css",
"line" : 28,
"column" : 5,
"context" : "OPS/fonts/badaboom.woff"
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp
new file mode 100644
index 0000000..911d10c
--- /dev/null
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font-face_expected_results.xmp
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:stFnt="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:extended-properties="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/" xmlns:premis="http://www.loc.gov/premis/rdf/v1#" dc:format="application/epub+zip;version=3.0.1" xmp:CreateDate="2015-03-30T16:14:34Z" extended-properties:Characters="220 [...]
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">Font Face Sample Book</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ <xmpTPg:Fonts>
+ <rdf:Bag>
+ <rdf:li stFnt:fontFamily="Bloody" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Badaboom" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Brankovic" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Fummel" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Null" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Bloody_wrong" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="Chela One" stFnt:fontFace="400" />
+ <rdf:li stFnt:fontFamily="Bitstream Vera Serif Bold" stFnt:fontFace="Regular" />
+ </rdf:Bag>
+ </xmpTPg:Fonts>
+ <premis:hasEvent rdf:parseType="Resource">
+ <premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-03-30T16:15:02+02:00</premis:hasEventDateTime>
+ <premis:hasEventType rdf:resource="http://id.loc.gov/vocabulary/preservation/eventType/val" />
+ <premis:hasEventDetail>Not well-formed</premis:hasEventDetail>
+ <premis:hasEventOutcomeInformation>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-002, ERROR, Empty or NULL reference found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (18-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-008, ERROR, An error occurred while parsing the CSS: Token '}' not allowed here, expecting a property value.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (50-1)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>RSC-006, ERROR, Remote resource reference not allowed; resource must be placed in the OCF.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (7-101)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (21-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (36-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>RSC-007, ERROR, Referenced resource could not be found in the EPUB.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (14-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (23-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (28-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-007, WARN, Font-face reference OPS/fonts/brankovic.ttf refers to non-standard font type application/x-font-truetype.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (3-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-019, WARN, CSS font-face declaration has no attributes.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (31-1)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-007, HINT, Content Documents do not use 'epub:type' attributes for semantic inflection.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_css.xhtml" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-028, HINT, Use of Font-face declaration.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (8-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (9-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (13-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (14-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (18-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (19-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (20-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (21-13)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (2-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (3-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (7-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (8-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (12-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (13-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (17-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (18-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (22-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (23-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (27-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (28-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (35-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (36-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>HTM-038, HINT, Ensure b, i, em, and strong elements are used in compliance with W3C HTML5 directives.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/style_tag_css.xhtml (39-7)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>HTM-010, HINT, Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx (2-68)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>OPF-059, HINT, Spine item has no NCX entry reference.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-012, HINT, Document links to multiple CSS files.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (6-69)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (7-101)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-008, HINT, Navigation Document has no 'landmarks nav' element.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="font-face.epub" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>HTM-005, HINT, An external reference was found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (60-131)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-020, HINT, CSS font selector declaration uses unexpected font-size value '5'.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (45-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-014, HINT, Value of CSS property 'font-size' does not use a relative size.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (59-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (65-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (71-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (77-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (83-5)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-025, HINT, CSS class Selector could not be found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (15-37)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-013, HINT, Content file contains at least one inline style declaration.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_css.xhtml (60-65)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-024, HINT, CSS class Selector is not used.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (44-1)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/styles/style.css (48-1)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ </rdf:Seq>
+ </premis:hasEventOutcomeInformation>
+ <premis:hasEventRelatedAgent rdf:parseType="Resource">
+ <premis:hasAgentType rdf:resource="http://id.loc.gov/vocabulary/preservation/agentType/sof" />
+ <premis:hasAgentName>epubcheck 4.0.0-alpha12-SNAPSHOT</premis:hasAgentName>
+ </premis:hasEventRelatedAgent>
+ </premis:hasEvent>
+ <premis:hasSignificantProperties>
+ <rdf:Bag>
+ <rdf:li premis:hasSignificantPropertiesType="renditionLayout" premis:hasSignificantPropertiesValue="reflowable" />
+ <rdf:li premis:hasSignificantPropertiesType="isScripted" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasEncryption" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAudio" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasVideo" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasSignatures" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAllFontsEmbedded" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="reference" premis:hasSignificantPropertiesValue="http://www.google.com/fonts" />
+ <rdf:li premis:hasSignificantPropertiesType="reference" premis:hasSignificantPropertiesValue="http://themes.googleusercontent.com/static/fonts/chelaone/v1/DHUBEAsCcSRMyWTJ6sisfj8E0i7KZn-EPnyo3HZu7kw.woff" />
+ <rdf:li premis:hasSignificantPropertiesType="reference" premis:hasSignificantPropertiesValue="http://developer.mozilla.org/@api/deki/files/2934/=VeraSeBd.ttf" />
+ </rdf:Bag>
+ </premis:hasSignificantProperties>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe/OEBPS/content.opf b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe/OEBPS/content.opf
index 4fd08d0..c45a949 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe/OEBPS/content.opf
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe/OEBPS/content.opf
@@ -3,15 +3,8 @@
<metadata>
<meta name="generator" content="Adobe InDesign"/>
<dc:title>Fonts Default Test</dc:title>
- <dc:creator></dc:creator>
- <dc:subject></dc:subject>
- <dc:description></dc:description>
<dc:publisher>AMC</dc:publisher>
<dc:date>2011-07-16</dc:date>
- <dc:source></dc:source>
- <dc:relation></dc:relation>
- <dc:coverage></dc:coverage>
- <dc:rights></dc:rights>
<dc:language>en-US</dc:language>
<dc:identifier id="bookid">12345</dc:identifier>
<dc:identifier>urn:uuid:7C39D332-2638-4726-B5F6-D0619B58F487</dc:identifier>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json
index cfb4e50..467f3c7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_adobe_expected_results.json
@@ -5,11 +5,11 @@
"filename" : "font_encryption_adobe.epub",
"checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
"checkDate" : "09-05-2014 03:17:17",
- "elapsedTime" : 59,
+ "elapsedTime" : 24,
"nFatal" : 0,
"nError" : 1,
"nWarning" : 0,
- "nUsage" : 5
+ "nUsage" : 6
},
"publication" : {
"publisher" : "AMC",
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"id" : "ePubCheck.NoManifestRef:OEBPS/content.opf",
"fileName" : "OEBPS/content.opf",
"media_type" : null,
- "compressedSize" : 558,
- "uncompressedSize" : 1177,
+ "compressedSize" : 490,
+ "uncompressedSize" : 973,
"compressionMethod" : "Deflated",
- "checkSum" : "eb84bb96341d1badff8dee2b3c3aa97dd4322b7a05619668dae2cd77902517",
+ "checkSum" : "9a65deba089824eac48404fb4712e9f4e67f6d3961be92569b30b1869c317d",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -222,12 +222,12 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 15,
"column" : 1,
"context" : ".leftFloat"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 18,
"column" : 1,
"context" : ".rightFloat"
@@ -239,22 +239,22 @@
"message" : "Use of Font-face declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 2,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 3,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 4,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 5,
"column" : 2,
"context" : "OEBPS/fonts/ChaparralPro-Regular.otf"
@@ -266,9 +266,9 @@
"message" : "Irregular DOCTYPE: found '-//W3C//DTD XHTML 1.1 //EN', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
- "line" : 0,
- "column" : 0,
+ "path" : "OEBPS/am-font-test.html",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -278,7 +278,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/toc.ncx",
+ "path" : "OEBPS/toc.ncx",
"line" : 3,
"column" : 68,
"context" : ""
@@ -290,7 +290,7 @@
"message" : "Content file doesn't contain xml:lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
+ "path" : "OEBPS/am-font-test.html",
"line" : -1,
"column" : -1,
"context" : null
@@ -302,11 +302,23 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
+ "path" : "OEBPS/am-font-test.html",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
+ }, {
+ "ID" : "NCX-006",
+ "severity" : "USAGE",
+ "message" : "Empty \"text\" label in the NCX document",
+ "additionalLocations" : 0,
+ "locations" : [ {
+ "path" : "OEBPS/toc.ncx",
+ "line" : 11,
+ "column" : 10,
+ "context" : null
+ } ],
+ "suggestion" : null
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.json
index aea7397..b9d815d 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/font_encryption_idpf.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/font_encryption_idpf.epub",
"filename" : "font_encryption_idpf.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:17",
- "elapsedTime" : 704,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:38",
+ "elapsedTime" : 400,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -434,7 +434,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "Css-fontface/fonts/OldStandard-Italic.otf", "Css-fontface/fonts/OldStandard-Bold.obf.woff", "Css-fontface/fonts/OldStandard-Regular.obf.woff", "Css-fontface/fonts/OldStandard-Italic.obf.otf", "Css-fontface/fonts/OldStandard-Regular.obf.otf", "Css-fontface/fonts/OldStandard-Bold.otf", "Css-fontface/fonts/OldStandard-Regular.otf", "Css-fontface/fonts/OldStandard-Italic.obf.woff", "Css-fontface/fonts/OldStandard-Italic.woff", "Css-fontface/fonts/OldStandard-Bold.o [...]
+ "referencedItems" : [ "Css-fontface/fonts/OldStandard-Bold.obf.otf", "Css-fontface/fonts/OldStandard-Bold.obf.woff", "Css-fontface/fonts/OldStandard-Bold.otf", "Css-fontface/fonts/OldStandard-Bold.woff", "Css-fontface/fonts/OldStandard-Italic.obf.otf", "Css-fontface/fonts/OldStandard-Italic.obf.woff", "Css-fontface/fonts/OldStandard-Italic.otf", "Css-fontface/fonts/OldStandard-Italic.woff", "Css-fontface/fonts/OldStandard-Regular.obf.otf", "Css-fontface/fonts/OldStandard-Regular.obf. [...]
}, {
"id" : "pg1",
"fileName" : "Css-fontface/pages/pg1.xhtml",
@@ -522,7 +522,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "Css-fontface/pages/pg2.xhtml", "Css-fontface/pages/pg1.xhtml", "Css-fontface/pages/pg3.xhtml" ]
+ "referencedItems" : [ "Css-fontface/pages/pg1.xhtml", "Css-fontface/pages/pg2.xhtml", "Css-fontface/pages/pg3.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -530,22 +530,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Css-fontface/pages/cover.xhtml",
+ "path" : "Css-fontface/pages/cover.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -557,7 +557,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "font_encryption_idpf.epub",
+ "path" : "font_encryption_idpf.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -569,77 +569,77 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : 11,
"column" : 51,
"context" : "font-family:OS-otf,sans-serif;"
}, {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : 15,
"column" : 52,
"context" : "font-family:OS-woff,sans-serif;"
}, {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : 19,
"column" : 55,
"context" : "font-family:OS-obf-otf,sans-serif;"
}, {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : 23,
"column" : 56,
"context" : "font-family:OS-obf-woff,sans-serif;"
}, {
- "fileName" : "Css-fontface/pages/pg1.xhtml",
+ "path" : "Css-fontface/pages/pg1.xhtml",
"line" : 33,
"column" : 44,
"context" : "font-family:sans-serif;"
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : 11,
"column" : 68,
"context" : "font-family:OS-otf,sans-serif;font-weight:bold;"
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : 15,
"column" : 69,
"context" : "font-family:OS-woff,sans-serif;font-weight:bold;"
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : 19,
"column" : 72,
"context" : "font-family:OS-obf-otf,sans-serif;font-weight:bold;"
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : 23,
"column" : 73,
"context" : "font-family:OS-obf-woff,sans-serif;font-weight:bold;"
}, {
- "fileName" : "Css-fontface/pages/pg2.xhtml",
+ "path" : "Css-fontface/pages/pg2.xhtml",
"line" : 35,
"column" : 61,
"context" : "font-family:sans-serif;font-weight:bold;"
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : 11,
"column" : 69,
"context" : "font-family:OS-otf,sans-serif;font-style:italic;"
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : 15,
"column" : 70,
"context" : "font-family:OS-woff,sans-serif;font-style:italic;"
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : 19,
"column" : 73,
"context" : "font-family:OS-obf-otf,sans-serif;font-style:italic;"
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : 23,
"column" : 74,
"context" : "font-family:OS-obf-woff,sans-serif;font-style:italic;"
}, {
- "fileName" : "Css-fontface/pages/pg3.xhtml",
+ "path" : "Css-fontface/pages/pg3.xhtml",
"line" : 35,
"column" : 62,
"context" : "font-family:sans-serif;font-style:italic;"
@@ -651,132 +651,132 @@
"message" : "Use of Font-face declaration.",
"additionalLocations" : 23,
"locations" : [ {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 2,
"column" : 5,
"context" : "null"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 3,
"column" : 5,
"context" : "null"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 4,
"column" : 5,
"context" : "null"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 5,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 9,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 10,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 11,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 12,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 16,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 17,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 18,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 19,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 23,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 24,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 25,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.obf.otf"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 26,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 30,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 31,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 32,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Regular.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 33,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 37,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 38,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 39,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Bold.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 40,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.woff"
}, {
- "fileName" : "Css-fontface/css/fonts.css",
+ "path" : "Css-fontface/css/fonts.css",
"line" : 43,
"column" : 5,
"context" : "Css-fontface/fonts/OldStandard-Italic.woff"
}, {
- "fileName" : "There are 23 additional locations for this message.",
+ "path" : "There are 23 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -785,10 +785,10 @@
}, {
"ID" : "NCX-003",
"severity" : "USAGE",
- "message" : "An .NCX file is required for TOC navigation on ePub v2 readers.",
+ "message" : "An .NCX file is required for TOC navigation on EPUB v2 readers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Css-fontface/package.opf",
+ "path" : "Css-fontface/package.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -800,7 +800,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Css-fontface/pages/toc.xhtml",
+ "path" : "Css-fontface/pages/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "Css-fontface/pages/cover.xhtml"
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xml
index 01ccada..821fa05 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xml
@@ -5,7 +5,7 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2012-01-20T12:47:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Well-formed</status>
<messages>
<message>OPF-058, HINT, [Spine item has no TOC entry reference.], Css-fontface/pages/toc.xhtml</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xmp b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xmp
new file mode 100644
index 0000000..5ef8691
--- /dev/null
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_idpf_expected_results.xmp
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:stFnt="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:extended-properties="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/" xmlns:premis="http://www.loc.gov/premis/rdf/v1#" dc:format="application/epub+zip;version=3.0.1" xmp:CreateDate="2015-03-30T16:14:34Z" extended-properties:Characters="290 [...]
+ <dc:creator>
+ <rdf:Seq>
+ <rdf:li>David</rdf:li>
+ </rdf:Seq>
+ </dc:creator>
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">External CSS @fontface Test</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ <xmpTPg:Fonts>
+ <rdf:Bag>
+ <rdf:li stFnt:fontFamily="OS-obf-otf" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="OS-obf-otf" stFnt:fontFace="Bold" />
+ <rdf:li stFnt:fontFamily="OS-obf-otf" stFnt:fontFace="Italic" />
+ <rdf:li stFnt:fontFamily="OS-woff" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="OS-woff" stFnt:fontFace="Bold" />
+ <rdf:li stFnt:fontFamily="OS-woff" stFnt:fontFace="Italic" />
+ <rdf:li stFnt:fontFamily="OS-obf-woff" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="OS-obf-woff" stFnt:fontFace="Bold" />
+ <rdf:li stFnt:fontFamily="OS-obf-woff" stFnt:fontFace="Italic" />
+ <rdf:li stFnt:fontFamily="OS-otf" stFnt:fontFace="Regular" />
+ <rdf:li stFnt:fontFamily="OS-otf" stFnt:fontFace="Bold" />
+ <rdf:li stFnt:fontFamily="OS-otf" stFnt:fontFace="Italic" />
+ </rdf:Bag>
+ </xmpTPg:Fonts>
+ <premis:hasEvent rdf:parseType="Resource">
+ <premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-03-30T16:15:04+02:00</premis:hasEventDateTime>
+ <premis:hasEventType rdf:resource="http://id.loc.gov/vocabulary/preservation/eventType/val" />
+ <premis:hasEventDetail>Well-formed</premis:hasEventDetail>
+ <premis:hasEventOutcomeInformation>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-007, HINT, Content Documents do not use 'epub:type' attributes for semantic inflection.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/cover.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>CSS-028, HINT, Use of Font-face declaration.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (2-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (3-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (4-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (5-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (9-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (10-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (11-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (12-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (16-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (17-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (18-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (19-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (23-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (24-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (25-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (26-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (30-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (31-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (32-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (33-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (37-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (38-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (39-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (40-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/css/fonts.css (43-5)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="There are 23 additional locations for this message." />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>OPF-058, HINT, Spine item has no TOC entry reference.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/toc.xhtml" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-008, HINT, Navigation Document has no 'landmarks nav' element.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="font_encryption_idpf.epub" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>ACC-013, HINT, Content file contains at least one inline style declaration.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml (11-51)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml (15-52)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml (19-55)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml (23-56)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg1.xhtml (33-44)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml (11-68)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml (15-69)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml (19-72)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml (23-73)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg2.xhtml (35-61)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml (11-69)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml (15-70)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml (19-73)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml (23-74)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="Css-fontface/pages/pg3.xhtml (35-62)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ </rdf:Seq>
+ </premis:hasEventOutcomeInformation>
+ <premis:hasEventRelatedAgent rdf:parseType="Resource">
+ <premis:hasAgentType rdf:resource="http://id.loc.gov/vocabulary/preservation/agentType/sof" />
+ <premis:hasAgentName>epubcheck 4.0.0-alpha12-SNAPSHOT</premis:hasAgentName>
+ </premis:hasEventRelatedAgent>
+ </premis:hasEvent>
+ <premis:hasSignificantProperties>
+ <rdf:Bag>
+ <rdf:li premis:hasSignificantPropertiesType="renditionLayout" premis:hasSignificantPropertiesValue="reflowable" />
+ <rdf:li premis:hasSignificantPropertiesType="isScripted" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasEncryption" premis:hasSignificantPropertiesValue="true" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAudio" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasVideo" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasSignatures" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAllFontsEmbedded" premis:hasSignificantPropertiesValue="true" />
+ </rdf:Bag>
+ </premis:hasSignificantProperties>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown/OEBPS/content.opf b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown/OEBPS/content.opf
index 4fd08d0..c45a949 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown/OEBPS/content.opf
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown/OEBPS/content.opf
@@ -3,15 +3,8 @@
<metadata>
<meta name="generator" content="Adobe InDesign"/>
<dc:title>Fonts Default Test</dc:title>
- <dc:creator></dc:creator>
- <dc:subject></dc:subject>
- <dc:description></dc:description>
<dc:publisher>AMC</dc:publisher>
<dc:date>2011-07-16</dc:date>
- <dc:source></dc:source>
- <dc:relation></dc:relation>
- <dc:coverage></dc:coverage>
- <dc:rights></dc:rights>
<dc:language>en-US</dc:language>
<dc:identifier id="bookid">12345</dc:identifier>
<dc:identifier>urn:uuid:7C39D332-2638-4726-B5F6-D0619B58F487</dc:identifier>
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json
index 565c644..34607dc 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/font_encryption_unknown_expected_results.json
@@ -5,11 +5,11 @@
"filename" : "font_encryption_unknown.epub",
"checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
"checkDate" : "09-05-2014 03:17:17",
- "elapsedTime" : 61,
+ "elapsedTime" : 25,
"nFatal" : 0,
"nError" : 2,
"nWarning" : 0,
- "nUsage" : 5
+ "nUsage" : 6
},
"publication" : {
"publisher" : "AMC",
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"id" : "ePubCheck.NoManifestRef:OEBPS/content.opf",
"fileName" : "OEBPS/content.opf",
"media_type" : null,
- "compressedSize" : 558,
- "uncompressedSize" : 1177,
+ "compressedSize" : 490,
+ "uncompressedSize" : 973,
"compressionMethod" : "Deflated",
- "checkSum" : "eb84bb96341d1badff8dee2b3c3aa97dd4322b7a05619668dae2cd77902517",
+ "checkSum" : "9a65deba089824eac48404fb4712e9f4e67f6d3961be92569b30b1869c317d",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -222,12 +222,12 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 15,
"column" : 1,
"context" : ".leftFloat"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 18,
"column" : 1,
"context" : ".rightFloat"
@@ -239,22 +239,22 @@
"message" : "Use of Font-face declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 2,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 3,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 4,
"column" : 2,
"context" : "null"
}, {
- "fileName" : "OEBPS/template.css",
+ "path" : "OEBPS/template.css",
"line" : 5,
"column" : 2,
"context" : "OEBPS/fonts/ChaparralPro-Regular.otf"
@@ -266,9 +266,9 @@
"message" : "Irregular DOCTYPE: found '-//W3C//DTD XHTML 1.1 //EN', expected '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \n\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
- "line" : 0,
- "column" : 0,
+ "path" : "OEBPS/am-font-test.html",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -278,7 +278,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/toc.ncx",
+ "path" : "OEBPS/toc.ncx",
"line" : 3,
"column" : 68,
"context" : ""
@@ -290,7 +290,7 @@
"message" : "Content file doesn't contain xml:lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
+ "path" : "OEBPS/am-font-test.html",
"line" : -1,
"column" : -1,
"context" : null
@@ -302,21 +302,33 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/am-font-test.html",
+ "path" : "OEBPS/am-font-test.html",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
+ "ID" : "NCX-006",
+ "severity" : "USAGE",
+ "message" : "Empty \"text\" label in the NCX document",
+ "additionalLocations" : 0,
+ "locations" : [ {
+ "path" : "OEBPS/toc.ncx",
+ "line" : 11,
+ "column" : 10,
+ "context" : null
+ } ],
+ "suggestion" : null
+ }, {
"ID" : "RSC-004",
"severity" : "ERROR",
"message" : "File 'OEBPS/fonts/ChaparralPro-Regular.otf' could not be decrypted.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "font_encryption_unknown.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "font_encryption_unknown.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/keyframe_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/keyframe_expected_results.json
index a82798f..1d6f12e 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/keyframe_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/keyframe_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/keyframe.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/keyframe.epub",
"filename" : "keyframe.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:15",
- "elapsedTime" : 310,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 46,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "keyframe.epub",
+ "path" : "keyframe.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -275,10 +275,10 @@
}, {
"ID" : "ACC-014",
"severity" : "USAGE",
- "message" : "CSS Selector font-size attribute value does not use a relative size.",
+ "message" : "Value of CSS property 'font-size' does not use a relative size.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 9,
"column" : 5,
"context" : "font-size : xx-large ;"
@@ -290,47 +290,47 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 16,
"column" : 1,
"context" : "@keyframes mymove"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 22,
"column" : 1,
"context" : "@-moz-keyframes mymove"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 28,
"column" : 1,
"context" : "@-webkit-keyframes mymove"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 34,
"column" : 1,
"context" : "@-o-keyframes mymove"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 6,
"column" : 12,
"context" : "div {\n width: 100px;\n height: 100px;\n background: purple;\n position: relative;\n animation: mymove 5s infinite;\n -moz-animation: mymove 5s infinite; /* Firefox */\n -webkit-animation: mymove 5s infinite; /* Safari and Chrome */\n -o-animation: mymove 5s infinite; /* Opera */\n }\n\n @keyframes mymove\n {\n 0% {top:0px;}\n 50% {top:2 [...]
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 18,
"column" : 9,
"context" : "@keyframes mymove"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 25,
"column" : 9,
"context" : "@-moz-keyframes mymove"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 32,
"column" : 9,
"context" : "@-webkit-keyframes mymove"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 39,
"column" : 9,
"context" : "@-o-keyframes mymove"
@@ -342,7 +342,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -354,7 +354,7 @@
"message" : "Ensure b, i, em, and strong elements are used in compliance with W3C HTML5 directives.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 50,
"column" : 7,
"context" : "b"
@@ -363,19 +363,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub2_expected_results.json
index 6bbc88d..9223662 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub2_expected_results.json
@@ -22,7 +22,7 @@
"language" : "en",
"nSpines" : 3,
"checkSum" : 0,
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true
@@ -135,11 +135,11 @@
"severity" : "USAGE",
"message" : "Multiple CSS for document found.",
"locations" : [ {
- "fileName" : "external_css.xhtml",
+ "path" : "external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
} ]
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub3_expected_results.json
index de55dfd..0bb2d38 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/multiple_epub3_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/multiple_epub3.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/multiple_epub3.epub",
"filename" : "multiple_epub3.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:16",
- "elapsedTime" : 252,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 42,
"nFatal" : 0,
"nError" : 1,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -148,7 +148,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/style.css", "OPS/styleUTF32.css", "OPS/style2.css" ]
+ "referencedItems" : [ "OPS/style.css", "OPS/style2.css", "OPS/styleUTF32.css" ]
}, {
"id" : "page02",
"fileName" : "OPS/style_tag_css.xhtml",
@@ -280,7 +280,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -288,17 +288,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -310,7 +310,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "multiple_epub3.epub",
+ "path" : "multiple_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -322,10 +322,10 @@
"message" : "Only UTF-8 and UTF-16 encodings are allowed, detected utf-32be BOM.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/styleUTF32.css",
+ "path" : "OPS/styleUTF32.css",
"line" : -1,
"column" : -1,
- "context" : ""
+ "context" : null
} ],
"suggestion" : null
}, {
@@ -334,17 +334,17 @@
"message" : "Document links to multiple CSS files.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 6,
"column" : 62,
"context" : "style.css"
}, {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 7,
"column" : 63,
"context" : "style2.css"
}, {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : 8,
"column" : 67,
"context" : "styleUTF32.css"
@@ -356,7 +356,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -365,19 +365,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/transform_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/transform_expected_results.json
index 2d7eb40..c461835 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/transform_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/transform_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/transform.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/transform.epub",
"filename" : "transform.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:10",
- "elapsedTime" : 3762,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 44,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "transform.epub",
+ "path" : "transform.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,22 +278,22 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 10,
"column" : 119,
"context" : "-webkit-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 11,
"column" : 115,
"context" : "-ms-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 14,
"column" : 116,
"context" : "-moz-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 15,
"column" : 114,
"context" : "-o-transform:rotate(120deg);width: 100px;height: 100px;background-color: purple;margin-bottom: 50px"
@@ -305,27 +305,27 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 23,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 8,
"column" : 23,
"context" : "-webkit-transform : rotatex(90deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 5,
"column" : 28,
"context" : ".rotateY {\n background-color:yellow;\n -webkit-transform:rotateY(180deg);\n }\n\n .rotateX {\n background-color:yellow;\n -webkit-transform:rotateX(180deg);\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 8,
"column" : 31,
"context" : "-webkit-transform : rotatey(180deg) ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 31,
"context" : "-webkit-transform : rotatex(180deg) ;"
@@ -337,7 +337,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -346,19 +346,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/css/transition_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/css/transition_expected_results.json
index be6c21d..d7a6d3c 100644
--- a/src/test/resources/com/adobe/epubcheck/test/css/transition_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/css/transition_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/css/transition.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/css/transition.epub",
"filename" : "transition.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:17:15",
- "elapsedTime" : 332,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:37",
+ "elapsedTime" : 43,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -236,7 +236,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/style_tag_css.xhtml", "OPS/inline_css.xhtml", "OPS/external_css.xhtml" ]
+ "referencedItems" : [ "OPS/external_css.xhtml", "OPS/inline_css.xhtml", "OPS/style_tag_css.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_css.xhtml",
+ "path" : "OPS/external_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "transition.epub",
+ "path" : "transition.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,7 +278,7 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 12,
"column" : 51,
"context" : "-webkit-transition:letter-spacing 2s"
@@ -290,47 +290,47 @@
"message" : "Use of certain CSS such as Columns, Transforms, Transitions, box-sizing or KeyFrames can cause pagination issues.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_css.xhtml",
+ "path" : "OPS/inline_css.xhtml",
"line" : 12,
"column" : 51,
"context" : "-webkit-transition:letter-spacing 2s"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 3,
"column" : 5,
"context" : "-webkit-transition-property : background-color ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 4,
"column" : 5,
"context" : "-webkit-transition-duration : 2s ;"
}, {
- "fileName" : "OPS/style.css",
+ "path" : "OPS/style.css",
"line" : 5,
"column" : 5,
"context" : "-webkit-transition-timing-function : ease-in ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 6,
"column" : 12,
"context" : "div\n {\n width:100px;\n height:100px;\n background:red;\n transition:width 2s;\n -moz-transition:width 2s; /* Firefox 4 */\n -webkit-transition:width 2s; /* Safari and Chrome */\n -o-transition:width 2s; /* Opera */\n }\n\n div:hover\n {\n width:300px;\n }"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 12,
"column" : 13,
"context" : "transition : width 2s ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 13,
"column" : 13,
"context" : "-moz-transition : width 2s ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 14,
"column" : 13,
"context" : "-webkit-transition : width 2s ;"
}, {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 15,
"column" : 13,
"context" : "-o-transition : width 2s ;"
@@ -342,7 +342,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -354,7 +354,7 @@
"message" : "Ensure b, i, em, and strong elements are used in compliance with W3C HTML5 directives.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/style_tag_css.xhtml",
+ "path" : "OPS/style_tag_css.xhtml",
"line" : 26,
"column" : 7,
"context" : "b"
@@ -363,19 +363,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_css.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/style_tag_css.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.json
index d816dcf..997a0ad 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Epub2_marked_v3.epub",
+ "path" : "Epub2_marked_v3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -180,9 +180,9 @@
"message" : "Irregular DOCTYPE: found '-//W3C//DTD XHTML 1.1//EN', expected '<!DOCTYPE html>'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/page01.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -192,7 +192,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -201,10 +201,10 @@
}, {
"ID" : "HTM-015",
"severity" : "WARNING",
- "message" : "HTML4 DOCTYPE definition within ePub v3.",
+ "message" : "HTML4 DOCTYPE definition within EPUB v3.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "page01.xhtml",
+ "path" : "page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -213,10 +213,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.",
+ "message" : "Error while parsing file 'Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 8,
"column" : 13,
"context" : null
@@ -225,10 +225,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n package dcterms:modified meta element must occur exactly once'.",
+ "message" : "Error while parsing file 'package dcterms:modified meta element must occur exactly once'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 3,
"column" : 57,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.xml
index 410b495..8fa28bf 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Epub2_marked_v3_expected_results.xml
@@ -4,15 +4,13 @@
<repInfo uri="Epub2_marked_v3.epub">
<created>2014-09-05T01:49:14Z</created>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Not well-formed</status>
<messages>
- <message>RSC-005, ERROR, [Error while parsing file 'assertion failed:
- package dcterms:modified meta element must occur exactly once'.], OPS/content.opf (3-57)</message>
- <message>RSC-005, ERROR, [Error while parsing file 'assertion failed:
- Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.], OPS/content.opf (8-13)</message>
+ <message>RSC-005, ERROR, [Error while parsing file 'package dcterms:modified meta element must occur exactly once'.], OPS/content.opf (3-57)</message>
+ <message>RSC-005, ERROR, [Error while parsing file 'Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.], OPS/content.opf (8-13)</message>
<message>HTM-004, ERROR, [Irregular DOCTYPE: found '-//W3C//DTD XHTML 1.1//EN', expected '<!DOCTYPE html>'.], OPS/page01.xhtml</message>
- <message>HTM-015, WARN, [HTML4 DOCTYPE definition within ePub v3.], page01.xhtml</message>
+ <message>HTM-015, WARN, [HTML4 DOCTYPE definition within EPUB v3.], page01.xhtml</message>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS/toc.ncx (2-68)</message>
<message>ACC-008, HINT, [Navigation Document has no 'landmarks nav' element.], Epub2_marked_v3.epub</message>
<message>ACC-007, HINT, [Content Documents do not use 'epub:type' attributes for semantic inflection.], OPS/page01.xhtml</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2/OPS/toc.ncx
index 0587ac1..9e8b988 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.json
index 71954c6..82edc25 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.json
@@ -7,7 +7,7 @@
"checkDate" : "09-05-2014 03:15:42",
"elapsedTime" : 57,
"nFatal" : 0,
- "nError" : 5,
+ "nError" : 6,
"nWarning" : 1,
"nUsage" : 1
},
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 293,
- "uncompressedSize" : 556,
+ "compressedSize" : 295,
+ "uncompressedSize" : 574,
"compressionMethod" : "Deflated",
- "checkSum" : "7e983f3695b1eea13cb6d3e7aacb5d84de767f2ccda456f5154d35c5f9b012",
+ "checkSum" : "708b669acb4e2fb5cae45961dde9f2abb3e2d9b793d4fb4603c38a51fe29b52",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -178,7 +178,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -187,48 +187,48 @@
}, {
"ID" : "HTM-016",
"severity" : "WARNING",
- "message" : "HTML5 DOCTYPE definition within ePub v2.",
+ "message" : "HTML5 DOCTYPE definition within EPUB v2.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "toc.xhtml",
+ "path" : "toc.xhtml",
"line" : -1,
"column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
- "ID" : "NAV-001",
+ "ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "The nav file is not supported for ePub v2.",
+ "message" : "Error while parsing file 'attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/content.opf",
+ "line" : 12,
+ "column" : 90,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'attribute \"properties\" not allowed here; expected attribute \"fallback\", \"fallback-style\", \"href\", \"media-type\", \"required-modules\" or \"required-namespace\"'.",
+ "message" : "Error while parsing file 'attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
- "line" : 12,
- "column" : 90,
+ "path" : "OPS/content.opf",
+ "line" : 7,
+ "column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'attribute \"property\" not allowed here; expected attribute \"content\", \"id\", \"name\", \"scheme\" or \"xml:lang\"'.",
+ "message" : "Error while parsing file 'element \"body\" incomplete; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
- "line" : 7,
- "column" : 39,
+ "path" : "OPS/toc.xhtml",
+ "line" : 14,
+ "column" : 8,
"context" : null
} ],
"suggestion" : null
@@ -238,7 +238,7 @@
"message" : "Error while parsing file 'element \"meta\" missing required attributes \"content\" and \"name\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 7,
"column" : 39,
"context" : null
@@ -247,10 +247,27 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
+ "message" : "Error while parsing file 'element \"nav\" not allowed anywhere; expected element \"address\", \"blockquote\", \"del\", \"div\", \"dl\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"ins\", \"noscript\", \"ns:svg\", \"ol\", \"p\", \"pre\", \"script\", \"table\" or \"ul\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")'.",
+ "additionalLocations" : 0,
+ "locations" : [ {
+ "path" : "OPS/toc.xhtml",
+ "line" : 9,
+ "column" : 22,
+ "context" : null
+ }, {
+ "path" : "OPS/toc.xhtml",
+ "line" : 12,
+ "column" : 10,
+ "context" : null
+ } ],
+ "suggestion" : null
+ }, {
+ "ID" : "RSC-005",
+ "severity" : "ERROR",
"message" : "Error while parsing file 'text not allowed here; expected the element end-tag'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 7,
"column" : 61,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.xml
index a8ec17d..d453c5f 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Epub3_marked_v2_expected_results.xml
@@ -5,15 +5,17 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2012-10-10T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>2.0</version>
+ <version>2.0.1</version>
<status>Not well-formed</status>
<messages>
<message>RSC-005, ERROR, [Error while parsing file 'attribute "property" not allowed here; expected attribute "content", "id", "name", "scheme" or "xml:lang"'.], OPS/content.opf (7-39)</message>
<message>RSC-005, ERROR, [Error while parsing file 'element "meta" missing required attributes "content" and "name"'.], OPS/content.opf (7-39)</message>
<message>RSC-005, ERROR, [Error while parsing file 'text not allowed here; expected the element end-tag'.], OPS/content.opf (7-61)</message>
<message>RSC-005, ERROR, [Error while parsing file 'attribute "properties" not allowed here; expected attribute "fallback", "fallback-style", "href", "media-type", "required-modules" or "required-namespace"'.], OPS/content.opf (12-90)</message>
- <message>NAV-001, ERROR, [The nav file is not supported for ePub v2.], OPS/toc.xhtml</message>
- <message>HTM-016, WARN, [HTML5 DOCTYPE definition within ePub v2.], toc.xhtml</message>
+ <message>RSC-005, ERROR, [Error while parsing file 'element "nav" not allowed anywhere; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")'.], OPS/toc.xhtml (9-22)</message>
+ <message>RSC-005, ERROR, [Error while parsing file 'element "nav" not allowed anywhere; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")'.], OPS/toc.xhtml (12-10)</message>
+ <message>RSC-005, ERROR, [Error while parsing file 'element "body" incomplete; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")'.], OPS/toc.xhtml (14-8)</message>
+ <message>HTM-016, WARN, [HTML5 DOCTYPE definition within EPUB v2.], toc.xhtml</message>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS/toc.ncx (2-68)</message>
</messages>
<mimeType>application/epub+zip</mimeType>
@@ -42,7 +44,7 @@
<property>
<name>CreationDate</name>
<values arity="Scalar" type="Date">
- <value>2014-09-05T01:49:14Z</value>
+ <value>2015-06-07T00:06:52Z</value>
</values>
</property>
<property>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2/OPS/toc.ncx
index c9317ec..d2e1d05 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2_expected_results.json
index 02ec7d1..536bb74 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 294,
- "uncompressedSize" : 557,
+ "compressedSize" : 296,
+ "uncompressedSize" : 575,
"compressionMethod" : "Deflated",
- "checkSum" : "b324945e2ef6588e881e99ec48a96949a9dcf96760d477943ff64ef063b2e63b",
+ "checkSum" : "5c55396fd0e2565679d4fc202d49978b3091b8ff7a644e5425a5ca8ca96b910",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -2334,7 +2334,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -2343,139 +2343,139 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_expected_results.json
index 89dde9c..d355c1f 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -2356,132 +2356,132 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 75,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page006.xhtml",
+ "path" : "OPS/page006.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page007.xhtml",
+ "path" : "OPS/page007.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page008.xhtml",
+ "path" : "OPS/page008.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page009.xhtml",
+ "path" : "OPS/page009.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page010.xhtml",
+ "path" : "OPS/page010.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page011.xhtml",
+ "path" : "OPS/page011.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page012.xhtml",
+ "path" : "OPS/page012.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page013.xhtml",
+ "path" : "OPS/page013.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page014.xhtml",
+ "path" : "OPS/page014.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page015.xhtml",
+ "path" : "OPS/page015.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page016.xhtml",
+ "path" : "OPS/page016.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page017.xhtml",
+ "path" : "OPS/page017.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page018.xhtml",
+ "path" : "OPS/page018.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page019.xhtml",
+ "path" : "OPS/page019.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page020.xhtml",
+ "path" : "OPS/page020.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page021.xhtml",
+ "path" : "OPS/page021.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page022.xhtml",
+ "path" : "OPS/page022.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page023.xhtml",
+ "path" : "OPS/page023.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page024.xhtml",
+ "path" : "OPS/page024.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page025.xhtml",
+ "path" : "OPS/page025.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "There are 75 additional locations for this message.",
+ "path" : "There are 75 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2493,7 +2493,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Excessive_Spine_Items_epub3.epub",
+ "path" : "Excessive_Spine_Items_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -2505,7 +2505,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -2517,132 +2517,132 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2651,139 +2651,139 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_expected_results.json
index 2b55526..f8be7a1 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "pre-paginated",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : true,
"isBackwardCompatible" : false,
@@ -118,7 +118,7 @@
"isLinear" : false,
"navigationOrder" : null,
"isHTML5" : false,
- "isFixedFormat" : null,
+ "isFixedFormat" : true,
"isScripted" : false,
"scriptSrc" : false,
"scriptTag" : false,
@@ -2340,7 +2340,7 @@
"isLinear" : false,
"navigationOrder" : null,
"isHTML5" : true,
- "isFixedFormat" : null,
+ "isFixedFormat" : true,
"isScripted" : false,
"scriptSrc" : false,
"scriptTag" : false,
@@ -2356,132 +2356,132 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 75,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page006.xhtml",
+ "path" : "OPS/page006.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page007.xhtml",
+ "path" : "OPS/page007.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page008.xhtml",
+ "path" : "OPS/page008.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page009.xhtml",
+ "path" : "OPS/page009.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page010.xhtml",
+ "path" : "OPS/page010.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page011.xhtml",
+ "path" : "OPS/page011.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page012.xhtml",
+ "path" : "OPS/page012.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page013.xhtml",
+ "path" : "OPS/page013.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page014.xhtml",
+ "path" : "OPS/page014.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page015.xhtml",
+ "path" : "OPS/page015.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page016.xhtml",
+ "path" : "OPS/page016.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page017.xhtml",
+ "path" : "OPS/page017.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page018.xhtml",
+ "path" : "OPS/page018.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page019.xhtml",
+ "path" : "OPS/page019.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page020.xhtml",
+ "path" : "OPS/page020.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page021.xhtml",
+ "path" : "OPS/page021.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page022.xhtml",
+ "path" : "OPS/page022.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page023.xhtml",
+ "path" : "OPS/page023.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page024.xhtml",
+ "path" : "OPS/page024.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page025.xhtml",
+ "path" : "OPS/page025.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "There are 75 additional locations for this message.",
+ "path" : "There are 75 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2493,7 +2493,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Excessive_Spine_Items_epub3_fixed_format.epub",
+ "path" : "Excessive_Spine_Items_epub3_fixed_format.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -2505,7 +2505,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -2517,132 +2517,132 @@
"message" : "Fixed format item has no viewport defined.",
"additionalLocations" : 75,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page006.xhtml",
+ "path" : "OPS/page006.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page007.xhtml",
+ "path" : "OPS/page007.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page008.xhtml",
+ "path" : "OPS/page008.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page009.xhtml",
+ "path" : "OPS/page009.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page010.xhtml",
+ "path" : "OPS/page010.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page011.xhtml",
+ "path" : "OPS/page011.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page012.xhtml",
+ "path" : "OPS/page012.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page013.xhtml",
+ "path" : "OPS/page013.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page014.xhtml",
+ "path" : "OPS/page014.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page015.xhtml",
+ "path" : "OPS/page015.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page016.xhtml",
+ "path" : "OPS/page016.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page017.xhtml",
+ "path" : "OPS/page017.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page018.xhtml",
+ "path" : "OPS/page018.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page019.xhtml",
+ "path" : "OPS/page019.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page020.xhtml",
+ "path" : "OPS/page020.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page021.xhtml",
+ "path" : "OPS/page021.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page022.xhtml",
+ "path" : "OPS/page022.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page023.xhtml",
+ "path" : "OPS/page023.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page024.xhtml",
+ "path" : "OPS/page024.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page025.xhtml",
+ "path" : "OPS/page025.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "There are 75 additional locations for this message.",
+ "path" : "There are 75 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2654,132 +2654,132 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2788,139 +2788,139 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_properties_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_properties_expected_results.json
index bcf85e2..5fd1461 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_properties_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Excessive_Spine_Items_epub3_fixed_format_properties_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : true,
"isBackwardCompatible" : false,
@@ -2356,132 +2356,132 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 75,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page006.xhtml",
+ "path" : "OPS/page006.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page007.xhtml",
+ "path" : "OPS/page007.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page008.xhtml",
+ "path" : "OPS/page008.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page009.xhtml",
+ "path" : "OPS/page009.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page010.xhtml",
+ "path" : "OPS/page010.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page011.xhtml",
+ "path" : "OPS/page011.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page012.xhtml",
+ "path" : "OPS/page012.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page013.xhtml",
+ "path" : "OPS/page013.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page014.xhtml",
+ "path" : "OPS/page014.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page015.xhtml",
+ "path" : "OPS/page015.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page016.xhtml",
+ "path" : "OPS/page016.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page017.xhtml",
+ "path" : "OPS/page017.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page018.xhtml",
+ "path" : "OPS/page018.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page019.xhtml",
+ "path" : "OPS/page019.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page020.xhtml",
+ "path" : "OPS/page020.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page021.xhtml",
+ "path" : "OPS/page021.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page022.xhtml",
+ "path" : "OPS/page022.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page023.xhtml",
+ "path" : "OPS/page023.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page024.xhtml",
+ "path" : "OPS/page024.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page025.xhtml",
+ "path" : "OPS/page025.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "There are 75 additional locations for this message.",
+ "path" : "There are 75 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2493,7 +2493,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Excessive_Spine_Items_epub3_fixed_format_properties.epub",
+ "path" : "Excessive_Spine_Items_epub3_fixed_format_properties.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -2505,7 +2505,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -2517,132 +2517,132 @@
"message" : "Fixed format item has no viewport defined.",
"additionalLocations" : 75,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page006.xhtml",
+ "path" : "OPS/page006.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page007.xhtml",
+ "path" : "OPS/page007.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page008.xhtml",
+ "path" : "OPS/page008.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page009.xhtml",
+ "path" : "OPS/page009.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page010.xhtml",
+ "path" : "OPS/page010.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page011.xhtml",
+ "path" : "OPS/page011.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page012.xhtml",
+ "path" : "OPS/page012.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page013.xhtml",
+ "path" : "OPS/page013.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page014.xhtml",
+ "path" : "OPS/page014.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page015.xhtml",
+ "path" : "OPS/page015.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page016.xhtml",
+ "path" : "OPS/page016.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page017.xhtml",
+ "path" : "OPS/page017.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page018.xhtml",
+ "path" : "OPS/page018.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page019.xhtml",
+ "path" : "OPS/page019.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page020.xhtml",
+ "path" : "OPS/page020.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page021.xhtml",
+ "path" : "OPS/page021.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page022.xhtml",
+ "path" : "OPS/page022.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page023.xhtml",
+ "path" : "OPS/page023.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page024.xhtml",
+ "path" : "OPS/page024.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page025.xhtml",
+ "path" : "OPS/page025.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "There are 75 additional locations for this message.",
+ "path" : "There are 75 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2654,132 +2654,132 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -2788,139 +2788,139 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 74,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page002.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page003.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page004.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page006.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page007.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page008.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page009.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page010.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page011.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page012.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page013.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page014.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page015.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page016.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page017.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page018.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page019.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page020.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page021.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page022.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page023.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page024.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page025.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page026.xhtml"
}, {
- "fileName" : "There are 74 additional locations for this message.",
+ "path" : "There are 74 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2/OPS/toc.ncx
index 0587ac1..9e8b988 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2_expected_results.json
index 908d29f..283072a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 293,
- "uncompressedSize" : 556,
+ "compressedSize" : 295,
+ "uncompressedSize" : 574,
"compressionMethod" : "Deflated",
- "checkSum" : "7e983f3695b1eea13cb6d3e7aacb5d84de767f2ccda456f5154d35c5f9b012",
+ "checkSum" : "708b669acb4e2fb5cae45961dde9f2abb3e2d9b793d4fb4603c38a51fe29b52",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -200,7 +200,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -212,7 +212,7 @@
"message" : "Fallback-style item could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 11,
"column" : 181,
"context" : "math"
@@ -221,14 +221,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/math.xml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub3_expected_results.json
index 4ec86c3..54b7c9b 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Fallbacks_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -222,12 +222,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/fallback.xhtml",
+ "path" : "OPS/fallback.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -239,7 +239,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Fallbacks_epub3.epub",
+ "path" : "Fallbacks_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -251,7 +251,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -263,7 +263,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/math.xml"
@@ -272,22 +272,22 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/math.xml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file 'attribute \"fallback-style\" not allowed here; expected attribute \"media-overlay\", \"media-type\" or \"properties\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 13,
"column" : 125,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Media-type_handler_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Media-type_handler_expected_results.json
index b290307..5404354 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Media-type_handler_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Media-type_handler_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/opf/Media-type_handler.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/opf/Media-type_handler.epub",
"filename" : "Media-type_handler.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:48",
- "elapsedTime" : 515,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:15",
+ "elapsedTime" : 313,
"nFatal" : 0,
"nError" : 5,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -192,7 +192,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/images/image4.jpg", "OPS/images/image1.jpg", "OPS/settings.xml", "OPS/slideshow.xml", "OPS/images/image2.jpg", "OPS/images/image3.jpg" ]
+ "referencedItems" : [ "OPS/images/image1.jpg", "OPS/images/image2.jpg", "OPS/images/image3.jpg", "OPS/images/image4.jpg", "OPS/settings.xml", "OPS/slideshow.xml" ]
}, {
"id" : "pict1",
"fileName" : "OPS/images/image1.jpg",
@@ -420,22 +420,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/duplicate.xhtml",
+ "path" : "OPS/duplicate.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/impl.xhtml",
+ "path" : "OPS/impl.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/impl2.xhtml",
+ "path" : "OPS/impl2.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -447,7 +447,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Media-type_handler.epub",
+ "path" : "Media-type_handler.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -459,7 +459,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -471,7 +471,7 @@
"message" : "Handler binding for core Media-type 'image/jpeg' is not allowed.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 31,
"column" : 57,
"context" : null
@@ -480,10 +480,10 @@
}, {
"ID" : "OPF-009",
"severity" : "ERROR",
- "message" : "The media-type application/x-demo-popup has already been assigned handler 'OPS/impl.xhtml'.",
+ "message" : "The media-type 'application/x-demo-popup' has already been assigned a handler, with ID 'valid'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 33,
"column" : 70,
"context" : null
@@ -495,7 +495,7 @@
"message" : "The type property 'application/x-demo-slideshow' on the object tag does not match the declared media-type 'application/x-demo-popup' in the OPF manifest.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : 19,
"column" : 69,
"context" : "<object data=\"settings.xml\" type=\"application/x-demo-slideshow\">"
@@ -507,7 +507,7 @@
"message" : "Scripted property is not set on mediaType handler.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/impl2.xhtml",
+ "path" : "OPS/impl2.xhtml",
"line" : 22,
"column" : 84,
"context" : null
@@ -516,10 +516,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n manifest items referenced from the handler attribute of a bindings mediaType element must be of the 'application/xhtml+xml' type (given type was '')'.",
+ "message" : "Error while parsing file 'manifest items referenced from the handler attribute of a bindings mediaType element must be of the 'application/xhtml+xml' type (given type was '')'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 29,
"column" : 69,
"context" : null
@@ -528,10 +528,10 @@
}, {
"ID" : "SCP-002",
"severity" : "USAGE",
- "message" : "Use of XMLHttpRequest in ePub scripts is a security risk.",
+ "message" : "Use of XMLHttpRequest in EPUB scripts is a security risk.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/impl.xhtml",
+ "path" : "OPS/impl.xhtml",
"line" : 52,
"column" : 12,
"context" : "new XMLHttpRequest();"
@@ -543,12 +543,12 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/duplicate.xhtml",
+ "path" : "OPS/duplicate.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/impl.xhtml",
+ "path" : "OPS/impl.xhtml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2/OPS/toc.ncx
index 0587ac1..9e8b988 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2_expected_results.json
index 1b1d517..98ea6d4 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -175,10 +175,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 293,
- "uncompressedSize" : 556,
+ "compressedSize" : 295,
+ "uncompressedSize" : 574,
"compressionMethod" : "Deflated",
- "checkSum" : "7e983f3695b1eea13cb6d3e7aacb5d84de767f2ccda456f5154d35c5f9b012",
+ "checkSum" : "708b669acb4e2fb5cae45961dde9f2abb3e2d9b793d4fb4603c38a51fe29b52",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -266,7 +266,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -278,9 +278,9 @@
"message" : "Image file header may be corrupted.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/blank",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/blank",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -290,9 +290,9 @@
"message" : "The file 'OPS/image1.jpg' does not appear to match the media type image/gif, as specified in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Mismatched_mimetypes_epub2.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "Mismatched_mimetypes_epub2.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -302,7 +302,7 @@
"message" : "Media type 'text/html' is not appropriate for XHTML/OPS.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 10,
"column" : 68,
"context" : "page01"
@@ -314,7 +314,7 @@
"message" : "Found deprecated media-type 'text/x-oeb1-css'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 15,
"column" : 73,
"context" : "style"
@@ -326,7 +326,7 @@
"message" : "'image/gif' is not a permissible spine media-type.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 13,
"column" : 65,
"context" : null
@@ -338,7 +338,7 @@
"message" : "Spine item with non-standard media-type 'application/xhtml' has no fallback.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 11,
"column" : 75,
"context" : null
@@ -347,30 +347,30 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/image1.jpg"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "PKG-021",
"severity" : "ERROR",
"message" : "Corrupted image file encountered.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/blank",
+ "path" : "OPS/blank",
"line" : -1,
"column" : -1,
- "context" : "OPS/blank"
+ "context" : null
} ],
"suggestion" : null
} ]
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub3_expected_results.json
index 32ff619..1952524 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Mismatched_mimetypes_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -266,7 +266,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,7 +278,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Mismatched_mimetypes_epub3.epub",
+ "path" : "Mismatched_mimetypes_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -290,7 +290,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -302,9 +302,9 @@
"message" : "Image file header may be corrupted.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/blank",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/blank",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -314,9 +314,9 @@
"message" : "The file 'OPS/image1.jpg' does not appear to match the media type image/gif, as specified in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Mismatched_mimetypes_epub3.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "Mismatched_mimetypes_epub3.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -326,7 +326,7 @@
"message" : "Video type 'video/quicktime' might not be supported by reading systems ",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : 12,
"column" : 58,
"context" : null
@@ -338,7 +338,7 @@
"message" : "Spine item with non-standard media-type 'application/xhtml' has no fallback.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 11,
"column" : 76,
"context" : null
@@ -350,7 +350,7 @@
"message" : "Spine item with non-standard media-type 'image/gif' has no fallback.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 15,
"column" : 65,
"context" : null
@@ -362,12 +362,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/image1.jpg"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
@@ -376,30 +376,30 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/image1.jpg"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "PKG-021",
"severity" : "ERROR",
"message" : "Corrupted image file encountered.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/blank",
+ "path" : "OPS/blank",
"line" : -1,
"column" : -1,
- "context" : "OPS/blank"
+ "context" : null
} ],
"suggestion" : null
}, {
@@ -408,12 +408,12 @@
"message" : "Reference to non-standard resource type found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 17,
"column" : 36,
"context" : "OPS/page01.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : 11,
"column" : 36,
"context" : "OPS/page01.xhtml"
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2/OPS/toc.ncx
index 85afad2..e9020fa 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx:ncx xmlns:ncx="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<ncx:head>
- <ncx:meta name="dtb:uid" content=""/>
+ <ncx:meta name="dtb:uid" content="000000000000000000"/>
<ncx:meta name="dtb:depth" content="1"/>
<ncx:meta name="dtb:totalPageCount" content="0"/>
<ncx:meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2_expected_results.json
index fd9ac36..269f5b3 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 303,
- "uncompressedSize" : 644,
+ "compressedSize" : 306,
+ "uncompressedSize" : 662,
"compressionMethod" : "Deflated",
- "checkSum" : "de09d88de51d54e23207297c795195c8c1c6c522d41104ea4b57d69fc01259",
+ "checkSum" : "4abd4f0dbbbb9e3071e2fa621b2839c3dd1bf1e5dfac9af7f11abededad0c1",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -156,7 +156,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 76,
"context" : "ncx"
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub3_expected_results.json
index ae59896..24835a0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NAV_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Missing_NAV_epub3.epub",
+ "path" : "Missing_NAV_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -180,7 +180,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -189,10 +189,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.",
+ "message" : "Error while parsing file 'Exactly one manifest item must declare the 'nav' property (number of 'nav' items: 0).'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 9,
"column" : 13,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub2_expected_results.json
index d264129..bf2973e 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -134,7 +134,7 @@
"message" : "toc attribute was not found on the spine element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -146,7 +146,7 @@
"message" : "Error while parsing file 'element \"spine\" missing required attribute \"toc\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 11,
"column" : 10,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub3_expected_results.json
index 51873da..2d9c5b0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_NCX_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -156,7 +156,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Missing_NCX_epub3.epub",
+ "path" : "Missing_NCX_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -177,10 +177,10 @@
}, {
"ID" : "NCX-003",
"severity" : "USAGE",
- "message" : "An .NCX file is required for TOC navigation on ePub v2 readers.",
+ "message" : "An .NCX file is required for TOC navigation on EPUB v2 readers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub2_expected_results.json
index 07199c6..df7f0b5 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "toc attribute was not found on the spine element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Spine tag was not found in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -180,7 +180,7 @@
"message" : "Error while parsing file 'element \"package\" incomplete; missing required element \"spine\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 12,
"column" : 11,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.json
index f73e66a..0c943a4 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.json
@@ -7,8 +7,8 @@
"checkDate" : "09-05-2014 03:15:41",
"elapsedTime" : 284,
"nFatal" : 1,
- "nError" : 1,
- "nWarning" : 1,
+ "nError" : 2,
+ "nWarning" : 0,
"nUsage" : 3
},
"publication" : {
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Missing_Spine_epub3.epub",
+ "path" : "Missing_Spine_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -177,10 +177,10 @@
}, {
"ID" : "NCX-003",
"severity" : "USAGE",
- "message" : "An .NCX file is required for TOC navigation on ePub v2 readers.",
+ "message" : "An .NCX file is required for TOC navigation on EPUB v2 readers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -192,7 +192,7 @@
"message" : "Spine tag was not found in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -204,7 +204,7 @@
"message" : "Error while parsing file 'element \"package\" incomplete; missing required element \"spine\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 13,
"column" : 11,
"context" : null
@@ -212,11 +212,11 @@
"suggestion" : null
}, {
"ID" : "RSC-011",
- "severity" : "WARNING",
+ "severity" : "ERROR",
"message" : "Found a reference to a resource that is not a spine item.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : 11,
"column" : 36,
"context" : "OPS/page01.xhtml"
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.xml
index 8fe294c..21c31d0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_Spine_epub3_expected_results.xml
@@ -5,12 +5,12 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2012-10-10T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Not well-formed</status>
<messages>
<message>OPF-019, FATAL, [Spine tag was not found in the OPF file.], OPS/content.opf</message>
<message>RSC-005, ERROR, [Error while parsing file 'element "package" incomplete; missing required element "spine"'.], OPS/content.opf (13-11)</message>
- <message>RSC-011, WARN, [Found a reference to a resource that is not a spine item.], OPS/toc.xhtml (11-36)</message>
+ <message>RSC-011, ERROR, [Found a reference to a resource that is not a spine item.], OPS/toc.xhtml (11-36)</message>
<message>ACC-008, HINT, [Navigation Document has no 'landmarks nav' element.], Missing_Spine_epub3.epub</message>
<message>ACC-007, HINT, [Content Documents do not use 'epub:type' attributes for semantic inflection.], OPS/page01.xhtml</message>
</messages>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub2_expected_results.json
index 24bda8f..abdefc3 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -168,7 +168,7 @@
"message" : "The unique-identifier 'BOGUS' was not found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -180,7 +180,7 @@
"message" : "Role value 'companion' is not valid.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 4,
"column" : 52,
"context" : null
@@ -192,7 +192,7 @@
"message" : "Error while parsing file 'element \"metadata\" incomplete; missing required elements \"dc:identifier\", \"dc:language\" and \"dc:title\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 5,
"column" : 14,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub3_expected_results.json
index 9a08eb7..7afac73 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_metadata_epub3_expected_results.json
@@ -3,9 +3,9 @@
"checker" : {
"path" : "./com/adobe/epubcheck/test/opf/Missing_metadata_epub3.epub",
"filename" : "Missing_metadata_epub3.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:44",
- "elapsedTime" : 181,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "05-30-2015 00:41:52",
+ "elapsedTime" : 77,
"nFatal" : 0,
"nError" : 3,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Missing_metadata_epub3.epub",
+ "path" : "Missing_metadata_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -214,7 +214,7 @@
"message" : "The unique-identifier 'BOGUS' was not found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -223,24 +223,24 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n package element unique-identifier attribute does not resolve to a dc:identifier element (given reference was 'BOGUS')'.",
+ "message" : "Error while parsing file 'element \"manifest\" not allowed yet; missing required element \"metadata\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
- "line" : 2,
- "column" : 87,
+ "path" : "OPS/content.opf",
+ "line" : 3,
+ "column" : 13,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"manifest\" not allowed yet; missing required element \"metadata\"'.",
+ "message" : "Error while parsing file 'package element unique-identifier attribute does not resolve to a dc:identifier element (given reference was 'BOGUS')'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
- "line" : 3,
- "column" : 13,
+ "path" : "OPS/content.opf",
+ "line" : 2,
+ "column" : 87,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_unique_id_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_unique_id_expected_results.json
index 2a6d1b8..174c1d7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Missing_unique_id_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Missing_unique_id_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Missing_unique_id.epub",
+ "path" : "Missing_unique_id.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -214,7 +214,7 @@
"message" : "The unique-identifier 'null' was not found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -226,7 +226,7 @@
"message" : "Package tag is missing its required unique-identifier attribute and value.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 2,
"column" : 61,
"context" : null
@@ -238,7 +238,7 @@
"message" : "Error while parsing file 'element \"package\" missing required attribute \"unique-identifier\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 2,
"column" : 61,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Properties_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Properties_expected_results.json
index a0b9587..15a3884 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Properties_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Properties_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -244,22 +244,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page03.xhtml",
+ "path" : "OPS/page03.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page04.xhtml",
+ "path" : "OPS/page04.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -271,7 +271,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Properties.epub",
+ "path" : "Properties.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -283,7 +283,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -295,12 +295,12 @@
"message" : "SVG elements should include an xml:lang and lang attributes.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page03.xhtml",
+ "path" : "OPS/page03.xhtml",
"line" : 15,
"column" : 67,
"context" : "svg"
}, {
- "fileName" : "OPS/page04.xhtml",
+ "path" : "OPS/page04.xhtml",
"line" : 15,
"column" : 67,
"context" : "svg"
@@ -312,7 +312,7 @@
"message" : "Item property 'cover-image' is not defined for media type 'application/xhtml+xml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 11,
"column" : 105,
"context" : null
@@ -324,9 +324,9 @@
"message" : "The property 'svg' should be declared in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page04.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/page04.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -336,9 +336,9 @@
"message" : "The property 'switch' should be declared in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page04.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/page04.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -348,9 +348,9 @@
"message" : "The property 'svg' should not be declared in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page02.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/page02.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -360,7 +360,7 @@
"message" : "Found malformed property value: 'scripted:'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 14,
"column" : 103,
"context" : null
@@ -372,7 +372,7 @@
"message" : "Undefined property: 'hello'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 12,
"column" : 103,
"context" : null
@@ -384,17 +384,17 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page03.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page04.xhtml"
@@ -403,24 +403,24 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page03.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page04.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.json
index 3e895ef..b2fe69e 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -82,7 +82,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ ]
+ "referencedItems" : [ "http://example.org/book-info/", "http://example.org/xmp/", "wakawaka://example.org/book-info/" ]
}, {
"id" : "ePubCheck.NoManifestRef:mimetype",
"fileName" : "mimetype",
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "Publication_Metadata_epub3.epub",
+ "path" : "Publication_Metadata_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.xml
index 2218a83..a68c6c8 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/Publication_Metadata_epub3_expected_results.xml
@@ -5,7 +5,7 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2013-01-30T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Well-formed</status>
<messages>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS/toc.ncx (2-68)</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/oebps12_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/oebps12_expected_results.json
index 51b6a64..c074da0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/oebps12_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/oebps12_expected_results.json
@@ -7,7 +7,7 @@
"checkDate" : "09-05-2014 03:15:49",
"elapsedTime" : 3614,
"nFatal" : 1,
- "nError" : 3,
+ "nError" : 2,
"nWarning" : 2,
"nUsage" : 3
},
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -200,12 +200,12 @@
"message" : "Namespace uri 'http://openebook.org/namespaces/oeb-package/1.0/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 2,
"column" : 115,
"context" : ""
}, {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 4,
"column" : 128,
"context" : "oebpackage"
@@ -214,10 +214,10 @@
}, {
"ID" : "NCX-003",
"severity" : "USAGE",
- "message" : "An .NCX file is required for TOC navigation on ePub v2 readers.",
+ "message" : "An .NCX file is required for TOC navigation on EPUB v2 readers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -229,19 +229,7 @@
"message" : "Spine tag was not found in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
- "line" : -1,
- "column" : -1,
- "context" : null
- } ],
- "suggestion" : null
- }, {
- "ID" : "OPF-024",
- "severity" : "ERROR",
- "message" : "Found unknown ePub version 0.0.",
- "additionalLocations" : 0,
- "locations" : [ {
- "fileName" : "oebps12.epub",
+ "path" : "oebps12.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -253,7 +241,7 @@
"message" : "The unique-identifier 'OverDriveGUID' was not found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -265,7 +253,7 @@
"message" : "Media type 'text/html' is not appropriate for an OEBPS 1.2 context; Use 'text/x-oeb1-document' instead.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 14,
"column" : 65,
"context" : "page02"
@@ -277,7 +265,7 @@
"message" : "Media-type 'text/css' is not appropriate in an OEBPS 1.2 context. Use 'text/x-oeb1-css' instead.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 16,
"column" : 63,
"context" : "style2"
@@ -289,7 +277,7 @@
"message" : "OPF file is using OEBPS 1.2 syntax allowing backwards compatibility.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 2,
"column" : 115,
"context" : null
@@ -301,7 +289,7 @@
"message" : "Error while parsing file 'attribute \"version\" not allowed here; expected attribute \"id\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "oebps12.opf",
+ "path" : "oebps12.opf",
"line" : 2,
"column" : 115,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/rendition_valid_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/rendition_valid_expected_results.json
index 41b5a56..bd36400 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/rendition_valid_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/rendition_valid_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "pre-paginated",
"renditionOrientation" : "landscape",
"renditionSpread" : "landscape",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : true,
"isBackwardCompatible" : false,
@@ -118,7 +118,7 @@
"isLinear" : false,
"navigationOrder" : null,
"isHTML5" : false,
- "isFixedFormat" : null,
+ "isFixedFormat" : true,
"isScripted" : false,
"scriptSrc" : false,
"scriptTag" : false,
@@ -206,7 +206,7 @@
"isLinear" : false,
"navigationOrder" : null,
"isHTML5" : true,
- "isFixedFormat" : null,
+ "isFixedFormat" : true,
"isScripted" : false,
"scriptSrc" : false,
"scriptTag" : false,
@@ -222,17 +222,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page03.xhtml",
+ "path" : "OPS/page03.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -244,7 +244,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "rendition_valid.epub",
+ "path" : "rendition_valid.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -256,7 +256,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -268,12 +268,12 @@
"message" : "Fixed format item has no viewport defined.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : 5,
"column" : 8,
"context" : null
}, {
- "fileName" : "OPS/page03.xhtml",
+ "path" : "OPS/page03.xhtml",
"line" : 5,
"column" : 8,
"context" : null
@@ -285,12 +285,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page03.xhtml"
@@ -299,19 +299,19 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page03.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/viewport2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/viewport2_expected_results.json
index bdb3755..69729b7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/viewport2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/viewport2_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/opf/viewport2.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/opf/viewport2.epub",
"filename" : "viewport2.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:43",
- "elapsedTime" : 244,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:19:17",
+ "elapsedTime" : 90,
"nFatal" : 0,
"nError" : 2,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : true,
"isBackwardCompatible" : false,
@@ -126,7 +126,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/toc.xhtml", "OPS/page003.xhtml", "OPS/page001.xhtml", "OPS/page004.xhtml", "OPS/page002.xhtml" ]
+ "referencedItems" : [ "OPS/page001.xhtml", "OPS/page002.xhtml", "OPS/page003.xhtml", "OPS/page004.xhtml", "OPS/toc.xhtml" ]
}, {
"id" : "page001",
"fileName" : "OPS/page001.xhtml",
@@ -236,7 +236,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/page003.xhtml", "OPS/page001.xhtml", "OPS/page004.xhtml", "OPS/page002.xhtml" ]
+ "referencedItems" : [ "OPS/page001.xhtml", "OPS/page002.xhtml", "OPS/page003.xhtml", "OPS/page004.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -244,22 +244,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -271,7 +271,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "viewport2.epub",
+ "path" : "viewport2.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -283,7 +283,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -295,7 +295,7 @@
"message" : "Fixed format item has no viewport defined.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : 5,
"column" : 8,
"context" : null
@@ -307,7 +307,7 @@
"message" : "Html viewport is missing height and/or width.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : 5,
"column" : 49,
"context" : "meta"
diff --git a/src/test/resources/com/adobe/epubcheck/test/opf/viewport_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/opf/viewport_expected_results.json
index 29f2fde..95158ec 100644
--- a/src/test/resources/com/adobe/epubcheck/test/opf/viewport_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/opf/viewport_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/opf/viewport.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/opf/viewport.epub",
"filename" : "viewport.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:43",
- "elapsedTime" : 295,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 00:26:05",
+ "elapsedTime" : 2259,
"nFatal" : 0,
"nError" : 3,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "pre-paginated",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : true,
"isBackwardCompatible" : false,
@@ -118,7 +118,7 @@
"isLinear" : false,
"navigationOrder" : null,
"isHTML5" : false,
- "isFixedFormat" : null,
+ "isFixedFormat" : true,
"isScripted" : false,
"scriptSrc" : false,
"scriptTag" : false,
@@ -126,7 +126,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/page008.svg", "OPS/toc.xhtml", "OPS/page003.xhtml", "OPS/page005.svg", "OPS/page007.svg", "OPS/page001.xhtml", "OPS/page004.xhtml", "OPS/page002.xhtml", "OPS/page006.svg" ]
+ "referencedItems" : [ "OPS/page001.xhtml", "OPS/page002.xhtml", "OPS/page003.xhtml", "OPS/page004.xhtml", "OPS/page005.svg", "OPS/page006.svg", "OPS/page007.svg", "OPS/page008.svg", "OPS/toc.xhtml" ]
}, {
"id" : "page001",
"fileName" : "OPS/page001.xhtml",
@@ -346,7 +346,7 @@
"renditionLayout" : "pre-paginated",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/page008.svg", "OPS/page003.xhtml", "OPS/page005.svg", "OPS/page007.svg", "OPS/page001.xhtml", "OPS/page005.xhtml", "OPS/page004.xhtml", "OPS/page002.xhtml", "OPS/page006.svg" ]
+ "referencedItems" : [ "OPS/page001.xhtml", "OPS/page002.xhtml", "OPS/page003.xhtml", "OPS/page004.xhtml", "OPS/page005.svg", "OPS/page005.xhtml", "OPS/page006.svg", "OPS/page007.svg", "OPS/page008.svg" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -354,47 +354,47 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page001.xhtml",
+ "path" : "OPS/page001.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page005.svg",
+ "path" : "OPS/page005.svg",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page005.xhtml",
+ "path" : "OPS/page005.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page006.svg",
+ "path" : "OPS/page006.svg",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page007.svg",
+ "path" : "OPS/page007.svg",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page008.svg",
+ "path" : "OPS/page008.svg",
"line" : -1,
"column" : -1,
"context" : null
@@ -406,7 +406,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "viewport.epub",
+ "path" : "viewport.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -418,7 +418,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -430,22 +430,22 @@
"message" : "Namespace uri 'http://www.w3.org/2000/svg' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page005.svg",
+ "path" : "OPS/page005.svg",
"line" : 2,
"column" : 67,
"context" : ""
}, {
- "fileName" : "OPS/page006.svg",
+ "path" : "OPS/page006.svg",
"line" : 2,
"column" : 67,
"context" : ""
}, {
- "fileName" : "OPS/page007.svg",
+ "path" : "OPS/page007.svg",
"line" : 2,
"column" : 67,
"context" : ""
}, {
- "fileName" : "OPS/page008.svg",
+ "path" : "OPS/page008.svg",
"line" : 2,
"column" : 67,
"context" : ""
@@ -457,17 +457,17 @@
"message" : "Html viewport is missing height and/or width.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page002.xhtml",
+ "path" : "OPS/page002.xhtml",
"line" : 5,
"column" : 46,
"context" : "meta"
}, {
- "fileName" : "OPS/page003.xhtml",
+ "path" : "OPS/page003.xhtml",
"line" : 5,
"column" : 49,
"context" : "meta"
}, {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : 5,
"column" : 29,
"context" : "meta"
@@ -479,22 +479,22 @@
"message" : "SVG ViewBox is missing on fixed format document.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page005.svg",
+ "path" : "OPS/page005.svg",
"line" : 2,
"column" : 67,
"context" : null
}, {
- "fileName" : "OPS/page006.svg",
+ "path" : "OPS/page006.svg",
"line" : 2,
"column" : 67,
"context" : null
}, {
- "fileName" : "OPS/page007.svg",
+ "path" : "OPS/page007.svg",
"line" : 2,
"column" : 67,
"context" : null
}, {
- "fileName" : "OPS/page008.svg",
+ "path" : "OPS/page008.svg",
"line" : 2,
"column" : 67,
"context" : null
@@ -503,22 +503,22 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page005.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file 'element \"meta\" missing required attribute \"content\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page004.xhtml",
+ "path" : "OPS/page004.xhtml",
"line" : 5,
"column" : 29,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/corrupt_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/corrupt_file_expected_results.json
index 249a328..fce9a32 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/corrupt_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/corrupt_file_expected_results.json
@@ -46,9 +46,9 @@
"message" : "Unable to read file 'error in opening zip file'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "corrupt_file.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "corrupt_file.epub",
+ "line" : -1,
+ "column" : -1,
"context" : ""
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/empty_archive_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/empty_archive_expected_results.json
index 9235125..3994419 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/empty_archive_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/empty_archive_expected_results.json
@@ -34,11 +34,11 @@
"messages" : [ {
"ID" : "PKG-003",
"severity" : "ERROR",
- "message" : "Unable to read ePub file header. This is likely a corrupted ePub file.",
+ "message" : "Unable to read EPUB file header. This is likely a corrupted EPUB file.",
"locations" : [ {
- "fileName" : "empty_archive.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_archive.epub",
+ "line" : -1,
+ "column" : -1,
"context" : ""
} ],
"suggestion" : null
@@ -47,11 +47,11 @@
"severity" : "ERROR",
"message" : "Unable to read file 'error in opening zip file'.",
"locations" : [ {
- "fileName" : "empty_archive.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_archive.epub",
+ "line" : -1,
+ "column" : -1,
"context" : ""
} ],
"suggestion" : null
} ]
-}
\ No newline at end of file
+}
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/empty_dir_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/empty_dir_expected_results.json
index d70914d..6894601 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/empty_dir_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/empty_dir_expected_results.json
@@ -46,19 +46,19 @@
"message" : "Mimetype file entry is missing or is not the first file in the archive.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_dir.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_dir.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'META-INF/container.xml' is not found.",
+ "message" : "File 'META-INF/container.xml' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_dir.epub",
+ "path" : "empty_dir.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -67,12 +67,12 @@
}, {
"ID" : "RSC-002",
"severity" : "FATAL",
- "message" : "Required META-INF/container.xml resource is not found.",
+ "message" : "Required META-INF/container.xml resource could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_dir.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_dir.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/empty_mimetype_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/empty_mimetype_expected_results.json
index a80dd3f..57ebb83 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/empty_mimetype_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/empty_mimetype_expected_results.json
@@ -46,19 +46,19 @@
"message" : "Mimetype file entry is missing or is not the first file in the archive.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_mimetype.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_mimetype.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'META-INF/container.xml' is not found.",
+ "message" : "File 'META-INF/container.xml' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_mimetype.epub",
+ "path" : "empty_mimetype.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -67,12 +67,12 @@
}, {
"ID" : "RSC-002",
"severity" : "FATAL",
- "message" : "Required META-INF/container.xml resource is not found.",
+ "message" : "Required META-INF/container.xml resource could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "empty_mimetype.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "empty_mimetype.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/image_types_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/image_types_expected_results.json
index 3c44aa7..cce696a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/image_types_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/image_types_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/package/image_types.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/package/image_types.epub",
"filename" : "image_types.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:56",
- "elapsedTime" : 1119,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:21",
+ "elapsedTime" : 653,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 1,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -258,7 +258,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/images/PrincessBrideReunion.png", "OPS/images/BigRed.png", "OPS/images/kitty.jpeg", "OPS/images/PlaceHolder.gif", "OPS/images/PlaceHolder.png" ]
+ "referencedItems" : [ "OPS/images/BigRed.png", "OPS/images/PlaceHolder.gif", "OPS/images/PlaceHolder.png", "OPS/images/PrincessBrideReunion.png", "OPS/images/kitty.jpeg" ]
}, {
"id" : "toc",
"fileName" : "OPS/toc.xhtml",
@@ -288,7 +288,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -300,7 +300,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "image_types.epub",
+ "path" : "image_types.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -312,7 +312,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -324,10 +324,10 @@
"message" : "Wrong file extension for image. The image is a 'gif' file but has the file extension 'png'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/images/PlaceHolder.png",
+ "path" : "OPS/images/PlaceHolder.png",
"line" : -1,
"column" : -1,
- "context" : "OPS/images/PlaceHolder.png"
+ "context" : null
} ],
"suggestion" : null
} ]
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2/OPS Content/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2/OPS Content/toc.ncx
index 87bf517..7aea37d 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2/OPS Content/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2/OPS Content/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.json
index f3f6b51..7e43c25 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS Content/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 339,
- "uncompressedSize" : 757,
+ "compressedSize" : 342,
+ "uncompressedSize" : 775,
"compressionMethod" : "Deflated",
- "checkSum" : "328212a6ce1e1d417835e676df7cd524fdcf31f4b4bb23f6ca8936322ae2054",
+ "checkSum" : "1beb9a26b136bccbaac96319c2ef752c9307c41845b488218424a3267d2dd",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -178,7 +178,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/toc.ncx",
+ "path" : "OPS Content/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -190,24 +190,24 @@
"message" : "Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/More XHTML Content/page01.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/More XHTML Content/page01.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/content.opf",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/content.opf",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/toc.ncx",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/toc.ncx",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "XHTML Content/page02.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "XHTML Content/page02.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.xml
index e413a7b..ac8d1b8 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub2_expected_results.xml
@@ -4,7 +4,7 @@
<repInfo uri="interesting_paths_epub2.epub">
<created>2014-09-05T01:49:14Z</created>
<format>application/epub+zip</format>
- <version>2.0</version>
+ <version>2.0.1</version>
<status>Well-formed</status>
<messages>
<message>PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/More XHTML Content/page01.xhtml</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json
index d4c77b8..e7cbdc3 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -288,17 +288,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/More XHTML Content/page01.xhtml",
+ "path" : "OPS Content/More XHTML Content/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/page{03}.xhtml",
+ "path" : "OPS Content/page{03}.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "XHTML Content/page 02.xhtml",
+ "path" : "XHTML Content/page 02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -310,7 +310,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "interesting_paths_epub3.epub",
+ "path" : "interesting_paths_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -322,7 +322,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/toc.ncx",
+ "path" : "OPS Content/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -334,7 +334,7 @@
"message" : "XHTML Content Document file name 'OPS Content/Cyrillic_phi.html' should have the extension '.xhtml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/content.opf",
+ "path" : "OPS Content/content.opf",
"line" : 14,
"column" : 86,
"context" : null
@@ -343,10 +343,10 @@
}, {
"ID" : "OPF-003",
"severity" : "WARNING",
- "message" : "Item 'OPS Content/Cyrillic_phi.xhtml' exists in the ePub, but is not declared in the OPF manifest.",
+ "message" : "Item 'OPS Content/Cyrillic_phi.xhtml' exists in the EPUB, but is not declared in the OPF manifest.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "interesting_paths_epub3.epub",
+ "path" : "interesting_paths_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -358,12 +358,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/toc.xhtml",
+ "path" : "OPS Content/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS Content/Cyrillic_phi.html"
}, {
- "fileName" : "OPS Content/toc.xhtml",
+ "path" : "OPS Content/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS Content/page{03}.xhtml"
@@ -372,29 +372,29 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/toc.ncx",
+ "path" : "OPS Content/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS Content/Cyrillic_phi.html"
}, {
- "fileName" : "OPS Content/toc.ncx",
+ "path" : "OPS Content/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS Content/page{03}.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "PKG-009",
"severity" : "ERROR",
"message" : "File name contains characters that are not allowed in OCF file names: '\"{\",\"}\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/page{03}.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/page{03}.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -404,49 +404,49 @@
"message" : "Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/Cyrillic_phi.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/Cyrillic_phi.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/More XHTML Content/page01.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/More XHTML Content/page01.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/content.opf",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/content.opf",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/page{03}.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/page{03}.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/toc.ncx",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/toc.ncx",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS Content/toc.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS Content/toc.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "XHTML Content/page 02.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "XHTML Content/page 02.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'OPS Content/Cyrillic_phi.html' is not found.",
+ "message" : "File 'OPS Content/Cyrillic_phi.html' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "interesting_paths_epub3.epub",
+ "path" : "interesting_paths_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -455,10 +455,10 @@
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'OPS Content/style.' is not found.",
+ "message" : "File 'OPS Content/style.' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "interesting_paths_epub3.epub",
+ "path" : "interesting_paths_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -467,10 +467,10 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
- "message" : "Referenced resource is not found in the ePub.",
+ "message" : "Referenced resource could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS Content/More XHTML Content/page01.xhtml",
+ "path" : "OPS Content/More XHTML Content/page01.xhtml",
"line" : 13,
"column" : 35,
"context" : "OPS Content/Cyrillic_\u0424.xhtml"
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml
index bb609e3..8879641 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml
+++ b/src/test/resources/com/adobe/epubcheck/test/package/interesting_paths_epub3_expected_results.xml
@@ -5,12 +5,12 @@
<created>2014-09-05T01:49:14Z</created>
<lastModified>2012-10-10T12:00:00Z</lastModified>
<format>application/epub+zip</format>
- <version>3.0</version>
+ <version>3.0.1</version>
<status>Not well-formed</status>
<messages>
- <message>RSC-001, ERROR, [File 'OPS Content/Cyrillic_phi.html' is not found.], interesting_paths_epub3.epub</message>
- <message>RSC-001, ERROR, [File 'OPS Content/style.' is not found.], interesting_paths_epub3.epub</message>
- <message>RSC-007, ERROR, [Referenced resource is not found in the ePub.], OPS Content/More XHTML Content/page01.xhtml (13-35)</message>
+ <message>RSC-001, ERROR, [File 'OPS Content/Cyrillic_phi.html' could not be found.], interesting_paths_epub3.epub</message>
+ <message>RSC-001, ERROR, [File 'OPS Content/style.' could not be found.], interesting_paths_epub3.epub</message>
+ <message>RSC-007, ERROR, [Referenced resource could not be found in the EPUB.], OPS Content/More XHTML Content/page01.xhtml (13-35)</message>
<message>PKG-009, ERROR, [File name contains characters that are not allowed in OCF file names: '"{","}"'.], OPS Content/page{03}.xhtml</message>
<message>HTM-014a, WARN, [XHTML Content Document file name 'OPS Content/Cyrillic_phi.html' should have the extension '.xhtml'.], OPS Content/content.opf (14-86)</message>
<message>PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/More XHTML Content/page01.xhtml</message>
@@ -20,12 +20,12 @@
<message>PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/content.opf</message>
<message>PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], XHTML Content/page 02.xhtml</message>
<message>PKG-010, WARN, [Filename contains spaces, therefore URI escaping is necessary. Consider removing spaces from filename.], OPS Content/toc.ncx</message>
- <message>OPF-003, WARN, [Item 'OPS Content/Cyrillic_phi.xhtml' exists in the ePub, but is not declared in the OPF manifest.], interesting_paths_epub3.epub</message>
+ <message>OPF-003, WARN, [Item 'OPS Content/Cyrillic_phi.xhtml' exists in the EPUB, but is not declared in the OPF manifest.], interesting_paths_epub3.epub</message>
<message>OPF-058, HINT, [Spine item has no TOC entry reference.], OPS Content/toc.xhtml</message>
<message>OPF-058, HINT, [Spine item has no TOC entry reference.], OPS Content/toc.xhtml</message>
<message>HTM-010, HINT, [Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.], OPS Content/toc.ncx (2-68)</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS Content/toc.ncx</message>
- <message>OPF-059, HINT, [Spine item has no NAV entry reference.], OPS Content/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS Content/toc.ncx</message>
+ <message>OPF-059, HINT, [Spine item has no NCX entry reference.], OPS Content/toc.ncx</message>
<message>ACC-008, HINT, [Navigation Document has no 'landmarks nav' element.], interesting_paths_epub3.epub</message>
<message>ACC-007, HINT, [Content Documents do not use 'epub:type' attributes for semantic inflection.], OPS Content/More XHTML Content/page01.xhtml</message>
<message>ACC-007, HINT, [Content Documents do not use 'epub:type' attributes for semantic inflection.], XHTML Content/page 02.xhtml</message>
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub2_expected_results.json
index f63e0ef..f3a6584 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub2_expected_results.json
@@ -43,10 +43,10 @@
"messages" : [ {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'META-INF/container.xml' is not found.",
+ "message" : "File 'META-INF/container.xml' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_container_file_epub2.epub",
+ "path" : "missing_container_file_epub2.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -55,12 +55,12 @@
}, {
"ID" : "RSC-002",
"severity" : "FATAL",
- "message" : "Required META-INF/container.xml resource is not found.",
+ "message" : "Required META-INF/container.xml resource could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_container_file_epub2.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "missing_container_file_epub2.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub3_expected_results.json
index 75dbc83..81427cd 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_container_file_epub3_expected_results.json
@@ -43,10 +43,10 @@
"messages" : [ {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'META-INF/container.xml' is not found.",
+ "message" : "File 'META-INF/container.xml' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_container_file_epub3.epub",
+ "path" : "missing_container_file_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -55,12 +55,12 @@
}, {
"ID" : "RSC-002",
"severity" : "FATAL",
- "message" : "Required META-INF/container.xml resource is not found.",
+ "message" : "Required META-INF/container.xml resource could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_container_file_epub3.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "missing_container_file_epub3.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_file_expected_results.json
index bbb393e..86d4817 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_file_expected_results.json
@@ -43,10 +43,10 @@
"messages" : [ {
"ID" : "PKG-018",
"severity" : "FATAL",
- "message" : "The ePub file is not found.",
+ "message" : "The EPUB file could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "no_existence.epub",
+ "path" : "no_existence.epub",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2/OPS/toc.ncx
index 0587ac1..9e8b988 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2_expected_results.json
index fb398ca..cbc7411 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -87,10 +87,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 293,
- "uncompressedSize" : 556,
+ "compressedSize" : 295,
+ "uncompressedSize" : 574,
"compressionMethod" : "Deflated",
- "checkSum" : "7e983f3695b1eea13cb6d3e7aacb5d84de767f2ccda456f5154d35c5f9b012",
+ "checkSum" : "708b669acb4e2fb5cae45961dde9f2abb3e2d9b793d4fb4603c38a51fe29b52",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -134,7 +134,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -146,9 +146,9 @@
"message" : "Mimetype file entry is missing or is not the first file in the archive.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_mimetype_file_epub2.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "missing_mimetype_file_epub2.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub3_expected_results.json
index 96f2606..b30d0ee 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_mimetype_file_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -156,7 +156,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -168,7 +168,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_mimetype_file_epub3.epub",
+ "path" : "missing_mimetype_file_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -180,7 +180,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -192,9 +192,9 @@
"message" : "Mimetype file entry is missing or is not the first file in the archive.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_mimetype_file_epub3.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "missing_mimetype_file_epub3.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_ncx_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_ncx_file_expected_results.json
index 9a28b52..cf9eaca 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_ncx_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_ncx_file_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"messages" : [ {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'OPS/toc.ncx' is not found.",
+ "message" : "File 'OPS/toc.ncx' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_ncx_file.epub",
+ "path" : "missing_ncx_file.epub",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_epub_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_epub_file_expected_results.json
index 0214e04..306368a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_epub_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_epub_file_expected_results.json
@@ -43,12 +43,12 @@
"messages" : [ {
"ID" : "PKG-020",
"severity" : "ERROR",
- "message" : "OPF file 'test_single_opf' is not found.",
+ "message" : "OPF file 'test_single_opf' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_opf_file",
- "line" : 0,
- "column" : 0,
+ "path" : "missing_opf_file",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_file_expected_results.json
index d622a01..6c07975 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_opf_file_expected_results.json
@@ -112,7 +112,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_opf_file.epub",
+ "path" : "missing_opf_file.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -124,7 +124,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -133,10 +133,10 @@
}, {
"ID" : "OPF-002",
"severity" : "FATAL",
- "message" : "The OPF file 'OPS/missing.opf' was not found in the ePub.",
+ "message" : "The OPF file 'OPS/missing.opf' was not found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "META-INF/container.xml",
+ "path" : "META-INF/container.xml",
"line" : -1,
"column" : -1,
"context" : null
@@ -145,10 +145,10 @@
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'OPS/missing.opf' is not found.",
+ "message" : "File 'OPS/missing.opf' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_opf_file.epub",
+ "path" : "missing_opf_file.epub",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/missing_toc_file_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/missing_toc_file_expected_results.json
index 1dcafc3..b4c17b6 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/missing_toc_file_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/missing_toc_file_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_toc_file.epub",
+ "path" : "missing_toc_file.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -211,10 +211,10 @@
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'OPS/toc.xhtml' is not found.",
+ "message" : "File 'OPS/toc.xhtml' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_toc_file.epub",
+ "path" : "missing_toc_file.epub",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/path_resolution/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/package/path_resolution/OPS/toc.ncx
index 4df2fce..ba00f12 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/path_resolution/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/package/path_resolution/OPS/toc.ncx
@@ -1,6 +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">
-<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/">
+<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
<meta name="dtb:uid" content=""/>
<meta name="dtb:depth" content="1"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/path_resolution_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/path_resolution_expected_results.json
index f682c7a..86503b0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/path_resolution_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/path_resolution_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/package/path_resolution.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/package/path_resolution.epub",
"filename" : "path_resolution.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:57",
- "elapsedTime" : 321,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:19:29",
+ "elapsedTime" : 196,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -263,10 +263,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 332,
- "uncompressedSize" : 647,
+ "compressedSize" : 290,
+ "uncompressedSize" : 563,
"compressionMethod" : "Deflated",
- "checkSum" : "d0b7eecbe9951345b188736dd9217babe4eb6f98bcf236dc9d792a456f972f0",
+ "checkSum" : "f96c13f3367658be485889a1bfe4db697617a3376a64f5e5e581d6065836eb6",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -324,7 +324,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "A.xhtml", "OPS/MathML1.xhtml", "OPS/Description.xhtml", "MathML2.xhtml" ]
+ "referencedItems" : [ "A.xhtml", "MathML2.xhtml", "OPS/Description.xhtml", "OPS/MathML1.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -332,22 +332,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "A.xhtml",
+ "path" : "A.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "MathML2.xhtml",
+ "path" : "MathML2.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/Description.xhtml",
+ "path" : "OPS/Description.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/MathML1.xhtml",
+ "path" : "OPS/MathML1.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -359,7 +359,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "path_resolution.epub",
+ "path" : "path_resolution.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -371,43 +371,43 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
- "line" : 3,
- "column" : 51,
+ "path" : "OPS/toc.ncx",
+ "line" : 2,
+ "column" : 68,
"context" : ""
} ],
"suggestion" : null
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/A.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/MathML2.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/OPS/Description.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/OPS/MathML1.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/OPS/toc.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/wrong_extension_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/wrong_extension_expected_results.json
index 2b3bbc5..d638122 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/wrong_extension_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/wrong_extension_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/package/wrong_extension.zip",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/package/wrong_extension.zip",
"filename" : "wrong_extension.zip",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:15:58",
- "elapsedTime" : 46,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:19:29",
+ "elapsedTime" : 21,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 2,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -148,7 +148,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/LinkTarget1.xhtml", "OPS/images/ColorStripes.png", "OPS/LinkTarget2.xhtml" ]
+ "referencedItems" : [ "OPS/LinkTarget1.xhtml", "OPS/LinkTarget2.xhtml", "OPS/images/ColorStripes.png" ]
}, {
"id" : "pg02",
"fileName" : "OPS/FillerPage.xhtml",
@@ -241,25 +241,25 @@
"messages" : [ {
"ID" : "HTM-016",
"severity" : "WARNING",
- "message" : "HTML5 DOCTYPE definition within ePub v2.",
+ "message" : "HTML5 DOCTYPE definition within EPUB v2.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "FillerPage.xhtml",
+ "path" : "FillerPage.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "LinkTarget1.xhtml",
+ "path" : "LinkTarget1.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "LinkTarget2.xhtml",
+ "path" : "LinkTarget2.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "Test1.xhtml",
+ "path" : "Test1.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -268,10 +268,10 @@
}, {
"ID" : "PKG-017",
"severity" : "WARNING",
- "message" : "Uncommon ePub file extension.",
+ "message" : "Uncommon EPUB file extension.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "wrong_extension.zip",
+ "path" : "wrong_extension.zip",
"line" : -1,
"column" : -1,
"context" : "zip"
diff --git a/src/test/resources/com/adobe/epubcheck/test/package/wrong_type_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/package/wrong_type_expected_results.json
index d9f6686..46eee6d 100644
--- a/src/test/resources/com/adobe/epubcheck/test/package/wrong_type_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/package/wrong_type_expected_results.json
@@ -43,12 +43,12 @@
"messages" : [ {
"ID" : "PKG-004",
"severity" : "FATAL",
- "message" : "Corrupted ePub ZIP header.",
+ "message" : "Corrupted EPUB ZIP header.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "PlaceHolder.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "PlaceHolder.epub",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -58,9 +58,9 @@
"message" : "Unable to read file 'error in opening zip file'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "PlaceHolder.epub",
- "line" : 0,
- "column" : 0,
+ "path" : "PlaceHolder.epub",
+ "line" : -1,
+ "column" : -1,
"context" : ""
} ],
"suggestion" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/XMLHttpRequest_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/XMLHttpRequest_expected_results.json
index ce697cc..3d123ae 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/XMLHttpRequest_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/XMLHttpRequest_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -266,17 +266,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -288,7 +288,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "XMLHttpRequest.epub",
+ "path" : "XMLHttpRequest.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -300,7 +300,7 @@
"message" : "An XHTML Named Entity was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 24,
"column" : 25,
"context" : "url = url + \"&sid=\" + Math.ra"
@@ -312,7 +312,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -324,7 +324,7 @@
"message" : "Input html elements should include an id.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 65,
"context" : null
@@ -336,7 +336,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
@@ -345,37 +345,37 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "SCP-002",
"severity" : "USAGE",
- "message" : "Use of XMLHttpRequest in ePub scripts is a security risk.",
+ "message" : "Use of XMLHttpRequest in EPUB scripts is a security risk.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 2,
"column" : 17,
"context" : "new XMLHttpRequest();"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 17,
"column" : 48,
"context" : "new XMLHttpRequest();"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 21,
"column" : 66,
"context" : "Microsoft.XMLHTTP\");"
@@ -387,7 +387,7 @@
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 65,
"context" : "onclick"
@@ -399,7 +399,7 @@
"message" : "Script references 'innerHtml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 9,
"column" : 24,
"context" : "innerHTML = \"\";"
@@ -411,7 +411,7 @@
"message" : "Script references 'innerText'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 27,
"column" : 84,
"context" : "innerText = xmlHttp.responseText;"
@@ -423,7 +423,7 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 65,
"context" : "onclick"
@@ -435,22 +435,22 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2/OPS/toc.ncx
index 2ee6dd8..cd951d6 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.json
index 466670c..fb49bc0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 305,
- "uncompressedSize" : 571,
+ "compressedSize" : 306,
+ "uncompressedSize" : 589,
"compressionMethod" : "Deflated",
- "checkSum" : "c76f5a179935fd9f51862eebaa83028ec30aad3213ff467dc55eacc2ff41d44",
+ "checkSum" : "4823498fca909a458c3a8c307e6168ac9339a2ecc2bcd2184a4f4f3459927d6",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -222,7 +222,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -231,27 +231,27 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/external_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file 'attribute \"onmousedown\" not allowed here; expected attribute \"class\", \"dir\", \"id\", \"lang\", \"style\", \"title\" or \"xml:lang\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 39,
"context" : null
@@ -260,25 +260,25 @@
}, {
"ID" : "SCP-004",
"severity" : "ERROR",
- "message" : "Content file contains script which is not supported in ePub v2.",
+ "message" : "Content file contains script which is not supported in EPUB v2.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : 5,
"column" : 52,
"context" : "script"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 39,
"context" : "onmousedown"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 5,
"column" : 36,
"context" : "script"
@@ -290,7 +290,7 @@
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 39,
"context" : "onmousedown"
@@ -302,7 +302,7 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 39,
"context" : "onmousedown"
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.xmp b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.xmp
new file mode 100644
index 0000000..244ef94
--- /dev/null
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/epub2_expected_results.xmp
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.1.0-jc003">
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+ <rdf:Description rdf:about="" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:xmpTPg="http://ns.adobe.com/xap/1.0/t/pg/" xmlns:stFnt="http://ns.adobe.com/xap/1.0/sType/Font#" xmlns:extended-properties="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties/" xmlns:premis="http://www.loc.gov/premis/rdf/v1#" dc:format="application/epub+zip;version=2.0.1" xmp:CreateDate="2015-03-30T16:14:34Z" extended-properties:Characters="731 [...]
+ <dc:title>
+ <rdf:Alt>
+ <rdf:li xml:lang="x-default">Script in epub 2 Sample Book</rdf:li>
+ </rdf:Alt>
+ </dc:title>
+ <premis:hasEvent rdf:parseType="Resource">
+ <premis:hasEventDateTime rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2015-03-30T16:15:01+02:00</premis:hasEventDateTime>
+ <premis:hasEventType rdf:resource="http://id.loc.gov/vocabulary/preservation/eventType/val" />
+ <premis:hasEventDetail>Not well-formed</premis:hasEventDetail>
+ <premis:hasEventOutcomeInformation>
+ <rdf:Seq>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>RSC-005, ERROR, Error while parsing file 'attribute "onmousedown" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_script.xhtml (10-39)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>SCP-004, ERROR, Content file contains script which is not supported in EPUB v2.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_script.xhtml (10-39)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/external_script.xhtml (5-52)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/script_tag.xhtml (5-36)" />
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/sample.js" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>HTM-010, HINT, Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx (2-68)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>OPF-059, HINT, Spine item has no NCX entry reference.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/toc.ncx" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>SCP-006, HINT, Inline scripts found.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_script.xhtml (10-39)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ <rdf:li rdf:parseType="Resource">
+ <premis:hasEventOutcome>SCP-009, HINT, Content file uses mouse event handlers.</premis:hasEventOutcome>
+ <premis:hasEventOutcomeDetail>
+ <rdf:Seq>
+ <rdf:li premis:hasEventOutcomeDetailNote="OPS/inline_script.xhtml (10-39)" />
+ </rdf:Seq>
+ </premis:hasEventOutcomeDetail>
+ </rdf:li>
+ </rdf:Seq>
+ </premis:hasEventOutcomeInformation>
+ <premis:hasEventRelatedAgent rdf:parseType="Resource">
+ <premis:hasAgentType rdf:resource="http://id.loc.gov/vocabulary/preservation/agentType/sof" />
+ <premis:hasAgentName>epubcheck 4.0.0-alpha12-SNAPSHOT</premis:hasAgentName>
+ </premis:hasEventRelatedAgent>
+ </premis:hasEvent>
+ <premis:hasSignificantProperties>
+ <rdf:Bag>
+ <rdf:li premis:hasSignificantPropertiesType="renditionLayout" premis:hasSignificantPropertiesValue="reflowable" />
+ <rdf:li premis:hasSignificantPropertiesType="isScripted" premis:hasSignificantPropertiesValue="true" />
+ <rdf:li premis:hasSignificantPropertiesType="hasEncryption" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAudio" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasVideo" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasSignatures" premis:hasSignificantPropertiesValue="false" />
+ <rdf:li premis:hasSignificantPropertiesType="hasAllFontsEmbedded" premis:hasSignificantPropertiesValue="true" />
+ </rdf:Bag>
+ </premis:hasSignificantProperties>
+ </rdf:Description>
+ </rdf:RDF>
+</x:xmpmeta>
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/eval_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/eval_expected_results.json
index ef032c0..c6f1055 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/eval_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/eval_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "eval.epub",
+ "path" : "eval.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,32 +278,32 @@
"message" : "An XHTML Named Entity was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 7,
"column" : 81,
"context" : "tHTML('beforeend', '<br/>' + eval("
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 7,
"column" : 88,
"context" : "beforeend', '<br/>' + eval('2+2'))"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 11,
"column" : 51,
"context" : "tHTML(\"beforeend\", \"<br/>\" + eval("
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 11,
"column" : 58,
"context" : "beforeend\", \"<br/>\" + eval(\"2+2\"))"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 12,
"column" : 51,
"context" : "tHTML(\"beforeend\", \"<br/>\" + eval("
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 12,
"column" : 58,
"context" : "beforeend\", \"<br/>\" + eval(x + 17)"
@@ -315,7 +315,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -327,7 +327,7 @@
"message" : "Input html elements should include an id.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 22,
"context" : null
@@ -339,7 +339,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
@@ -348,47 +348,47 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "SCP-001",
"severity" : "USAGE",
- "message" : "Use of Javascript eval() function in ePub scripts is a security risk.",
+ "message" : "Use of Javascript eval() function in EPUB scripts is a security risk.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 22,
"context" : "eval('2+2'));"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 4,
"column" : 10,
"context" : "eval (str);"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 11,
"column" : 52,
"context" : "eval(\"x=10;y=20;document.body.insertAdjacentHTML('beforeend'"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 12,
"column" : 52,
"context" : "eval(\"2+2\"));"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 14,
"column" : 1,
"context" : "eval(x + 17));"
@@ -400,7 +400,7 @@
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 22,
"context" : "onmouseover"
@@ -412,7 +412,7 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 8,
"column" : 22,
"context" : "onmouseover"
@@ -424,22 +424,22 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/properties_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/properties_expected_results.json
index c4db16e..5068c90 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/properties_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/properties_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -310,7 +310,7 @@
"message" : "'input' HTML element is not referenced by a corresponding label element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 95,
"context" : "no_label"
@@ -322,32 +322,32 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/external_script_not_marked.xhtml",
+ "path" : "OPS/external_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
+ "path" : "OPS/inline_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag_not_marked.xhtml",
+ "path" : "OPS/script_tag_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -359,7 +359,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "properties.epub",
+ "path" : "properties.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -371,7 +371,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -383,12 +383,12 @@
"message" : "Input html elements should include an id.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 115,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 75,
"context" : null
@@ -400,7 +400,7 @@
"message" : "Label html elements should include a 'for' attribute referencing the id of an input element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 29,
"context" : "label"
@@ -412,19 +412,19 @@
"message" : "The property 'scripted' should be declared in the OPF file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script_not_marked.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/external_script_not_marked.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/inline_script_not_marked.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag_not_marked.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/script_tag_not_marked.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -434,22 +434,22 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/external_script_not_marked.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script_not_marked.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag_not_marked.xhtml"
@@ -458,42 +458,42 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/external_script_not_marked.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script_not_marked.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag_not_marked.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n The for attribute does not refer to an allowed target element (expecting: button|keygen|meter|output|progress|select|textarea|input[not(@type='hidden')]).'.",
+ "message" : "Error while parsing file 'The for attribute does not refer to an allowed target element (expecting: button|keygen|meter|output|progress|select|textarea|input[not(@type='hidden')]).'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 12,
"column" : 45,
"context" : null
@@ -505,17 +505,17 @@
"message" : "Content file contains script but it is not marked as scripted.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script_not_marked.xhtml",
+ "path" : "OPS/external_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
+ "path" : "OPS/inline_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag_not_marked.xhtml",
+ "path" : "OPS/script_tag_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -527,22 +527,22 @@
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 115,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 75,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 95,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
+ "path" : "OPS/inline_script_not_marked.xhtml",
"line" : 10,
"column" : 116,
"context" : "onclick"
@@ -554,22 +554,22 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 115,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 75,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 95,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
+ "path" : "OPS/inline_script_not_marked.xhtml",
"line" : 10,
"column" : 116,
"context" : "onclick"
@@ -581,37 +581,37 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/external_script_not_marked.xhtml",
+ "path" : "OPS/external_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script_not_marked.xhtml",
+ "path" : "OPS/inline_script_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag_not_marked.xhtml",
+ "path" : "OPS/script_tag_not_marked.xhtml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/storage_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/storage_expected_results.json
index d4cc15a..507bdf7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/storage_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/storage_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -244,17 +244,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -266,7 +266,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "storage.epub",
+ "path" : "storage.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -278,7 +278,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -290,12 +290,12 @@
"message" : "Input html elements should include an id.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 31,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 33,
"context" : null
@@ -307,7 +307,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
@@ -316,72 +316,72 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "SCP-003",
"severity" : "USAGE",
"message" : "Local and Session Storage is not currently supported.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 31,
"context" : "localStorage.click=true"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 33,
"context" : "sessionStorage.click=true"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 4,
"column" : 8,
"context" : "localStorage.lastname=\"Noble\";"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 5,
"column" : 8,
"context" : "sessionStorage.firstName=\"Donna\";"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 6,
"column" : 17,
"context" : "localStorage.lastname + \", \" + sessionStorage.firstName;"
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 6,
"column" : 48,
"context" : "sessionStorage.firstName;"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 13,
"column" : 47,
"context" : "localStorage.lastname=\"Smith\";"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 13,
"column" : 47,
"context" : "sessionStorage.firstName=\"Sarah Jane\";"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 15,
"column" : 6,
"context" : "localStorage.lastname + \", \" + sessionStorage.firstName;"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 15,
"column" : 6,
"context" : "sessionStorage.firstName;"
@@ -393,12 +393,12 @@
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 31,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 33,
"context" : "onclick"
@@ -410,17 +410,17 @@
"message" : "Script references 'innerHtml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : 10,
"column" : 42,
"context" : "innerHTML=\"Sorry, your browser does not support web storage."
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 15,
"column" : 6,
"context" : "innerHTML=\"Name: \" + localStorage.lastname + \", \" + sessionS"
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : 19,
"column" : 6,
"context" : "innerHTML=\"Sorry, your browser does not support web storage."
@@ -432,12 +432,12 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 9,
"column" : 31,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 11,
"column" : 33,
"context" : "onclick"
@@ -449,22 +449,22 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/scripts/unused_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/scripts/unused_expected_results.json
index d13075b..4b3d3b7 100644
--- a/src/test/resources/com/adobe/epubcheck/test/scripts/unused_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/scripts/unused_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/scripts/unused.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/scripts/unused.epub",
"filename" : "unused.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:19",
- "elapsedTime" : 103,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:34",
+ "elapsedTime" : 50,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : true,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -170,7 +170,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/unused.js", "OPS/sample.js" ]
+ "referencedItems" : [ "OPS/sample.js", "OPS/unused.js" ]
}, {
"id" : "page03",
"fileName" : "OPS/script_tag.xhtml",
@@ -266,17 +266,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -288,7 +288,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "unused.epub",
+ "path" : "unused.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -300,7 +300,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -312,12 +312,12 @@
"message" : "Input html elements should include an id.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : 20,
"column" : 45,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 69,
"context" : null
@@ -329,7 +329,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
@@ -338,32 +338,32 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_script.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/script_tag.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "SCP-006",
"severity" : "USAGE",
"message" : "Inline scripts found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : 20,
"column" : 45,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 69,
"context" : "onclick"
@@ -375,12 +375,12 @@
"message" : "Content file uses mouse event handlers.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : 20,
"column" : 45,
"context" : "onclick"
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : 10,
"column" : 69,
"context" : "onclick"
@@ -392,27 +392,27 @@
"message" : "Epub 3 content file contains script.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_script.xhtml",
+ "path" : "OPS/external_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_script.xhtml",
+ "path" : "OPS/inline_script.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/sample.js",
+ "path" : "OPS/sample.js",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/script_tag.xhtml",
+ "path" : "OPS/script_tag.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/unused.js",
+ "path" : "OPS/unused.js",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/toc/fragments_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/toc/fragments_expected_results.json
index aa44ad8..295e049 100644
--- a/src/test/resources/com/adobe/epubcheck/test/toc/fragments_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/toc/fragments_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/toc/fragments.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/toc/fragments.epub",
"filename" : "fragments.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:23",
- "elapsedTime" : 90,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:36",
+ "elapsedTime" : 46,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -192,7 +192,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/page02.xhtml", "OPS/page01.xhtml" ]
+ "referencedItems" : [ "OPS/page01.xhtml", "OPS/page02.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -200,12 +200,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page02.xhtml",
+ "path" : "OPS/page02.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -217,7 +217,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "fragments.epub",
+ "path" : "fragments.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -229,7 +229,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -238,14 +238,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/page02.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/toc/invalid_ncx_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/toc/invalid_ncx_expected_results.json
index c06d1dc..8fe4054 100644
--- a/src/test/resources/com/adobe/epubcheck/test/toc/invalid_ncx_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/toc/invalid_ncx_expected_results.json
@@ -1,14 +1,14 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/toc/invalid_ncx.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/toc/invalid_ncx.epub",
"filename" : "invalid_ncx.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:23",
- "elapsedTime" : 82,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:36",
+ "elapsedTime" : 41,
"nFatal" : 0,
- "nError" : 3,
- "nWarning" : 1,
+ "nError" : 4,
+ "nWarning" : 0,
"nUsage" : 3
},
"publication" : {
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -126,7 +126,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/toc.xhtml", "OPS/page01.xhtml" ]
+ "referencedItems" : [ "OPS/page01.xhtml", "OPS/toc.xhtml" ]
}, {
"id" : "page01",
"fileName" : "OPS/page01.xhtml",
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "invalid_ncx.epub",
+ "path" : "invalid_ncx.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -211,28 +211,28 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n identical playOrder values for navPoint/navTarget/pageTarget that do not refer to same target'.",
+ "message" : "Error while parsing file 'element \"navPoint\" incomplete; missing required element \"content\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
- "line" : 12,
- "column" : 39,
- "context" : null
- }, {
- "fileName" : "OPS/toc.ncx",
- "line" : 23,
- "column" : 39,
+ "path" : "OPS/toc.ncx",
+ "line" : 22,
+ "column" : 16,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n playOrder sequence has gaps'.",
+ "message" : "Error while parsing file 'identical playOrder values for navPoint/navTarget/pageTarget that do not refer to same target'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
- "line" : 18,
+ "path" : "OPS/toc.ncx",
+ "line" : 12,
+ "column" : 39,
+ "context" : null
+ }, {
+ "path" : "OPS/toc.ncx",
+ "line" : 23,
"column" : 39,
"context" : null
} ],
@@ -240,22 +240,22 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"navPoint\" incomplete; missing required element \"content\"'.",
+ "message" : "Error while parsing file 'playOrder sequence has gaps'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
- "line" : 22,
- "column" : 16,
+ "path" : "OPS/toc.ncx",
+ "line" : 18,
+ "column" : 39,
"context" : null
} ],
"suggestion" : null
}, {
"ID" : "RSC-011",
- "severity" : "WARNING",
+ "severity" : "ERROR",
"message" : "Found a reference to a resource that is not a spine item.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 27,
"column" : 33,
"context" : "OPS/toc.xhtml"
diff --git a/src/test/resources/com/adobe/epubcheck/test/toc/missing_epub_type_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/toc/missing_epub_type_expected_results.json
index 3a1f9d8..f0a9ace 100644
--- a/src/test/resources/com/adobe/epubcheck/test/toc/missing_epub_type_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/toc/missing_epub_type_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -178,12 +178,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -195,7 +195,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "missing_epub_type.epub",
+ "path" : "missing_epub_type.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -207,7 +207,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -219,7 +219,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/page01.xhtml"
@@ -228,10 +228,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n Exactly one 'toc' nav element must be present'.",
+ "message" : "Error while parsing file 'Exactly one 'toc' nav element must be present'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : 8,
"column" : 7,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/External_media_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/External_media_expected_results.json
index d1a7a88..756bb78 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/External_media_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/External_media_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/xhtml/External_media.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/xhtml/External_media.epub",
"filename" : "External_media.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:28",
- "elapsedTime" : 105,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:39",
+ "elapsedTime" : 47,
"nFatal" : 0,
"nError" : 0,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -280,7 +280,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/video.xhtml", "OPS/audio.xhtml" ]
+ "referencedItems" : [ "OPS/audio.xhtml", "OPS/video.xhtml" ]
} ],
"messages" : [ {
"ID" : "ACC-007",
@@ -288,12 +288,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/audio.xhtml",
+ "path" : "OPS/audio.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/video.xhtml",
+ "path" : "OPS/video.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -305,7 +305,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "External_media.epub",
+ "path" : "External_media.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -317,7 +317,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -326,14 +326,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/audio.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/accessibility_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/accessibility_expected_results.json
index 4a079d2..4e62fc0 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/accessibility_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/accessibility_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -244,17 +244,17 @@
"message" : "'img' or 'area' HTML element has no 'alt' attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 18,
"column" : 119,
"context" : "area"
}, {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 19,
"column" : 96,
"context" : "area"
}, {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : 11,
"column" : 81,
"context" : "img"
@@ -266,17 +266,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/ImageMap_target.xhtml",
+ "path" : "OPS/ImageMap_target.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -288,7 +288,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "accessibility.epub",
+ "path" : "accessibility.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -300,17 +300,17 @@
"message" : "Content file contains at least one inline style declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/ImageMap_target.xhtml",
+ "path" : "OPS/ImageMap_target.xhtml",
"line" : 11,
"column" : 42,
"context" : "page-break-inside: avoid;"
}, {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 8,
"column" : 33,
"context" : "text-align:center;"
}, {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 13,
"column" : 74,
"context" : "text-align:center; margin-left:auto; margin-right:auto;"
@@ -322,17 +322,17 @@
"message" : "An XHTML Named Entity was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/ImageMap_target.xhtml",
+ "path" : "OPS/ImageMap_target.xhtml",
"line" : 18,
"column" : 48,
"context" : "ion_ImageMap.xhtml\">< Back</a"
}, {
- "fileName" : "OPS/ImageMap_target.xhtml",
+ "path" : "OPS/ImageMap_target.xhtml",
"line" : 26,
"column" : 48,
"context" : "ion_ImageMap.xhtml\">< Back</a"
}, {
- "fileName" : "OPS/ImageMap_target.xhtml",
+ "path" : "OPS/ImageMap_target.xhtml",
"line" : 34,
"column" : 48,
"context" : "ion_ImageMap.xhtml\">< Back</a"
@@ -344,7 +344,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -356,12 +356,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/ImageMap_target.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/Navigation_ImageMap.xhtml"
@@ -370,32 +370,32 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/ImageMap_target.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/Navigation_ImageMap.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file 'element \"area\" missing required attribute \"alt\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 18,
"column" : 119,
"context" : null
}, {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 19,
"column" : 96,
"context" : null
@@ -407,7 +407,7 @@
"message" : "Error while parsing file 'element \"map\" missing required attribute \"name\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Navigation_ImageMap.xhtml",
+ "path" : "OPS/Navigation_ImageMap.xhtml",
"line" : 16,
"column" : 30,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd/OPS/toc.ncx
index 64b8967..69741e1 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd/OPS/toc.ncx
@@ -1,5 +1,4 @@
<?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">
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
<meta name="dtb:uid" content=""/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd_expected_results.json
index 2215c1f..86e316e 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/dtd_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 349,
- "uncompressedSize" : 661,
+ "compressedSize" : 302,
+ "uncompressedSize" : 560,
"compressionMethod" : "Deflated",
- "checkSum" : "b21dfb53538a9457e1ca5b9498f8c610e7bcb1137ef6598d6a5cafa5083e979",
+ "checkSum" : "9743b42d18e0a14bb8179826c236d87923bcc29c984f6c615b8f3c775c9bba",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -376,12 +376,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_dtd.xhtml",
+ "path" : "OPS/external_dtd.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/inline_dtd.xhtml",
+ "path" : "OPS/inline_dtd.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -393,7 +393,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "dtd.epub",
+ "path" : "dtd.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -402,10 +402,10 @@
}, {
"ID" : "HTM-003",
"severity" : "ERROR",
- "message" : "External entities are not allowed in ePub v3 documents. External entity declaration found: arwen.",
+ "message" : "External entities are not allowed in EPUB v3 documents. External entity declaration found: arwen.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/internal_dtd2.xhtml",
+ "path" : "OPS/internal_dtd2.xhtml",
"line" : 3,
"column" : 45,
"context" : "arwen"
@@ -414,10 +414,10 @@
}, {
"ID" : "HTM-003",
"severity" : "ERROR",
- "message" : "External entities are not allowed in ePub v3 documents. External entity declaration found: cent.",
+ "message" : "External entities are not allowed in EPUB v3 documents. External entity declaration found: cent.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/internal_dtd2.xhtml",
+ "path" : "OPS/internal_dtd2.xhtml",
"line" : 4,
"column" : 44,
"context" : "cent"
@@ -429,9 +429,9 @@
"message" : "Irregular DOCTYPE: found '-//W3C//DTD XHTML 1.1//EN', expected '<!DOCTYPE html>'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_dtd.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/external_dtd.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -441,14 +441,14 @@
"message" : "Irregular DOCTYPE: found 'null', expected '<!DOCTYPE html>'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/internal_dtd.xhtml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/internal_dtd.xhtml",
+ "line" : -1,
+ "column" : -1,
"context" : null
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
- "line" : 0,
- "column" : 0,
+ "path" : "OPS/internal_xhtml_dtd.xml",
+ "line" : -1,
+ "column" : -1,
"context" : null
} ],
"suggestion" : null
@@ -458,8 +458,8 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
- "line" : 3,
+ "path" : "OPS/toc.ncx",
+ "line" : 2,
"column" : 68,
"context" : ""
} ],
@@ -470,7 +470,7 @@
"message" : "XHTML Content Document file name 'OPS/internal_xhtml_dtd.xml' should have the extension '.xhtml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 16,
"column" : 90,
"context" : null
@@ -479,15 +479,15 @@
}, {
"ID" : "HTM-015",
"severity" : "WARNING",
- "message" : "HTML4 DOCTYPE definition within ePub v3.",
+ "message" : "HTML4 DOCTYPE definition within EPUB v3.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "external_dtd.xhtml",
+ "path" : "external_dtd.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "internal_xhtml_dtd.xml",
+ "path" : "internal_xhtml_dtd.xml",
"line" : -1,
"column" : -1,
"context" : null
@@ -499,17 +499,17 @@
"message" : "An invalid XHTML Named Entity was found: '&arwen;'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/inline_dtd.xhtml",
+ "path" : "OPS/inline_dtd.xhtml",
"line" : 14,
"column" : 7,
"context" : "<p>&arwen;</p"
}, {
- "fileName" : "OPS/internal_dtd.xhtml",
+ "path" : "OPS/internal_dtd.xhtml",
"line" : 12,
"column" : 7,
"context" : "<p>&arwen;</p"
}, {
- "fileName" : "OPS/internal_dtd2.xhtml",
+ "path" : "OPS/internal_dtd2.xhtml",
"line" : 14,
"column" : 7,
"context" : "<p>&arwen;</p"
@@ -521,52 +521,52 @@
"message" : "An XHTML Named Entity was found. Only '&' ''' '"e;' '<' or '>' are allowed.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/external_dtd.xhtml",
+ "path" : "OPS/external_dtd.xhtml",
"line" : 12,
"column" : 43,
"context" : "rnal DTD reference. ¢</p"
}, {
- "fileName" : "OPS/inline_dtd.xhtml",
+ "path" : "OPS/inline_dtd.xhtml",
"line" : 13,
"column" : 43,
"context" : "rnal DTD reference. ¢</p"
}, {
- "fileName" : "OPS/internal_dtd.xhtml",
+ "path" : "OPS/internal_dtd.xhtml",
"line" : 11,
"column" : 43,
"context" : "rnal DTD reference. ¢</p"
}, {
- "fileName" : "OPS/internal_dtd2.xhtml",
+ "path" : "OPS/internal_dtd2.xhtml",
"line" : 13,
"column" : 43,
"context" : "rnal DTD reference. ¢</p"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 11,
"column" : 9,
"context" : "<p> T"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 11,
"column" : 15,
"context" : "<p> T"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 11,
"column" : 21,
"context" : "<p> Th"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 11,
"column" : 27,
"context" : "p> This has"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 11,
"column" : 33,
"context" : "p; This has a ref"
}, {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : 12,
"column" : 9,
"context" : "<p>¢</p"
@@ -578,12 +578,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_dtd.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/internal_xhtml_dtd.xml"
@@ -592,37 +592,37 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/external_dtd.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/inline_dtd.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/internal_xhtml_dtd.xml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'sample.dtd' is not found.",
+ "message" : "File 'sample.dtd' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/internal_dtd.xhtml",
+ "path" : "OPS/internal_dtd.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/internal_dtd2.xhtml",
+ "path" : "OPS/internal_dtd2.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -631,10 +631,10 @@
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File 'xhtml1-strict.dtd' is not found.",
+ "message" : "File 'xhtml1-strict.dtd' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/internal_xhtml_dtd.xml",
+ "path" : "OPS/internal_xhtml_dtd.xml",
"line" : -1,
"column" : -1,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/epubcfi_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/epubcfi_expected_results.json
index f4257ed..828d32a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/epubcfi_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/epubcfi_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -200,12 +200,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Intra_Publication.xhtml",
+ "path" : "OPS/Intra_Publication.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/Outer_Publication.xhtml",
+ "path" : "OPS/Outer_Publication.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -217,7 +217,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "epubcfi.epub",
+ "path" : "epubcfi.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -229,7 +229,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -241,12 +241,12 @@
"message" : "Found a link to a CFI in an external book.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Outer_Publication.xhtml",
+ "path" : "OPS/Outer_Publication.xhtml",
"line" : 10,
"column" : 42,
"context" : "lang.epub#epubcfi(/6/4!/4)"
}, {
- "fileName" : "OPS/Outer_Publication.xhtml",
+ "path" : "OPS/Outer_Publication.xhtml",
"line" : 11,
"column" : 43,
"context" : "lang.epub#epubcfi(/6/18!/4)"
@@ -258,17 +258,17 @@
"message" : "Intra-Publication CFIs found in document.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/Intra_Publication.xhtml",
+ "path" : "OPS/Intra_Publication.xhtml",
"line" : 9,
"column" : 46,
"context" : "content.opf#epubcfi(/6/4!/4)"
}, {
- "fileName" : "OPS/Intra_Publication.xhtml",
+ "path" : "OPS/Intra_Publication.xhtml",
"line" : 10,
"column" : 57,
"context" : "Outer_Publication.xhtml#epubcfi(/4/2/2)"
}, {
- "fileName" : "OPS/Intra_Publication.xhtml",
+ "path" : "OPS/Intra_Publication.xhtml",
"line" : 11,
"column" : 46,
"context" : "content.opf#epubcfi(/6/8!/4)"
@@ -280,7 +280,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/Outer_Publication.xhtml"
@@ -289,14 +289,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/Outer_Publication.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_deprecated_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_deprecated_epub3_expected_results.json
index 9334dc9..2fe78c5 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_deprecated_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_deprecated_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "html5_deprecated_epub3.epub",
+ "path" : "html5_deprecated_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -211,10 +211,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"acronym\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"heade [...]
+ "message" : "Error while parsing file 'element \"acronym\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"heade [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 23,
"column" : 57,
"context" : null
@@ -223,10 +223,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"big\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header\", [...]
+ "message" : "Error while parsing file 'element \"big\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header\", [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 22,
"column" : 10,
"context" : null
@@ -235,10 +235,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"center\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header [...]
+ "message" : "Error while parsing file 'element \"center\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 21,
"column" : 13,
"context" : null
@@ -247,10 +247,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'element \"strike\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header [...]
+ "message" : "Error while parsing file 'element \"strike\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"address\", \"area\", \"article\", \"aside\", \"audio\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"br\", \"button\", \"canvas\", \"cite\", \"code\", \"command\", \"datalist\", \"del\", \"details\", \"dfn\", \"div\", \"dl\", \"em\", \"embed\", \"fieldset\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"header [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 20,
"column" : 13,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2/OPS/toc.ncx b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2/OPS/toc.ncx
index ecc0bf3..778907c 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2/OPS/toc.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2/OPS/toc.ncx
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1">
<head>
- <meta name="dtb:uid" content=""/>
+ <meta name="dtb:uid" content="000000000000000000"/>
<meta name="dtb:depth" content="1"/>
<meta name="dtb:totalPageCount" content="0"/>
<meta name="dtb:maxPageNumber" content="0"/>
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2_expected_results.json
index f2b937a..4330e00 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -109,10 +109,10 @@
"id" : "ncx",
"fileName" : "OPS/toc.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 288,
- "uncompressedSize" : 546,
+ "compressedSize" : 289,
+ "uncompressedSize" : 564,
"compressionMethod" : "Deflated",
- "checkSum" : "73a729f831143549b9dbe5bc082edc31f7fe9d02bd6539e9ebf9546ad517b43",
+ "checkSum" : "fcc7d074e78fc8771ab9e88631fdf29676fa22dd5a211f852d6ede9178dfbb",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -178,7 +178,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -190,17 +190,17 @@
"message" : "Error while parsing file 'element \"article\" not allowed anywhere; expected the element end-tag, text or element \"a\", \"abbr\", \"acronym\", \"address\", \"applet\", \"b\", \"bdo\", \"big\", \"blockquote\", \"br\", \"cite\", \"code\", \"del\", \"dfn\", \"div\", \"dl\", \"em\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"i\", \"iframe\", \"img\", \"ins\", \"kbd\", \"map\", \"noscript\", \"ns:svg\", \"object\", \"ol\", \"p\", \"pre\", \"q\", \"samp\", \"sc [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 8,
"column" : 15,
"context" : null
}, {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 9,
"column" : 38,
"context" : null
}, {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 11,
"column" : 65,
"context" : null
@@ -212,17 +212,17 @@
"message" : "Error while parsing file 'element \"aside\" not allowed anywhere; expected the element end-tag, text or element \"a\", \"abbr\", \"acronym\", \"address\", \"applet\", \"b\", \"bdo\", \"big\", \"blockquote\", \"br\", \"cite\", \"code\", \"del\", \"dfn\", \"div\", \"dl\", \"em\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"i\", \"iframe\", \"img\", \"ins\", \"kbd\", \"map\", \"noscript\", \"ns:svg\", \"object\", \"ol\", \"p\", \"pre\", \"q\", \"samp\", \"scri [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 14,
"column" : 13,
"context" : null
}, {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 15,
"column" : 31,
"context" : null
}, {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 16,
"column" : 75,
"context" : null
@@ -234,7 +234,7 @@
"message" : "Error while parsing file 'element \"audio\" not allowed anywhere; expected the element end-tag, text or element \"a\", \"abbr\", \"acronym\", \"address\", \"applet\", \"b\", \"bdo\", \"big\", \"blockquote\", \"br\", \"cite\", \"code\", \"del\", \"dfn\", \"div\", \"dl\", \"em\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"i\", \"iframe\", \"img\", \"ins\", \"kbd\", \"map\", \"noscript\", \"ns:svg\", \"object\", \"ol\", \"p\", \"pre\", \"q\", \"samp\", \"scri [...]
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 19,
"column" : 54,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub3_expected_results.json
index 37c251c..e671ed5 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/html5_epub3_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -222,7 +222,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -234,7 +234,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "html5_epub3.epub",
+ "path" : "html5_epub3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -246,7 +246,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -258,7 +258,7 @@
"message" : "Content file doesn't contain xml:lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/xml_version.xhtml",
+ "path" : "OPS/xml_version.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -270,7 +270,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/xml_version.xhtml",
+ "path" : "OPS/xml_version.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -282,7 +282,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/xml_version.xhtml"
@@ -291,30 +291,25 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/xml_version.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
"message" : "Error while parsing file 'The version is required in the XML declaration.'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/xml_version.xhtml",
+ "path" : "OPS/xml_version.xhtml",
"line" : -1,
"column" : -1,
"context" : null
- }, {
- "fileName" : "OPS/xml_version.xhtml",
- "line" : 0,
- "column" : 0,
- "context" : null
} ],
"suggestion" : null
}, {
@@ -323,7 +318,7 @@
"message" : "Fatal Error while parsing file 'The version is required in the XML declaration.'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/xml_version.xhtml",
+ "path" : "OPS/xml_version.xhtml",
"line" : 1,
"column" : 6,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json
index 2b14ca3..7290bf9 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/hyperlinks_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/xhtml/hyperlinks.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/xhtml/hyperlinks.epub",
"filename" : "hyperlinks.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:27",
- "elapsedTime" : 120,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 10:06:39",
+ "elapsedTime" : 64,
"nFatal" : 0,
"nError" : 8,
"nWarning" : 2,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -148,7 +148,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "referencedItems" : [ "OPS/style.css", "OPS/images/sample.jpg", "OPS/svg_links.xhtml", "OPS/link_target.xhtml", "OPS/" ]
+ "referencedItems" : [ "OPS/", "OPS/images/sample.jpg", "OPS/link_target.xhtml", "OPS/style.css", "OPS/svg_links.xhtml" ]
}, {
"id" : "page02",
"fileName" : "OPS/link_target.xhtml",
@@ -310,22 +310,22 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/link_target.xhtml",
+ "path" : "OPS/link_target.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/mathMl.xhtml",
+ "path" : "OPS/mathMl.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/svg_links.xhtml",
+ "path" : "OPS/svg_links.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -337,7 +337,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "hyperlinks.epub",
+ "path" : "hyperlinks.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -346,15 +346,15 @@
}, {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/mathMl.xhtml",
+ "path" : "OPS/mathMl.xhtml",
"line" : 11,
"column" : 35,
"context" : ".inlineequation"
}, {
- "fileName" : "OPS/mathMl.xhtml",
+ "path" : "OPS/mathMl.xhtml",
"line" : 12,
"column" : 35,
"context" : ".inlineequation"
@@ -366,132 +366,132 @@
"message" : "An external reference was found.",
"additionalLocations" : 3,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 20,
"column" : 75,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 31,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 32,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 33,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 34,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 35,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 36,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 37,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 38,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 39,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 40,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 41,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 42,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 43,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 44,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 45,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 46,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 47,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 48,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 49,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 50,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 51,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 52,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 53,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 54,
"column" : 54,
"context" : "http://www.barnesandnoble.com/"
}, {
- "fileName" : "There are 3 additional locations for this message.",
+ "path" : "There are 3 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -503,7 +503,7 @@
"message" : "The src attribute is required.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 25,
"column" : 71,
"context" : "img"
@@ -515,7 +515,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -527,7 +527,7 @@
"message" : "Namespace uri 'http://www.w3.org/1998/Math/MathML' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/mathMl.xhtml",
+ "path" : "OPS/mathMl.xhtml",
"line" : 2,
"column" : 113,
"context" : "xmlns:m"
@@ -539,7 +539,7 @@
"message" : "Namespace uri 'http://www.w3.org/1999/xlink' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/svg_links.xhtml",
+ "path" : "OPS/svg_links.xhtml",
"line" : 2,
"column" : 111,
"context" : "xmlns:xlink"
@@ -551,7 +551,7 @@
"message" : "Non-registered URI scheme type found in href.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 26,
"column" : 126,
"context" : "wakawaka://wwww.thisdomaindoesntexist.org/books/media/sample.m4a"
@@ -563,12 +563,12 @@
"message" : "SVG elements should include an xml:lang and lang attributes.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/link_target.xhtml",
+ "path" : "OPS/link_target.xhtml",
"line" : 12,
"column" : 61,
"context" : "svg"
}, {
- "fileName" : "OPS/svg_links.xhtml",
+ "path" : "OPS/svg_links.xhtml",
"line" : 7,
"column" : 55,
"context" : "svg"
@@ -580,12 +580,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/link_target.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/svg_links.xhtml"
@@ -594,27 +594,27 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/link_target.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/svg_links.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-001",
"severity" : "ERROR",
- "message" : "File '' is not found.",
+ "message" : "File '' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 25,
"column" : 71,
"context" : "img"
@@ -623,10 +623,10 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
- "message" : "Referenced resource is not found in the ePub.",
+ "message" : "Referenced resource could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 25,
"column" : 71,
"context" : "OPS/"
@@ -638,7 +638,7 @@
"message" : "A fragment identifier should not be used with an img src attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 24,
"column" : 108,
"context" : "OPS/images/sample.jpg#hello"
@@ -650,17 +650,12 @@
"message" : "Fragment identifier is not defined.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
- "line" : 5,
- "column" : 67,
- "context" : "OPS/style.css#frag"
- }, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 24,
"column" : 108,
"context" : "OPS/images/sample.jpg#hello"
}, {
- "fileName" : "OPS/svg_links.xhtml",
+ "path" : "OPS/svg_links.xhtml",
"line" : 22,
"column" : 55,
"context" : "OPS/svg_links.xhtml#oops"
@@ -672,7 +667,7 @@
"message" : "Fragment identifier is used in a reference to a stylesheet resource.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 5,
"column" : 67,
"context" : "OPS/style.css#frag"
@@ -684,12 +679,12 @@
"message" : "Fragment identifier defines an incompatible resource type.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 27,
"column" : 73,
"context" : "OPS/svg_links.xhtml#redCircle"
}, {
- "fileName" : "OPS/links.xhtml",
+ "path" : "OPS/links.xhtml",
"line" : 28,
"column" : 75,
"context" : "OPS/svg_links.xhtml#hex-mask"
@@ -701,7 +696,7 @@
"message" : "A fragment identifier is required for svg use tag references.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/svg_links.xhtml",
+ "path" : "OPS/svg_links.xhtml",
"line" : 23,
"column" : 67,
"context" : "OPS/link_target.xhtml"
@@ -710,10 +705,10 @@
}, {
"ID" : "RSC-018",
"severity" : "WARNING",
- "message" : "Altimg file 'images/missing.png' is not found.",
+ "message" : "Altimg file 'images/missing.png' could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/mathMl.xhtml",
+ "path" : "OPS/mathMl.xhtml",
"line" : 12,
"column" : 137,
"context" : "altimg"
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/lang_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/lang_expected_results.json
index cc68d07..49faedb 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/lang_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/lang_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -222,17 +222,17 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/invalid_lang.xhtml",
+ "path" : "OPS/invalid_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/mismatched_lang.xhtml",
+ "path" : "OPS/mismatched_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/no_lang.xhtml",
+ "path" : "OPS/no_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -244,7 +244,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "lang.epub",
+ "path" : "lang.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -256,7 +256,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -268,7 +268,7 @@
"message" : "Content file has different language value in attributes xml:lang and lang.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/mismatched_lang.xhtml",
+ "path" : "OPS/mismatched_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -280,7 +280,7 @@
"message" : "Content file has invalid language value at attribute xml:lang.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/invalid_lang.xhtml",
+ "path" : "OPS/invalid_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -292,7 +292,7 @@
"message" : "Content file has invalid language definition at attribute lang.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/invalid_lang.xhtml",
+ "path" : "OPS/invalid_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -304,7 +304,7 @@
"message" : "Content file doesn't contain xml:lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/no_lang.xhtml",
+ "path" : "OPS/no_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -316,7 +316,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/no_lang.xhtml",
+ "path" : "OPS/no_lang.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -328,12 +328,12 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/invalid_lang.xhtml"
}, {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/mismatched_lang.xhtml"
@@ -342,27 +342,27 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/invalid_lang.xhtml"
}, {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/mismatched_lang.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n The lang and xml:lang attributes must have the same value.'.",
+ "message" : "Error while parsing file 'The lang and xml:lang attributes must have the same value.'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/mismatched_lang.xhtml",
+ "path" : "OPS/mismatched_lang.xhtml",
"line" : 2,
"column" : 68,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_noxmlns_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_noxmlns_expected_results.json
index 1eea9be..92ae39a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_noxmlns_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_noxmlns_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -175,15 +175,15 @@
"messages" : [ {
"ID" : "CSS-022",
"severity" : "USAGE",
- "message" : "CSS Selector specifies global margin setting.",
+ "message" : "CSS selector specifies global margin setting.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 2,
"column" : 5,
"context" : "margin-left : 6em ;"
}, {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 3,
"column" : 5,
"context" : "margin-right : 16em ;"
@@ -195,12 +195,12 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : ""
}, {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : "ncx"
@@ -212,7 +212,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -224,7 +224,7 @@
"message" : "Html element does not have an xmlns set to 'http://www.w3.org/1999/xhtml'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : 4,
"column" : 21,
"context" : "html"
@@ -236,7 +236,7 @@
"message" : "Error while parsing file 'elements from namespace \"\" are not allowed'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : 4,
"column" : 21,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps1_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps1_expected_results.json
index 790ba27..e40a0b9 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps1_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps1_expected_results.json
@@ -9,7 +9,7 @@
"nFatal" : 0,
"nError" : 1,
"nWarning" : 0,
- "nUsage" : 9
+ "nUsage" : 8
},
"publication" : {
"publisher" : null,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -222,7 +222,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -234,7 +234,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "lorem_pagemaps1.epub",
+ "path" : "lorem_pagemaps1.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -243,15 +243,15 @@
}, {
"ID" : "CSS-022",
"severity" : "USAGE",
- "message" : "CSS Selector specifies global margin setting.",
+ "message" : "CSS selector specifies global margin setting.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 2,
"column" : 5,
"context" : "margin-left : 6em ;"
}, {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 3,
"column" : 5,
"context" : "margin-right : 16em ;"
@@ -263,12 +263,12 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : ""
}, {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : "ncx"
@@ -280,7 +280,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -292,7 +292,7 @@
"message" : "Found epub:type=\"page-list\" in nav document",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/nav.xhtml",
+ "path" : "EPUB/nav.xhtml",
"line" : 25,
"column" : 34,
"context" : "page-list"
@@ -304,31 +304,19 @@
"message" : "Found ncx \"page-list\" in .ncx file",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 29,
"column" : 15,
"context" : "pageList"
} ],
"suggestion" : null
}, {
- "ID" : "NCX-006",
- "severity" : "USAGE",
- "message" : "Found both \"page-list\" construct in ncx document and Adobe page-map attribute on the spine.",
- "additionalLocations" : 0,
- "locations" : [ {
- "fileName" : "lorem_pagemaps1.epub",
- "line" : -1,
- "column" : -1,
- "context" : null
- } ],
- "suggestion" : "Using multiple paging constructs can cause unpredictable paging behavior in some readers."
- }, {
"ID" : "OPF-062",
"severity" : "USAGE",
"message" : "Found Adobe page-map attribute on spine element in opf file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.opf",
+ "path" : "EPUB/lorem.opf",
"line" : 17,
"column" : 37,
"context" : "page-map=\"map\""
@@ -340,7 +328,7 @@
"message" : "Error while parsing file 'attribute \"page-map\" not allowed here; expected attribute \"id\" or \"page-progression-direction\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.opf",
+ "path" : "EPUB/lorem.opf",
"line" : 17,
"column" : 37,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps2_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps2_expected_results.json
index 457f169..193339a 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps2_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps2_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -200,7 +200,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "lorem_pagemaps2.epub",
+ "path" : "lorem_pagemaps2.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -209,15 +209,15 @@
}, {
"ID" : "CSS-022",
"severity" : "USAGE",
- "message" : "CSS Selector specifies global margin setting.",
+ "message" : "CSS selector specifies global margin setting.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 2,
"column" : 5,
"context" : "margin-left : 6em ;"
}, {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 3,
"column" : 5,
"context" : "margin-right : 16em ;"
@@ -229,12 +229,12 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : ""
}, {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : "ncx"
@@ -246,7 +246,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -258,12 +258,12 @@
"message" : "Found epub:type=\"pagebreak\" attribute in content document.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : 10,
"column" : 40,
"context" : "pagebreak"
}, {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : 52,
"column" : 39,
"context" : "pagebreak"
@@ -275,7 +275,7 @@
"message" : "Found epub:type=\"page-list\" in nav document",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/nav.xhtml",
+ "path" : "EPUB/nav.xhtml",
"line" : 25,
"column" : 34,
"context" : "page-list"
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps3_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps3_expected_results.json
index ee73243..a8dfd0d 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps3_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/lorem_pagemaps3_expected_results.json
@@ -9,7 +9,7 @@
"nFatal" : 0,
"nError" : 1,
"nWarning" : 2,
- "nUsage" : 9
+ "nUsage" : 8
},
"publication" : {
"publisher" : null,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -222,7 +222,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -234,7 +234,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "lorem_pagemaps3.epub",
+ "path" : "lorem_pagemaps3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -243,15 +243,15 @@
}, {
"ID" : "CSS-022",
"severity" : "USAGE",
- "message" : "CSS Selector specifies global margin setting.",
+ "message" : "CSS selector specifies global margin setting.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 2,
"column" : 5,
"context" : "margin-left : 6em ;"
}, {
- "fileName" : "EPUB/lorem.css",
+ "path" : "EPUB/lorem.css",
"line" : 3,
"column" : 5,
"context" : "margin-right : 16em ;"
@@ -263,12 +263,12 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : ""
}, {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 5,
"column" : 19,
"context" : "ncx"
@@ -280,7 +280,7 @@
"message" : "Content file doesn't contain lang attribute.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.xhtml",
+ "path" : "EPUB/lorem.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -292,7 +292,7 @@
"message" : "Found epub:type=\"page-list\" in nav document",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/nav.xhtml",
+ "path" : "EPUB/nav.xhtml",
"line" : 25,
"column" : 34,
"context" : "page-list"
@@ -304,31 +304,19 @@
"message" : "Found ncx \"page-list\" in .ncx file",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.ncx",
+ "path" : "EPUB/lorem.ncx",
"line" : 29,
"column" : 15,
"context" : "pageList"
} ],
"suggestion" : null
}, {
- "ID" : "NCX-006",
- "severity" : "USAGE",
- "message" : "Found both \"page-list\" construct in ncx document and Adobe page-map attribute on the spine.",
- "additionalLocations" : 0,
- "locations" : [ {
- "fileName" : "lorem_pagemaps3.epub",
- "line" : -1,
- "column" : -1,
- "context" : null
- } ],
- "suggestion" : "Using multiple paging constructs can cause unpredictable paging behavior in some readers."
- }, {
"ID" : "OPF-003",
"severity" : "WARNING",
- "message" : "Item 'EPUB/page-map.xml' exists in the ePub, but is not declared in the OPF manifest.",
+ "message" : "Item 'EPUB/page-map.xml' exists in the EPUB, but is not declared in the OPF manifest.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "lorem_pagemaps3.epub",
+ "path" : "lorem_pagemaps3.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -340,7 +328,7 @@
"message" : "Found Adobe page-map attribute on spine element in opf file.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.opf",
+ "path" : "EPUB/lorem.opf",
"line" : 16,
"column" : 37,
"context" : "page-map=\"map\""
@@ -352,7 +340,7 @@
"message" : "Referenced Adobe page-map item 'map' was not found in the manifest.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.opf",
+ "path" : "EPUB/lorem.opf",
"line" : 16,
"column" : 37,
"context" : "page-map=\"map\""
@@ -364,7 +352,7 @@
"message" : "Error while parsing file 'attribute \"page-map\" not allowed here; expected attribute \"id\" or \"page-progression-direction\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "EPUB/lorem.opf",
+ "path" : "EPUB/lorem.opf",
"line" : 16,
"column" : 37,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/media_overlays_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/media_overlays_expected_results.json
index 292e2dd..8dba282 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/media_overlays_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/media_overlays_expected_results.json
@@ -1,11 +1,11 @@
{
"customMessageFileName" : null,
"checker" : {
- "path" : "./com/adobe/epubcheck/test/xhtml/media_overlays.epub",
+ "path" : "./target/test-classes/com/adobe/epubcheck/test/xhtml/media_overlays.epub",
"filename" : "media_overlays.epub",
- "checkerVersion" : "4.0.0-alpha11-SNAPSHOT",
- "checkDate" : "09-05-2014 03:16:28",
- "elapsedTime" : 802,
+ "checkerVersion" : "4.0.0-alpha12-SNAPSHOT",
+ "checkDate" : "03-25-2015 14:49:51",
+ "elapsedTime" : 3500,
"nFatal" : 0,
"nError" : 3,
"nWarning" : 0,
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -104,7 +104,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/chapter_001.xhtml", "OPS/audio/mobydick_001_002_melville.mp4" ]
+ "referencedItems" : [ "OPS/audio/mobydick_001_002_melville.mp4", "OPS/chapter_001.xhtml" ]
}, {
"id" : "ePubCheck.NoManifestRef:META-INF/container.xml",
"fileName" : "META-INF/container.xml",
@@ -324,7 +324,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/page01.xhtml", "OPS/audio/echild_s01_all.m4a" ]
+ "referencedItems" : [ "OPS/audio/echild_s01_all.m4a", "OPS/page01.xhtml" ]
}, {
"id" : "style",
"fileName" : "OPS/css/stylesheet.css",
@@ -346,7 +346,7 @@
"renditionLayout" : null,
"renditionOrientation" : null,
"renditionSpread" : null,
- "referencedItems" : [ "OPS/fonts/iwonacond-bolditalic.otf", "OPS/fonts/iwonacond-bold.otf", "OPS/fonts/iwonacond-italic.otf", "OPS/fonts/iwonacond-regular.otf" ]
+ "referencedItems" : [ "OPS/fonts/iwonacond-bold.otf", "OPS/fonts/iwonacond-bolditalic.otf", "OPS/fonts/iwonacond-italic.otf", "OPS/fonts/iwonacond-regular.otf" ]
}, {
"id" : "toc",
"fileName" : "OPS/toc.xhtml",
@@ -398,7 +398,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.xhtml",
+ "path" : "OPS/page01.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -410,7 +410,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "media_overlays.epub",
+ "path" : "media_overlays.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -419,20 +419,20 @@
}, {
"ID" : "CSS-013",
"severity" : "USAGE",
- "message" : "CSS Selector attribute is declared !Important.",
+ "message" : "CSS property is declared !Important.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 44,
"column" : 1,
"context" : "text-transform : lowercase !important ;"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 209,
"column" : 1,
"context" : "color : black !important ;"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 314,
"column" : 1,
"context" : "text-align : right !important ;"
@@ -441,15 +441,15 @@
}, {
"ID" : "CSS-023",
"severity" : "USAGE",
- "message" : "CSS Selector specifies media query.",
+ "message" : "CSS selector specifies media query.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 363,
"column" : 1,
"context" : "@media all and (orientation : portrait)"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 368,
"column" : 1,
"context" : "@media all and (orientation : landscape)"
@@ -461,132 +461,132 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 3,
"locations" : [ {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 53,
"column" : 1,
"context" : ".decoration-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 61,
"column" : 1,
"context" : ".copyright-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 73,
"column" : 1,
"context" : ".dedication-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
+ "line" : 78,
+ "column" : 1,
+ "context" : ".Dedication-rw"
+ }, {
+ "path" : "OPS/css/stylesheet.css",
"line" : 82,
"column" : 1,
"context" : ".leading-line-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 86,
"column" : 1,
"context" : ".fp-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
+ "line" : 115,
+ "column" : 1,
+ "context" : ".title-author-rw"
+ }, {
+ "path" : "OPS/css/stylesheet.css",
"line" : 121,
"column" : 1,
"context" : ".title-num-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 129,
"column" : 1,
"context" : ".title-sub-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 135,
"column" : 1,
"context" : ".imprint-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 139,
"column" : 1,
"context" : ".extract-verse-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 157,
"column" : 1,
"context" : ".epigraph-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 164,
"column" : 1,
"context" : ".sc-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 174,
"column" : 5,
"context" : ".dropcap-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
+ "line" : 181,
+ "column" : 1,
+ "context" : ".signature-rw"
+ }, {
+ "path" : "OPS/css/stylesheet.css",
"line" : 187,
"column" : 1,
"context" : ".AdCard-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 196,
"column" : 1,
"context" : ".FrontSales-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 238,
"column" : 1,
"context" : ".toc-short"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 269,
"column" : 1,
"context" : ".center"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 281,
"column" : 1,
"context" : ".title-other-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 287,
"column" : 1,
"context" : ".dateline-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 295,
"column" : 1,
"context" : ".frontmatter-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 299,
"column" : 1,
"context" : ".backmatter-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 305,
"column" : 4,
"context" : ".direction-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 312,
"column" : 5,
"context" : ".source-rw"
}, {
- "fileName" : "OPS/css/stylesheet.css",
- "line" : 327,
- "column" : 1,
- "context" : ".list-simple-rw"
- }, {
- "fileName" : "OPS/css/stylesheet.css",
- "line" : 338,
- "column" : 4,
- "context" : ".photo"
- }, {
- "fileName" : "OPS/css/stylesheet.css",
- "line" : 358,
- "column" : 1,
- "context" : ".-epub-media-overlay-active"
- }, {
- "fileName" : "There are 3 additional locations for this message.",
+ "path" : "There are 3 additional locations for this message.",
"line" : -1,
"column" : -1,
"context" : null
@@ -595,15 +595,15 @@
}, {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/chapter_001.xhtml",
+ "path" : "OPS/chapter_001.xhtml",
"line" : 9,
"column" : 68,
"context" : ".Chapter-rw"
}, {
- "fileName" : "OPS/chapter_001.xhtml",
+ "path" : "OPS/chapter_001.xhtml",
"line" : 9,
"column" : 68,
"context" : ".body-rw"
@@ -615,82 +615,82 @@
"message" : "Use of Font-face declaration.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 3,
"column" : 1,
"context" : "null"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 4,
"column" : 1,
"context" : "null"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 5,
"column" : 1,
"context" : "null"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 6,
"column" : 1,
"context" : "OPS/fonts/iwonacond-regular.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 10,
"column" : 1,
"context" : "OPS/fonts/iwonacond-regular.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 11,
"column" : 1,
"context" : "OPS/fonts/iwonacond-regular.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 12,
"column" : 1,
"context" : "OPS/fonts/iwonacond-regular.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 13,
"column" : 1,
"context" : "OPS/fonts/iwonacond-bold.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 17,
"column" : 1,
"context" : "OPS/fonts/iwonacond-bold.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 18,
"column" : 1,
"context" : "OPS/fonts/iwonacond-bold.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 19,
"column" : 1,
"context" : "OPS/fonts/iwonacond-bold.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 20,
"column" : 1,
"context" : "OPS/fonts/iwonacond-italic.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 24,
"column" : 1,
"context" : "OPS/fonts/iwonacond-italic.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 25,
"column" : 1,
"context" : "OPS/fonts/iwonacond-italic.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 26,
"column" : 1,
"context" : "OPS/fonts/iwonacond-italic.otf"
}, {
- "fileName" : "OPS/css/stylesheet.css",
+ "path" : "OPS/css/stylesheet.css",
"line" : 27,
"column" : 1,
"context" : "OPS/fonts/iwonacond-bolditalic.otf"
@@ -702,7 +702,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -714,7 +714,7 @@
"message" : "Media Overlay audio reference OPS/audio/echild_s01_all.m4a to non-standard audio type audio/m4a found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/page01.smil",
+ "path" : "OPS/page01.smil",
"line" : 6,
"column" : 57,
"context" : null
@@ -726,7 +726,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/chapter_001.xhtml"
@@ -735,22 +735,22 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/chapter_001.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n global media:duration meta element not set'.",
+ "message" : "Error while parsing file 'global media:duration meta element not set'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 10,
"column" : 13,
"context" : null
@@ -759,10 +759,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n item media:duration meta element not set (expecting: meta property='media:duration' refines='#smil01')'.",
+ "message" : "Error while parsing file 'item media:duration meta element not set (expecting: meta property='media:duration' refines='#smil01')'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 12,
"column" : 102,
"context" : null
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json
index 2f0e884..009c429 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/namespaces_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : false,
@@ -178,7 +178,7 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -190,7 +190,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "namespaces.epub",
+ "path" : "namespaces.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -202,7 +202,7 @@
"message" : "Namespace uri 'http://unused.namespace.com/unused' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 3,
"column" : 118,
"context" : "xmlns:unused"
@@ -214,7 +214,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -226,7 +226,7 @@
"message" : "Namespace uri 'http://unused.namespace.com/unused' was included but not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 3,
"column" : 118,
"context" : "xmlns:unused"
@@ -238,7 +238,7 @@
"message" : "The unique-identifier 'BOGUS' was not found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : -1,
"column" : -1,
"context" : null
@@ -247,10 +247,10 @@
}, {
"ID" : "RSC-005",
"severity" : "ERROR",
- "message" : "Error while parsing file 'assertion failed:\n package element unique-identifier attribute does not resolve to a dc:identifier element (given reference was 'BOGUS')'.",
+ "message" : "Error while parsing file 'package element unique-identifier attribute does not resolve to a dc:identifier element (given reference was 'BOGUS')'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/content.opf",
+ "path" : "OPS/content.opf",
"line" : 2,
"column" : 87,
"context" : null
@@ -259,10 +259,10 @@
}, {
"ID" : "RSC-007",
"severity" : "ERROR",
- "message" : "Referenced resource is not found in the ePub.",
+ "message" : "Referenced resource could not be found in the EPUB.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/html5.xhtml",
+ "path" : "OPS/html5.xhtml",
"line" : 21,
"column" : 61,
"context" : "OPS/echild_s01_all.m4a"
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/nesting_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/nesting_expected_results.json
index c669297..0416f80 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/nesting_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/nesting_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "3.0",
+ "ePubVersion" : "3.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -222,12 +222,12 @@
"message" : "Content Documents do not use 'epub:type' attributes for semantic inflection.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/deep_nesting.xhtml",
+ "path" : "OPS/deep_nesting.xhtml",
"line" : -1,
"column" : -1,
"context" : null
}, {
- "fileName" : "OPS/standard_nesting.xhtml",
+ "path" : "OPS/standard_nesting.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -239,7 +239,7 @@
"message" : "Navigation Document has no 'landmarks nav' element.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "nesting.epub",
+ "path" : "nesting.epub",
"line" : -1,
"column" : -1,
"context" : null
@@ -251,32 +251,32 @@
"message" : "CSS class Selector is not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 37,
"column" : 1,
"context" : ".calibre4"
}, {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 46,
"column" : 1,
"context" : ".calibre6"
}, {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 54,
"column" : 1,
"context" : ".calibre7"
}, {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 62,
"column" : 1,
"context" : ".calibre8"
}, {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 66,
"column" : 1,
"context" : ".ch-lvl"
}, {
- "fileName" : "OPS/stylesheet.css",
+ "path" : "OPS/stylesheet.css",
"line" : 76,
"column" : 1,
"context" : ".ch-lvl1"
@@ -288,7 +288,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : 2,
"column" : 68,
"context" : ""
@@ -300,7 +300,7 @@
"message" : "Document may contain excessive DIV or SPAN tags.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "deep_nesting.xhtml",
+ "path" : "deep_nesting.xhtml",
"line" : -1,
"column" : -1,
"context" : null
@@ -312,7 +312,7 @@
"message" : "Spine item has no TOC entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.xhtml",
+ "path" : "OPS/toc.xhtml",
"line" : -1,
"column" : -1,
"context" : "OPS/standard_nesting.xhtml"
@@ -321,14 +321,14 @@
}, {
"ID" : "OPF-059",
"severity" : "USAGE",
- "message" : "Spine item has no NAV entry reference.",
+ "message" : "Spine item has no NCX entry reference.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OPS/toc.ncx",
+ "path" : "OPS/toc.ncx",
"line" : -1,
"column" : -1,
"context" : "OPS/standard_nesting.xhtml"
} ],
- "suggestion" : "Every spine item in the manifest should be referenced by at least one NAV entry."
+ "suggestion" : "Every spine item in the manifest should be referenced by at least one NCX entry."
} ]
}
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline/OEBPS/moby.ncx b/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline/OEBPS/moby.ncx
index b91c043..731d8a8 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline/OEBPS/moby.ncx
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline/OEBPS/moby.ncx
@@ -1 +1 @@
-<?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"><ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en-US"><head><meta name="dtb:uid" content="uid" /><meta name="dtb:depth" content="1" /><meta name="dtb:generator" content="Aspose.Words for .NET 9.3.0.0" /><meta name="dtb:totalPageCount" content="0" /><meta name="dtb:maxPageNumber" content="0" /></head><docTitle><text>Moby Di [...]
\ No newline at end of file
+<?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"><ncx xmlns="http://www.daisy.org/z3986/2005/ncx/" version="2005-1" xml:lang="en-US"><head><meta name="dtb:uid" content="2940010571634" /><meta name="dtb:depth" content="1" /><meta name="dtb:generator" content="Aspose.Words for .NET 9.3.0.0" /><meta name="dtb:totalPageCount" content="0" /><meta name="dtb:maxPageNumber" content="0" /></head><docTitle><te [...]
\ No newline at end of file
diff --git a/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline_expected_results.json b/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline_expected_results.json
index 479620c..6558683 100644
--- a/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline_expected_results.json
+++ b/src/test/resources/com/adobe/epubcheck/test/xhtml/singleline_expected_results.json
@@ -26,7 +26,7 @@
"renditionLayout" : "reflowable",
"renditionOrientation" : "auto",
"renditionSpread" : "auto",
- "ePubVersion" : "2.0",
+ "ePubVersion" : "2.0.1",
"isScripted" : false,
"hasFixedFormat" : false,
"isBackwardCompatible" : true,
@@ -153,10 +153,10 @@
"id" : "ncx",
"fileName" : "OEBPS/moby.ncx",
"media_type" : "application/x-dtbncx+xml",
- "compressedSize" : 343,
- "uncompressedSize" : 652,
+ "compressedSize" : 352,
+ "uncompressedSize" : 662,
"compressionMethod" : "Deflated",
- "checkSum" : "f3b2f9d55267118cc14231e25b572df3365f6025ef1fcf0f0ba19ec523bda",
+ "checkSum" : "ee6092b2b35ca27858e667dab5be2276ada42d6a68c6fd27f1df6db70feda",
"isSpineItem" : false,
"spineIndex" : null,
"isLinear" : false,
@@ -175,30 +175,30 @@
"messages" : [ {
"ID" : "CSS-025",
"severity" : "USAGE",
- "message" : "CSS class Selector is not found.",
+ "message" : "CSS class Selector could not be found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 344,
"context" : ".Chapter-rw"
}, {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 344,
"context" : ".body-rw"
}, {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 11372,
"context" : ".block-rw"
}, {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 11372,
"context" : ".extract-rw"
}, {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 11372,
"context" : ".headline-rw"
@@ -210,7 +210,7 @@
"message" : "Namespace uri 'http://www.daisy.org/z3986/2005/ncx/' was found.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/moby.ncx",
+ "path" : "OEBPS/moby.ncx",
"line" : 1,
"column" : 223,
"context" : ""
@@ -222,7 +222,7 @@
"message" : "Namespace uri '' was included but not used.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/content.opf",
+ "path" : "OEBPS/content.opf",
"line" : 10,
"column" : 58,
"context" : ""
@@ -234,7 +234,7 @@
"message" : "Error while parsing file 'attribute \"charset\" not allowed here; expected attribute \"content\", \"dir\", \"http-equiv\", \"lang\", \"name\", \"scheme\" or \"xml:lang\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 265,
"context" : null
@@ -246,7 +246,7 @@
"message" : "Error while parsing file 'attribute \"epub:type\" not allowed here; expected attribute \"dir\", \"id\", \"lang\", \"style\", \"title\" or \"xml:lang\"'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 344,
"context" : null
@@ -258,7 +258,7 @@
"message" : "Error while parsing file 'element \"div\" not allowed here; expected the element end-tag, text or element \"a\", \"abbr\", \"acronym\", \"applet\", \"b\", \"bdo\", \"big\", \"br\", \"cite\", \"code\", \"del\", \"dfn\", \"em\", \"i\", \"iframe\", \"img\", \"ins\", \"kbd\", \"map\", \"noscript\", \"ns:svg\", \"object\", \"q\", \"samp\", \"script\", \"small\", \"span\", \"strong\", \"sub\", \"sup\", \"tt\" or \"var\" (with xmlns:ns=\"http://www.w3.org/2000/svg\")'.",
"additionalLocations" : 0,
"locations" : [ {
- "fileName" : "OEBPS/moby.html",
+ "path" : "OEBPS/moby.html",
"line" : 1,
"column" : 344,
"context" : null
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/epubcheck.git
More information about the pkg-java-commits
mailing list