diff -Nru epubcheck-4.0.2/CHANGELOG.md epubcheck-4.1.0/CHANGELOG.md --- epubcheck-4.0.2/CHANGELOG.md 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/CHANGELOG.md 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,69 @@ +# EPUBCheck change log + + +## [4.1.0](https://github.com/w3c/epubcheck/compare/v4.0.2...v4.1.0) (2018-11-26) + +This is a maintenance release of EPUBCheck, the conformance validator for EPUB publications. It includes various improvements and bug fixes that have been contributed over the past two years. + +This release was made by the DAISY Consortium, for the W3C. + +Many thanks to the various people who contributed to this release, including @bitsgalore, @kalaspuffar, @kamorrissey, @matthew-macgregor, @mkraetke, @murata2makoto, @takahashim, @tledoux… and especially Tobias Fischer (@tofi86), who has been the primary project maintainer after v4.0.2 and before the DAISY Consortium took over the maintenance role in October 2018! + +**Note:** this release does _not_ yet implement support for the newer EPUB 3.2 specifications. + +### Bug Fixes + +* silence a Saxon warning (Schematron XSLT) ([5045d78b](https://github.com/w3c/epubcheck/commit/5045d78b)), closes #859 +* fix path resolution in EpubNCXCheck (ctc package) ([f572a861](https://github.com/w3c/epubcheck/commit/f572a861)) +* handle `IllegalStateException` in NCX checker ([25336894](https://github.com/w3c/epubcheck/commit/25336894)), closes #666 +* check that the `mimetype` file is uncompressed ([6764e250](https://github.com/w3c/epubcheck/commit/6764e250)), closes #303 +* fix wrong exit message for single file validation ([68af5a9a](https://github.com/w3c/epubcheck/commit/68af5a9a)), closes #740 +* allow ARIA `role` attributes in SVG ([49412e05](https://github.com/w3c/epubcheck/commit/49412e05)), closes #769 +* allow empty `xml:lang` attributes ([392c2f68](https://github.com/w3c/epubcheck/commit/392c2f68)), closes #777 +* handle no src uri in fonts, correct embedded font boolean in the XML output ([a26f9c13](https://github.com/w3c/epubcheck/commit/a26f9c13)), closes #773 +* fix issues with landmarks checks `ACC-008` ([74d0bdd1](https://github.com/w3c/epubcheck/commit/74d0bdd1)), closes #457, #734 +* fix focus issue when using EPUBCheck in a GUI app ([cd63a166](https://github.com/w3c/epubcheck/commit/cd63a166)), closes #665 +* fix incorrect warning `ACC_011` ([5e6a69af](https://github.com/w3c/epubcheck/commit/5e6a69af)), closes #680 +* make the `type` attribute optional on SVG `style` elements ([275f6b6a](https://github.com/w3c/epubcheck/commit/275f6b6a)), closes #688 +* exit with error when directory is not found in expanded mode ([e42d189c](https://github.com/w3c/epubcheck/commit/e42d189c)), closes #525 +* fix a `NullPointerException` when checking an empty meta rendition element in OPF ([42d75297](https://github.com/w3c/epubcheck/commit/42d75297)), closes #727 +* fix `DefaultReportImpl` to avoid duplicate path info in message locations ([9321355b](https://github.com/w3c/epubcheck/commit/9321355b)), closes #729 +* fix broken `OPF_060` and `OPF_061` message format ([9f0e7d12](https://github.com/w3c/epubcheck/commit/9f0e7d12)), closes #658 +* fix broken `OPF_060` and `OPF_061` checks for duplicate ZIP entries ([05e96f40](https://github.com/w3c/epubcheck/commit/05e96f40)), closes #728 + +### Features + +* allow the configuration of EPUBCheck’s locale ([9b249956](https://github.com/w3c/epubcheck/commit/9b249956)), closes #650, #498 +* report invalid `dc:identifier` UUIDs validation (as `WARNING`) ([48800a04](https://github.com/w3c/epubcheck/commit/48800a04)), closes #853 +* change `--version` and `-version` command line options to output EPUBCheck version ([e498c61d](https://github.com/w3c/epubcheck/commit/e498c61d)), closes #743 +* check files with extensions other than `.epub` ([1b67e046](https://github.com/w3c/epubcheck/commit/1b67e046)), closes #490 +* report `file://` URL as `INFO` ([8f7a2b7d](https://github.com/w3c/epubcheck/commit/8f7a2b7d)), closes #289 +* improve messages for `OPF-058` and `OPF-059` ([5e33645e](https://github.com/w3c/epubcheck/commit/5e33645e)), closes #804 +* enable `NCX_001` check also for EPUB 3 when an NCX file is present ([9715c352](https://github.com/w3c/epubcheck/commit/9715c352)) +* report non-matching identifiers in OPF and NCX as an error again ([515682dc](https://github.com/w3c/epubcheck/commit/515682dc)) +* improved css font size validation ([25c0b372](https://github.com/w3c/epubcheck/commit/25c0b372)), closes #529 +* issue a `WARNING` when landmarks anchors are not unique ([557308ef](https://github.com/w3c/epubcheck/commit/557308ef)), closes #493 +* issue a `WARNING` when guide/reference elements are not unique ([25f28c01](https://github.com/w3c/epubcheck/commit/25f28c01)), closes #493 +* partial update of OPF 2.0 RelaxNG schema to latest version (changing datatype `text` to `anyURI` for `href` attributes) ([251aa936](https://github.com/w3c/epubcheck/commit/251aa936)), closes #725 +* display error/warning count in EPUBCheck results ([b7babedf](https://github.com/w3c/epubcheck/commit/b7babedf)), closes #655 +* add file path info in `uri` attributes of the XML report ([c958c117](https://github.com/w3c/epubcheck/commit/c958c117)), closes #540 +* update the XHTML 1.1 RelaxNG schema to latest version ([4c6fb49a](https://github.com/w3c/epubcheck/commit/4c6fb49a)) +* update the OPF20 RNG schema in sync with official schema to validate empty guide elements ([6540b03d](https://github.com/w3c/epubcheck/commit/6540b03d)) +* report an `ERROR` when `@clipBegin` equals `@clipEnd` in SMIL Media Overlays ([00716768](https://github.com/w3c/epubcheck/commit/00716768)), closes #568 +* improve Nav Doc validation ([d32de854](https://github.com/w3c/epubcheck/commit/d32de854)), closes #763, #759 +* update the NCX RelaxNG schema to add fixed list of `pageTarget` type values ([b2c9e939](https://github.com/w3c/epubcheck/commit/b2c9e939)), closes #761 +* improve URL checks ([a44a596b](https://github.com/w3c/epubcheck/commit/a44a596b)), closes #708 +* rephrase messages `RSC-005`, `RSC-016`, `RSC-017` ([5ef44973](https://github.com/w3c/epubcheck/commit/5ef44973)) +* add JHove XSD schema declaration in XML output ([e55039c9](https://github.com/w3c/epubcheck/commit/e55039c9)), closes #736 +* add detailed resource info in `RSC-008` messages ([5f5ef7b7](https://github.com/w3c/epubcheck/commit/5f5ef7b7)), closes #720 +* add detailed resource info in `RSC-007` messages ([71a76ee4](https://github.com/w3c/epubcheck/commit/71a76ee4)), closes #475 + +### Maintenance + +* change the project name to 'EPUBCheck' ([dfd7fd27](https://github.com/w3c/epubcheck/commit/dfd7fd27)) +* update the minimum source code compatibility to Java 1.7 ([9b249956](https://github.com/w3c/epubcheck/commit/9b249956)) +* update the Saxon dependency to v9.8 ([bf10f380](https://github.com/w3c/epubcheck/commit/bf10f380)) +* update the Apache `commons-compress` dependency to v1.18 ([e7dfedd8](https://github.com/w3c/epubcheck/commit/e7dfedd8)) +* update the Google Guava dependency to v24.0 ([befd9fc3](https://github.com/w3c/epubcheck/commit/befd9fc3)) +* update the continuous integration build matrix, now testing from Java 7 up to Java 11 ([fb84b23c](https://github.com/w3c/epubcheck/commit/fb84b23c)) +* various translation updates ([39a9a093](https://github.com/w3c/epubcheck/commit/39a9a093), [6e3a8b41](https://github.com/w3c/epubcheck/commit/6e3a8b41)) diff -Nru epubcheck-4.0.2/debian/changelog epubcheck-4.1.0/debian/changelog --- epubcheck-4.0.2/debian/changelog 2018-02-16 11:04:57.000000000 +0000 +++ epubcheck-4.1.0/debian/changelog 2018-11-27 08:23:36.000000000 +0000 @@ -1,3 +1,15 @@ +epubcheck (4.1.0-1) unstable; urgency=medium + + * New upstream release + * d/rules: remove get-orig-source + * Drop saxonhe 9.8 patch + * Switch from cdbs to debhelper + * Update Standards-Version to 4.2.1.3 + * Update Vcs URLs to salsa + * Check files with extensions other than .epub (Closes: #773366) + + -- Eugene Zhukov Tue, 27 Nov 2018 10:23:36 +0200 + epubcheck (4.0.2-2) unstable; urgency=medium * Update Saxon-HE version patch diff -Nru epubcheck-4.0.2/debian/control epubcheck-4.1.0/debian/control --- epubcheck-4.0.2/debian/control 2018-02-16 11:04:57.000000000 +0000 +++ epubcheck-4.1.0/debian/control 2018-11-27 08:23:36.000000000 +0000 @@ -3,7 +3,7 @@ Priority: optional Maintainer: Debian XML/SGML Group Uploaders: Eugene Zhukov -Build-Depends: debhelper (>= 9), cdbs, +Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper, libcommons-compress-java, @@ -15,9 +15,9 @@ libxml-maven-plugin-java, libmaven-dependency-plugin-java, libjackson-json-java -Standards-Version: 3.9.8 -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/epubcheck.git -Vcs-Git: https://anonscm.debian.org/git/pkg-java/epubcheck.git +Standards-Version: 4.2.1.3 +Vcs-Browser: https://salsa.debian.org/java-team/epubcheck +Vcs-Git: https://salsa.debian.org/java-team/epubcheck.git Homepage: https://github.com/IDPF/epubcheck Package: epubcheck diff -Nru epubcheck-4.0.2/debian/maven.ignoreRules epubcheck-4.1.0/debian/maven.ignoreRules --- epubcheck-4.0.2/debian/maven.ignoreRules 2018-02-16 10:41:37.000000000 +0000 +++ epubcheck-4.1.0/debian/maven.ignoreRules 2018-11-27 08:23:36.000000000 +0000 @@ -6,4 +6,5 @@ org.apache.maven.plugins maven-release-plugin * * * * org.apache.maven.plugins maven-surefire-plugin * * * * org.codehaus.mojo license-maven-plugin * * * * +org.apache.maven.plugins maven-failsafe-plugin * * * * xmlunit xmlunit * * * * diff -Nru epubcheck-4.0.2/debian/patches/classpath.patch epubcheck-4.1.0/debian/patches/classpath.patch --- epubcheck-4.0.2/debian/patches/classpath.patch 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/debian/patches/classpath.patch 2018-11-27 08:23:36.000000000 +0000 @@ -0,0 +1,22 @@ +Description: Set classpath for Debian systems + +--- epubcheck-4.1.0.orig/pom.xml ++++ epubcheck-4.1.0/pom.xml +@@ -422,7 +422,6 @@ + maven-jar-plugin + 3.0.2 + +- ${project.artifactId} + + +@@ -431,7 +431,8 @@ + true + com.adobe.epubcheck.tool.Checker + true +- lib/ ++ custom ++ /usr/share/java/${artifact.artifactId}.${artifact.extension} + + ${project.build.directory}/classes/META-INF/MANIFEST.MF + diff -Nru epubcheck-4.0.2/debian/patches/compatibility_with_saxon_9.8.patch epubcheck-4.1.0/debian/patches/compatibility_with_saxon_9.8.patch --- epubcheck-4.0.2/debian/patches/compatibility_with_saxon_9.8.patch 2018-02-16 11:00:56.000000000 +0000 +++ epubcheck-4.1.0/debian/patches/compatibility_with_saxon_9.8.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -Description: Compatibility with Saxon-HE 9.7.0.10 - The patch is taken from the mentioned origin plus modified to use - Saxon-HE 9.7.0.10 everywhere. -Origin: https://github.com/IDPF/epubcheck/commit/21cd661a19b58084175c97cb0e46ffd38ff23c58 - ---- a/pom.xml -+++ b/pom.xml -@@ -159,7 +159,7 @@ - - net.sf.saxon - Saxon-HE -- 9.5.1-5 -+ 9.8.0-8 - - - org.apache.commons -@@ -372,7 +372,7 @@ - - net.sf.saxon - Saxon-HE -- 9.4 -+ 9.8.0-8 - - - ---- a/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java -+++ b/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java -@@ -9,7 +9,7 @@ - import java.util.List; - import java.util.Map; - --import net.sf.saxon.om.Name10Checker; -+import net.sf.saxon.om.NameChecker; - - import com.adobe.epubcheck.api.EPUBLocation; - import com.adobe.epubcheck.api.Report; -@@ -102,7 +102,7 @@ - { - // empty prefix - report.message(MessageId.OPF_004a, location); -- } else if (!Name10Checker.getInstance().isValidNCName(chars)) -+ } else if (!NameChecker.isValidNCName(chars)) - { - // bad prefix - report.message(MessageId.OPF_004b, location, chars); ---- a/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java -+++ b/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java -@@ -56,6 +56,9 @@ - import net.sf.saxon.TransformerFactoryImpl; - import net.sf.saxon.sxpath.IndependentContext; - import net.sf.saxon.sxpath.XPathStaticContext; -+import net.sf.saxon.trans.SymbolicName; -+import net.sf.saxon.om.StandardNames; -+ - - public class XMLValidator - { -@@ -171,19 +174,22 @@ - public void initTransformerFactory(TransformerFactory factory) - { - super.initTransformerFactory(factory); -+ SymbolicName.F lineNumberFn = new SymbolicName.F(LineNumberFunction.QNAME, 0); -+ SymbolicName.F columnNumberFn = new SymbolicName.F(ColumnNumberFunction.QNAME, 0); -+ SymbolicName.F systemIdFn = new SymbolicName.F(SystemIdFunction.QNAME, 0); - if (factory instanceof TransformerFactoryImpl) - { - Configuration configuration = ((TransformerFactoryImpl) factory).getConfiguration(); - XPathStaticContext xpathContext = new IndependentContext(configuration); -- if (!xpathContext.getFunctionLibrary().isAvailable(LineNumberFunction.QNAME, -1)) -+ if (!xpathContext.getFunctionLibrary().isAvailable(lineNumberFn)) - { - configuration.registerExtensionFunction(new LineNumberFunction()); - } -- if (!xpathContext.getFunctionLibrary().isAvailable(ColumnNumberFunction.QNAME, -1)) -+ if (!xpathContext.getFunctionLibrary().isAvailable(columnNumberFn)) - { - configuration.registerExtensionFunction(new ColumnNumberFunction()); - } -- if (!xpathContext.getFunctionLibrary().isAvailable(SystemIdFunction.QNAME, -1)) -+ if (!xpathContext.getFunctionLibrary().isAvailable(systemIdFn)) - { - configuration.registerExtensionFunction(new SystemIdFunction()); - } ---- a/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java -+++ b/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java -@@ -21,7 +21,7 @@ - } - - @Override -- public SequenceIterator iterate() throws -+ public SequenceIterator iterate() throws - XPathException - { - return item.iterate(); ---- a/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java -+++ b/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java -@@ -94,7 +94,7 @@ - } - - @Override -- public SequenceIterator iterate() throws -+ public SequenceIterator iterate() throws - XPathException - { - return item.iterate(); diff -Nru epubcheck-4.0.2/debian/patches/fixed_classpath.patch epubcheck-4.1.0/debian/patches/fixed_classpath.patch --- epubcheck-4.0.2/debian/patches/fixed_classpath.patch 2018-02-16 10:41:37.000000000 +0000 +++ epubcheck-4.1.0/debian/patches/fixed_classpath.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,17 +0,0 @@ -Description: pom.xml changes for Debian - * classpath fixed for Debian -Author: Eugene Zhukov -Last-Update: 2014-09-16 - ---- a/pom.xml -+++ b/pom.xml -@@ -405,7 +405,8 @@ - true - com.adobe.epubcheck.tool.Checker - true -- lib/ -+ custom -+ /usr/share/java/${artifact.artifactId}.${artifact.extension} - - ${project.build.directory}/classes/META-INF/MANIFEST.MF - diff -Nru epubcheck-4.0.2/debian/patches/series epubcheck-4.1.0/debian/patches/series --- epubcheck-4.0.2/debian/patches/series 2018-02-16 11:04:14.000000000 +0000 +++ epubcheck-4.1.0/debian/patches/series 2018-11-27 08:23:36.000000000 +0000 @@ -1,2 +1 @@ -fixed_classpath.patch -compatibility_with_saxon_9.8.patch +classpath.patch diff -Nru epubcheck-4.0.2/debian/rules epubcheck-4.1.0/debian/rules --- epubcheck-4.0.2/debian/rules 2018-02-16 10:41:37.000000000 +0000 +++ epubcheck-4.1.0/debian/rules 2018-11-27 08:23:36.000000000 +0000 @@ -1,20 +1,13 @@ #!/usr/bin/make -f -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/maven.mk -JAVA_HOME := /usr/lib/jvm/default-java +%: + dh $@ --buildsystem=maven -THE_DATE := $(shell date -d "$$(dpkg-parsechangelog -SDate)" +%Y-%m-%d) -DEB_MAVEN_ARGS := -Dmaven.build.timestamp=$(THE_DATE) - -binary-post-install/epubcheck:: - mh_installjar -pepubcheck -l pom.xml target/epubcheck.jar +override_dh_fixperms:: + dh_fixperms chmod +x debian/epubcheck/usr/share/java/epubcheck.jar debian/epubcheck.1: debian/epubcheck.1.in help2man --include=$< --output=$@ \ --no-info --help-option="-help" \ - `basename $@ .1` --version-string=$(DEB_UPSTREAM_VERSION) - -get-orig-source: - uscan --download-current-version --rename --repack + `basename $@ .1` --version-string=4.1.0 diff -Nru epubcheck-4.0.2/pom.xml epubcheck-4.1.0/pom.xml --- epubcheck-4.0.2/pom.xml 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/pom.xml 2018-11-26 10:49:29.000000000 +0000 @@ -11,14 +11,14 @@ org.idpf epubcheck - 4.0.2 + 4.1.0 jar - EpubCheck :: Validation Tool for EPUB - EpubCheck is a tool to validate IDPF EPUB files. It can detect many types of errors in EPUB. + EPUBCheck :: Validation Tool for EPUB + EPUBCheck is a tool to validate IDPF 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 as a standalone command-line tool, installed as a Java server-side web application + EPUBCheck can be run as a standalone command-line tool, installed as a Java server-side web application or used as a Java library. http://code.google.com/p/epubcheck/ 2007 @@ -129,10 +129,14 @@ - epubcheck discussion - http://groups.google.com/group/epubcheck/subscribe - epubcheck+unsubscribe@googlegroups.com - epubcheck@googlegroups.com + EPUBCheck discussion + mailto:public-epubcheck-request@w3.org?subject=subscribe + mailto:public-epubcheck-request@w3.org?subject=unsubscribe + public-epubcheck@w3.org + https://lists.w3.org/Archives/Public/public-epubcheck/ + + + ARCHIVE: epubcheck discussion https://groups.google.com/forum/#!forum/epubcheck @@ -140,7 +144,7 @@ scm:git:ssh://git@github.com:IDPF/epubcheck.git scm:git:ssh://git@github.com:IDPF/epubcheckgit https://github.com/IDPF/epubcheck - v4.0.2 + v4.1.0 Github @@ -148,23 +152,27 @@ - 1.6 + 1.7 UTF-8 UTF-8 yyyy-MM-dd ${maven.build.timestamp} + + 3.0 + + net.sf.saxon Saxon-HE - 9.5.1-5 + 9.8.0-8 org.apache.commons commons-compress - 1.5 + 1.18 org.tukaani @@ -197,7 +205,7 @@ com.google.guava guava - 14.0.1 + 24.0-android com.twelvemonkeys.imageio @@ -249,7 +257,7 @@ org.apache.maven.plugins maven-dependency-plugin - 2.6 + 3.0.2 copy @@ -268,7 +276,7 @@ org.apache.maven.plugins maven-compiler-plugin - 2.3.2 + 3.7.0 ${java.version} ${java.version} @@ -277,7 +285,7 @@ org.apache.felix maven-bundle-plugin - 2.3.7 + 2.5.4 true @@ -297,7 +305,7 @@ org.apache.maven.plugins maven-surefire-plugin - 2.12.4 + 2.18.1 -Xmx1g -Duser.language=en ${project.build.directory}/test-classes @@ -337,9 +345,22 @@ + org.apache.maven.plugins + maven-failsafe-plugin + 2.22.1 + + + + integration-test + verify + + + + + org.codehaus.mojo xml-maven-plugin - 1.0 + 1.0.1 @@ -379,7 +400,7 @@ org.codehaus.mojo license-maven-plugin - 1.3 + 1.14 thirdparty-licenses @@ -399,7 +420,7 @@ org.apache.maven.plugins maven-jar-plugin - 2.4 + 3.0.2 ${project.artifactId} @@ -433,7 +454,7 @@ org.apache.maven.plugins maven-release-plugin - 2.4.2 + 2.5.3 org.apache.maven.scm @@ -448,7 +469,7 @@ org.apache.maven.plugins maven-assembly-plugin - 2.3 + 3.1.0 dist-assembly diff -Nru epubcheck-4.0.2/README.md epubcheck-4.1.0/README.md --- epubcheck-4.0.2/README.md 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/README.md 2018-11-26 10:49:29.000000000 +0000 @@ -1,67 +1,78 @@ -EpubCheck [![Release](https://img.shields.io/github/release/idpf/epubcheck.svg)](https://github.com/idpf/epubcheck/releases/latest) -========= - -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 -as a standalone command-line tool or used as a Java library. - +[![Current Release](https://img.shields.io/github/release/w3c/epubcheck.svg)](https://github.com/w3c/epubcheck/releases/latest) [![Github All Releases Downloads](https://img.shields.io/github/downloads/w3c/epubcheck/total.svg?colorB=A9A9A9)](https://github.com/w3c/epubcheck/releases/) [![Build Status](https://travis-ci.org/w3c/epubcheck.svg?branch=master)](https://travis-ci.org/w3c/epubcheck/) -## Downloads -Check the [releases page](https://github.com/IDPF/epubcheck/releases) to get the latest distribution. +EPUBCheck +========= -[EpubCheck 4.0.1](https://github.com/IDPF/epubcheck/releases/tag/v4.0.1) is the latest recommended version to validate both EPUB 2 and 3 files. +EPUBCheck is a tool to validate the conformance of EPUB publications against the EPUB specifications. +EPUBCheck can be run as a standalone command-line tool or used as a Java library. +EPUBCheck is open source software, maintained by the [DAISY Consortium](http://www.daisy.org) for the [W3C](https://www.w3.org/publishing/epubcheck_fundraising). -## Documentation -Documentation on how to **use** EpubCheck, to **contribute** to the project or to **translate** messages is available on the [EpubCheck wiki](https://github.com/IDPF/epubcheck/wiki). +**We Need Your Support!!** +Financial support is critical to the development of EPUBCheck, the tool we all use to validate EPUB files. +We need to make sure that the resources are adequate to both update the tool and provide for its continued maintenance over the next two years; +please [help us fund and support EPUBCheck](https://www.w3.org/publishing/epubcheck_fundraising), and join the [list of donators](#donators)! -Technical discussions are hosted on the [EpubCheck Google Group](https://groups.google.com/forum/#!forum/epubcheck) +## Downloads -## Credits +Check the [releases page](https://github.com/w3c/epubcheck/releases) to get the latest distribution. -EpubCheck is a project coordinated by [IDPF](http://idpf.org/). Most of the EpubCheck functionality comes from the schema validation tool [Jing](http://www.thaiopensource.com/relaxng/jing.html) and schemas that were developed by [IDPF](http://www.idpf.org/) and [DAISY](http://www.daisy.org/). Initial EpubCheck development was largely done at [Adobe Systems](http://www.adobe.com/). +[EPUBCheck 4.0.2](https://github.com/w3c/epubcheck/releases/tag/v4.0.2) is the latest recommended version to validate both EPUB 2 and 3 files. -Authors and contributors to EpubCheck include: - * Peter Sorotokin - * Garth Conboy - * Markus Gylling - * Piotr Kula - * Paul Norton - * Jessica Hekman - * Liza Daly - * George Bina - * Bogdan Iordache - * Romain Deltour - * Thomas Ledoux - * Tobias Fischer - * Steve Antoch - * Arwen Pond - * Masayoshi Takahashi - * Satoshi KOJIMA +## Documentation -## License +Documentation on how to **use** EPUBCheck, to **contribute** to the project or to **translate** messages is available on the [EPUBCheck wiki](https://github.com/w3c/epubcheck/wiki). -EpubCheck is made available under the terms of the [New BSD License](http://opensource.org/licenses/BSD-3-Clause) +Technical discussions are held on our public [mailing list](https://lists.w3.org/Archives/Public/public-epubcheck/). To subscribe to the mailing list, send an email with subject `subscribe` to [public-epubcheck-request@w3.org](mailto:public-epubcheck-request@w3.org?subject=subscribe). To participate in the discussion, simply send an email to [public-epubcheck@w3.org](mailto:public-epubcheck-request@w3.org). ----- +Historical archives of discussions prior to October 2017 are stored at the old [EPUBCheck Google Group](https://groups.google.com/forum/#!forum/epubcheck). -## Building EpubCheck -[![Build Status](https://travis-ci.org/IDPF/epubcheck.svg?branch=master)](https://travis-ci.org/IDPF/epubcheck/) +## 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) +To build epubcheck from the sources you need Java Development Kit (JDK) 1.7 or above and [Apache Maven](http://maven.apache.org/) 3.0 or above installed. You will also need Python to be able to run the BookReporter and related tools. - Build and run tests: ``` $ mvn install ``` Will copy `.*jar` files and packages to `target/` folder... + +## Credits + +Most of the EPUBCheck functionality comes from the schema validation tool [Jing](http://www.thaiopensource.com/relaxng/jing.html) and schemas that were developed by [IDPF](http://www.idpf.org/) and [DAISY](http://www.daisy.org/). Initial EPUBCheck development was largely done at [Adobe Systems](http://www.adobe.com/). + +Initial (pre 2012) authors and contributors to EPUBCheck include: Peter Sorotokin, Garth Conboy, Markus Gylling, Piotr Kula, Paul Norton, Jessica Hekman, Liza Daly, George Bina, Bogdan Iordache, Ionut-Maxim Margelatu + +EPUBCheck 4.0 was largely developed by +* [DAISY](http://www.daisy.org/), namely: Romain Deltour, Markus Gylling +* [Barnes & Noble](https://www.barnesandnoble.com), namely: Steve Antoch, Arwen Pond + +Regular contributors between 2012 and 2017 include: Romain Deltour, Tobias Fischer, Markus Gylling, Satoshi KOJIMA, Thomas Ledoux, Masayoshi Takahashi + +Many thanks are also extended to the numerous people who have contributed to the evolution of EPUBCheck through bug reports and patches! + +## Donators + +The following organizations are supporting the development of EPUBCheck by their contribution to the [fundraising initiative](https://www.w3.org/publishing/epubcheck_fundraising): + +

+ DAISY + Publizon A/S + Wiley + Hachette Livre + LearningMate Solutions Inc + Voyager Japan, Inc. + W. W. Norton + Lumina Datamatics, Inc. +

+ +## License + +EPUBCheck is made available under the terms of the [New BSD License](http://opensource.org/licenses/BSD-3-Clause) diff -Nru epubcheck-4.0.2/src/build/transifex-pull.sh epubcheck-4.1.0/src/build/transifex-pull.sh --- epubcheck-4.0.2/src/build/transifex-pull.sh 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/build/transifex-pull.sh 2018-11-26 10:49:29.000000000 +0000 @@ -1,51 +1,55 @@ #!/bin/bash # bash script to update and normalize -# pulled transifex properties files -# +# pulled transifex properties files +# # Author: Tobias Fischer (https://github.com/tofi86) -# Project: IDPF/EpubCheck (https://github.com/IDPF/epubcheck) -# -# Date: 2015-10-09 +# Project: IDPF/EPUBCheck (https://github.com/IDPF/epubcheck) +# +# Date: 2018-08-25 # License: MIT License -# +# param1=$1 function escapeISO88591() { file=$1 + echo "- Escaping ISO-8859-1 encodings with Unicode escapes" native2ascii -encoding ISO-8859-1 ${file} ${file} + + # replace ' -> '' (#748) but not in lines starting with # (comments) + sed -E -i -- "/^#/! s/'/''/g" ${file} } function removeJavaEscapes() { file=$1 - + # replace \\ -> \, \` -> `, \= -> =, \: -> :, \! -> ! sed -E -i -- 's/\\([\\`=:!])/\1/g' ${file} - + # make unicode escapes \u00fc uppercase \u00FC perl -i -pe 's/\\u([0-9a-f]{4})/\\u\U\1/g' ${file} - + # replace newlines in help_text sed -E -i -- '/^help_text/s/((\\n)+)/\1\\\'$'\n /g' ${file} sed -E -i -- 's/^( )([[:space:]]+)/\1\\\2/g' ${file} - + # remove temp file rm ${file}-- 2> /dev/null } function processFile() { file=$1 - + echo "" echo "Processing file '${file}'" file ${file} | grep 'ISO-8859' > /dev/null if [ $? -eq 0 ]; then escapeISO88591 ${file} fi - + removeJavaEscapes ${file} } @@ -66,6 +70,15 @@ fi +# Check for Java 8 to export $JAVA_HOME for native2ascii binary +if /usr/libexec/java_home -v1.8 > /dev/null; then + export JAVA_HOME=$(/usr/libexec/java_home -v1.8) +else + echo "FATAL: You need to have JDK 8 installed in order to run this script!" + exit 1 +fi + + # Show help if no language parameter is passed to the script or --help if [[ -z ${param1} || ${param1} == "--help" ]] ; then echo "usage: transifex-pull.sh [--all | <2-digit-country-code>]" @@ -76,15 +89,15 @@ # Pull ALL translations elif [ ${param1} == "--all" ] ; then minimum_percent_translated=$(awk -F "=" '/minimum_perc/ {print $2}' .tx/config) - echo "Pulling ALL epubcheck translations (>${minimum_percent_translated}% done) from Transifex..." + echo "Pulling ALL EPUBCheck translations (>${minimum_percent_translated}% done) from Transifex..." echo "" - tx pull -f | tee /dev/stderr | grep "> [a-z][a-z]: " | awk '{print $3}' | while read f; do processFile ${f}; done + tx pull -f | tee /dev/stderr | grep "> [a-z][a-z]: " | awk '{print $NF}' | while read f; do processFile ${f}; done # Pull translations for a 2-digit-language-code elif [ ${#param1} -eq 2 ] ; then - echo "Pulling epubcheck translation '${param1}' from Transifex..." + echo "Pulling EPUBCheck translation '${param1}' from Transifex..." echo "" - tx pull -f -l ${param1} | tee /dev/stderr | grep "${param1}: " | awk '{print $3}' | while read f; do processFile ${f}; done + tx pull -f -l ${param1} | tee /dev/stderr | grep "${param1}: " | awk '{print $NF}' | while read f; do processFile ${f}; done else echo "FATAL: Couldn't recognize language code '${param1}'. Exit." diff -Nru epubcheck-4.0.2/src/main/assembly/dist.xml epubcheck-4.1.0/src/main/assembly/dist.xml --- epubcheck-4.0.2/src/main/assembly/dist.xml 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/assembly/dist.xml 2018-11-26 10:49:29.000000000 +0000 @@ -11,6 +11,9 @@ COPYING.txt + CHANGELOG.md + + src/main/assembly/README-dist.txt README.txt diff -Nru epubcheck-4.0.2/src/main/assembly/README-dist.txt epubcheck-4.1.0/src/main/assembly/README-dist.txt --- epubcheck-4.0.2/src/main/assembly/README-dist.txt 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/assembly/README-dist.txt 2018-11-26 10:49:29.000000000 +0000 @@ -1,60 +1,92 @@ -This folder contains the distribution of epubcheck project. +EPUBCheck +========= -EpubCheck is a tool to validate IDPF 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 -as a standalone command-line tool, installed as a web application or -used as a library. +This folder contains the distribution of the EPUBCheck project. -EpubCheck project home: https://github.com/idpf/epubcheck +EPUBCheck is a tool to validate the conformance of EPUB publications against +the EPUB specifications. EPUBCheck can be run as a standalone command-line tool +or used as a Java library. + +EPUBCheck project home: https://github.com/idpf/epubcheck RUNNING +------- + +To run the tool you need a Java runtime (1.7 or above). +Any Operating System should do. + +Run it from the command line: + +> java -jar epubcheck.jar file.epub -To run the tool you need Java Runtime (1.6 or above). Any OS should do. Run -it from the command line: +All detected errors are simply printed to the standard error stream. -java -jar epubcheck.jar file.epub +Print the commandline help with the --help argument: -All detected errors are simply printed to stderr. +> java -jar epubcheck.jar --help USING AS A LIBRARY +------------------ -You can also use EpubCheck as a library in your Java application. EpubCheck -public interfaces can be found in com.adobe.epubcheck.api package. EpubCheck -class can be used to instantiate a validation engine. Use one of its -constructors and then call validate() method. Report is an interface that -you can implement to get a list of the errors and warnings reported by the +You can also use EPUBCheck as a library in your Java application. EPUBCheck +public interfaces can be found in the `com.adobe.epubcheck.api package`. +EPUBCheck class can be used to instantiate a validation engine. Use one of its +constructors and then call validate() method. Report is an interface that you +can implement to get a list of the errors and warnings reported by the validation engine (instead of the error list being printed out). LICENSING +--------- -See COPYING.txt and THIRD-PARTY.txt +EPUBCheck is made available under the terms of the New BSD License. + +See details in COPYING.txt and THIRD-PARTY.txt AUTHORS / CONTRIBUTORS +---------------------- + +This distribution of EPUBCheck was made by the DAISY Consortium, for the W3C. + +Previous contributors include: -Peter Sorotokin -Garth Conboy -Markus Gylling -Piotr Kula -Paul Norton -Jessica Hekman -Liza Daly -George Bina -Bogdan Iordache -Ionut-Maxim Margelatu -Romain Deltour -Thomas Ledoux -Tobias Fischer -Steve Antoch -Arwen Pond -Masayoshi Takahashi -Satoshi KOJIMA - - -Most of the EpubCheck functionality comes from the schema validation tool Jing -and schemas that were developed by IDPF and DAISY. EpubCheck development was -largely done at Adobe Systems. +- Alberto Pettarin +- Alexander Walters +- Andrew Neitsch +- Arwen Pond +- Bogdan Iordache +- Dave Cramer +- dilbirligi +- Emiliano Molina +- Francisco Sanchez +- Garth Conboy +- George Bina +- Ionut-Maxim Margelatu +- Jessica Hekman +- Jostein Austvik Jacobsen +- Liza Daly +- Markus Gylling +- Martin Kraetke +- Masayoshi Takahashi +- Matt Garrish +- MURATA Makoto +- Paul Norton +- Peter Sorotokin +- Piotr Kula +- Romain Deltour +- Satoshi KOJIMA +- Stephan Kreutzer +- Steve Antoch +- Thomas Ledoux +- Tobias Fischer +- Tomohiko Hayashi +- Tzviya Siegman + + +Most of the EPUBCheck functionality comes from the schema validation tool Jing +and schemas that were developed by IDPF and DAISY. Initial EPUBCheck development +was largely done at Adobe Systems. EPUBCheck 4.0 was largely developed by +DAISY and Barnes & Noble. diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/EpubCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/EpubCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/EpubCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/EpubCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -28,6 +28,8 @@ import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; +import java.util.List; +import java.util.Locale; import java.util.Properties; import java.util.zip.ZipFile; @@ -37,9 +39,11 @@ import com.adobe.epubcheck.ocf.OCFPackage; import com.adobe.epubcheck.ocf.OCFZipPackage; import com.adobe.epubcheck.opf.DocumentValidator; +import com.adobe.epubcheck.opf.OPFData; import com.adobe.epubcheck.opf.ValidationContext.ValidationContextBuilder; import com.adobe.epubcheck.util.CheckUtil; import com.adobe.epubcheck.util.DefaultReportImpl; +import com.adobe.epubcheck.util.EPUBVersion; import com.adobe.epubcheck.util.ResourceUtil; import com.adobe.epubcheck.util.WriterReportImpl; @@ -180,6 +184,19 @@ } } } + + /** + * Allows for a per-instance override of the locale, if supported by the underlying + * {@link Report}. Otherwise takes the default host locale. + * @param locale The overridden locale. + */ + public void setLocale(Locale locale) + { + if(locale != null && report != null && report instanceof LocalizableReport) + { + ((LocalizableReport) report).setLocale(locale); + } + } /** * Validate the file. Return true if no errors or warnings found. @@ -196,9 +213,6 @@ FileInputStream epubIn = null; try { - String extension = ResourceUtil.getExtension(epubFile.getName()); - checkExtension(extension); - if (!epubFile.exists()) { report.message(MessageId.PKG_018, EPUBLocation.create(epubFile.getName())); @@ -214,6 +228,9 @@ .profile(profile).build()); checker.runChecks(); + String extension = ResourceUtil.getExtension(epubFile.getName()); + checkExtension(ocf, extension); + /*** Here are called custom checks (CTC Package) **/ CheckManager c = new CheckManager(zip, report); c.checkPackage(); @@ -245,7 +262,7 @@ return returnValue; } - void checkExtension(String extension) + void checkExtension(OCFPackage ocf, String extension) { if (extension != null) { @@ -257,7 +274,12 @@ } else { - report.message(MessageId.PKG_017, EPUBLocation.create(epubFile.getName(), extension)); + List opfPaths = ocf.getOcfData().getEntries(OPFData.OPF_MIME_TYPE); + if(ocf.getOpfData().get(opfPaths.get(0)).getVersion() == EPUBVersion.VERSION_3) { + report.message(MessageId.PKG_024, EPUBLocation.create(epubFile.getName(), extension)); + } else { + report.message(MessageId.PKG_017, EPUBLocation.create(epubFile.getName(), extension)); + } } } } @@ -308,6 +330,10 @@ { report.message(MessageId.PKG_006, EPUBLocation.create(epubFile.getName())); } + else if (!CheckUtil.checkString(header, 38, "application/epub+zip")) + { + report.message(MessageId.PKG_007, EPUBLocation.create("mimetype")); + } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/LocalizableReport.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/LocalizableReport.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/LocalizableReport.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/LocalizableReport.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,21 @@ +package com.adobe.epubcheck.api; + +import java.util.Locale; + +/** + * Extends the {@link Report} interface with a method to configure the locale + * used to report messages. + */ +public interface LocalizableReport extends Report +{ + + /** + * Sets the locale to use in the report's messages + */ + public void setLocale(Locale locale); + + /** + * Gets the locale to use in the report's messages + */ + public Locale getLocale(); +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/MasterReport.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/MasterReport.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/MasterReport.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/MasterReport.java 2018-11-26 10:49:29.000000000 +0000 @@ -7,22 +7,28 @@ import org.codehaus.jackson.annotate.JsonProperty; import com.adobe.epubcheck.messages.Message; +import com.adobe.epubcheck.messages.LocaleHolder; +import com.adobe.epubcheck.messages.LocalizedMessageDictionary; import com.adobe.epubcheck.messages.MessageDictionary; import com.adobe.epubcheck.messages.MessageId; +import com.adobe.epubcheck.messages.OverriddenMessageDictionary; import com.adobe.epubcheck.messages.Severity; +import com.adobe.epubcheck.util.Messages; import com.adobe.epubcheck.util.ReportingLevel; +import java.util.Locale; /** - * 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. + * 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 abstract class MasterReport implements LocalizableReport { public static Set allReportedMessageIds = new HashSet(); - int errorCount, warningCount, fatalErrorCount, usageCount = 0; - int reportingLevel = ReportingLevel.Info; + private int errorCount, warningCount, fatalErrorCount, usageCount, infoCount = 0; + private int reportingLevel = ReportingLevel.Info; private String ePubName; - private MessageDictionary dictionary = new MessageDictionary(null, this); + private MessageDictionary dictionary = new LocalizedMessageDictionary(); + private Messages messages; @Override public MessageDictionary getDictionary() @@ -30,14 +36,57 @@ return dictionary; } + /** + * Creates a report with a new {@code Messages} instance and sets the locale + * held in {@code LocaleHolder} to the default locale. + */ protected MasterReport() { + this(true); + } + + /** + * Creates a report with a new {@code Messages} instance and sets the locale + * held in {@code LocaleHolder} to the default locale only if the given flag is + * true. + * + * @param setLocale + * whether to update the locale held in {@code LocaleHolder} + */ + protected MasterReport(boolean setLocale) + { + messages = Messages.getInstance(); + if (setLocale) + { + LocaleHolder.set(Locale.getDefault()); + } } @Override + public void setLocale(Locale locale) + { + dictionary = new LocalizedMessageDictionary(locale); + messages = Messages.getInstance(locale); + // Note: we also store the locale statically (thread local) for libraries + // which are not locale-context aware (like Jing). + LocaleHolder.set(locale); + } + + @Override + public Locale getLocale() + { + return messages.getLocale(); + } + + public Messages getMessages() + { + return messages; + } + + @Override public void setOverrideFile(File overrideFile) { - getDictionary().setOverrideFile(overrideFile); + dictionary = new OverriddenMessageDictionary(overrideFile, this); } @JsonProperty @@ -72,6 +121,10 @@ { usageCount++; } + else if (severity.equals(Severity.INFO)) + { + infoCount++; + } this.message(message, location, args); } reportMessageId(id); @@ -139,6 +192,18 @@ } @Override + public int getInfoCount() + { + return infoCount; + } + + @Override + public int getUsageCount() + { + return usageCount; + } + + @Override public void close() { } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/QuietReport.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/QuietReport.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/QuietReport.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/QuietReport.java 2018-11-26 10:49:29.000000000 +0000 @@ -10,7 +10,7 @@ private QuietReport() { - super(); + super(false); } @Override diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/Report.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/Report.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/api/Report.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/api/Report.java 2018-11-26 10:49:29.000000000 +0000 @@ -70,6 +70,10 @@ public int getFatalErrorCount(); + public int getInfoCount(); + + public int getUsageCount(); + /** * Called to create a report after the checks have been made */ diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/css/CSSChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/css/CSSChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/css/CSSChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/css/CSSChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -166,16 +166,16 @@ { if (this.mode == Mode.FILE) { - new CssParser().parse(source, handler, handler); + new CssParser(context.locale).parse(source, handler, handler); } else { - new CssParser().parse(new StringReader(this.value), this.path, handler, handler); + new CssParser(context.locale).parse(new StringReader(this.value), this.path, handler, handler); } } else { - new CssParser() + new CssParser(context.locale) .parseStyleAttribute(new StringReader(this.value), this.path, handler, handler); } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/css/CSSHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/css/CSSHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/css/CSSHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/css/CSSHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -333,7 +333,9 @@ (((fontStyle != null) && !"normal".equalsIgnoreCase(fontStyle)) ? "," + fontStyle : "") + (((fontWeight != null) && !"normal".equalsIgnoreCase(fontWeight)) ? "," + fontWeight : "") ); - report.info(path, FeatureEnum.REFERENCE, fontUri); + if (fontUri != null) { + report.info(path, FeatureEnum.REFERENCE, fontUri); + } } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/CheckManager.java 2018-11-26 10:49:29.000000000 +0000 @@ -7,6 +7,13 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; import com.adobe.epubcheck.util.EPUBVersion; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class CheckManager { private final EpubPackage epack; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/ContentValidator.java 2018-11-26 10:49:29.000000000 +0000 @@ -4,7 +4,13 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; import com.adobe.epubcheck.opf.DocumentValidator; - +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public interface ContentValidator { public enum ValidationType diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorAttribute.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorAttribute.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorAttribute.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorAttribute.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,5 +1,12 @@ package com.adobe.epubcheck.ctc.css; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ class CSSSelectorAttribute { private final String name; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorCollection.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorCollection.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorCollection.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelectorCollection.java 2018-11-26 10:49:29.000000000 +0000 @@ -3,6 +3,13 @@ import javax.xml.stream.Location; import java.util.HashMap; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class CSSSelectorCollection { private final String name; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelector.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelector.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelector.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/CSSSelector.java 2018-11-26 10:49:29.000000000 +0000 @@ -3,6 +3,13 @@ import javax.xml.stream.Location; import java.util.HashMap; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class CSSSelector { private final String name; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/css/EpubCSSCheckCSSHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -27,6 +27,13 @@ import com.adobe.epubcheck.util.TextSearchDictionaryEntry; import com.google.common.base.Optional; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubCSSCheckCSSHandler implements CssContentHandler, CssErrorHandler { String path; @@ -544,11 +551,19 @@ { if (!isGlobalFixedFormat || hasIndividualFixedFormatDocuments) { + // report non-relative font-size keyword as ACC USAGE message String value = construct.toCssString().toLowerCase(Locale.ROOT); - if (("smaller".compareTo(value) != 0) && ("larger".compareTo(value) != 0) && ("inherit".compareTo(value) != 0)) + + // report not allowed font-size keyword as ERROR message + if (!isFontSize(construct)) + { + getReport().message(MessageId.CSS_020, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString()); + } + else if (("smaller".compareTo(value) != 0) && ("larger".compareTo(value) != 0) && ("inherit".compareTo(value) != 0)) { - getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString())); + getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString()); } + } break; } @@ -559,11 +574,17 @@ switch (quantity.getUnit()) { case EMS: + case EXS: case REMS: case PERCENTAGE: break; + case LENGTH: + // report absolute font-size as ACC USAGE message + getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString()); + break; default: - getReport().message(id, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString())); + // report unsupported font-size as ERROR message + getReport().message(MessageId.CSS_020, getCorrectedEPUBLocation(path, declaration.getLocation().getLine(), declaration.getLocation().getColumn(), declaration.toCssString()), construct.toCssString()); break; } } @@ -672,6 +693,7 @@ "xx-large", "larger", "smaller", + "inherit" }; fontSizes = getHashSetFromStrings(fontSizeStrings); } @@ -688,6 +710,7 @@ { case PERCENTAGE: case EMS: + case EXS: case LENGTH: return true; } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EntitySearch.java 2018-11-26 10:49:29.000000000 +0000 @@ -20,13 +20,15 @@ import com.adobe.epubcheck.ocf.EncryptionFilter; import com.adobe.epubcheck.util.EPUBVersion; -class EntitySearch +/** + * === WARNING ========================================== + * This class is scheduled to be refactored and integrated + * in another package. + * Please keep changes minimal (bug fixes only) until then. + * ======================================================== + */ +class EntitySearch extends TextSearch { - private final ZipFile zip; - private final Hashtable enc; - private final Report report; - private final EPUBVersion version; - static final Pattern entityPattern = Pattern.compile("&([A-Za-z0-9]+)([;|\\s])"); static final HashSet legalEntities2_0; static final HashSet legalEntities3_0; @@ -71,32 +73,9 @@ public EntitySearch(EPUBVersion version, ZipFile zip, Report report) { - this.zip = zip; - this.enc = new Hashtable(); - this.report = report; - this.version = version; + super(version, zip, report); } - InputStream getInputStream(String name) throws - IOException - { - ZipEntry entry = zip.getEntry(name); - if (entry == null) - { - return null; - } - InputStream in = zip.getInputStream(entry); - EncryptionFilter filter = enc.get(name); - if (filter == null) - { - return in; - } - if (filter.canDecrypt()) - { - return filter.decrypt(in); - } - return null; - } public Vector Search(String entry) { diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/Epub3StructureCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -11,6 +11,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class Epub3StructureCheck implements DocumentValidator { private final Report report; @@ -22,7 +29,6 @@ this.epack = epack; } - @Override public boolean validate() { diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCfiCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -15,7 +15,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; - +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubCfiCheck implements DocumentValidator { private final Report report; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCheckContentFactory.java 2018-11-26 10:49:29.000000000 +0000 @@ -4,6 +4,13 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; import com.adobe.epubcheck.opf.DocumentValidator; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubCheckContentFactory implements ContentValidator { static private final EpubCheckContentFactory instance = new EpubCheckContentFactory(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubCSSCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -4,6 +4,7 @@ import java.io.InputStream; import java.util.Collection; import java.util.Hashtable; +import java.util.Locale; import java.util.Vector; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -14,6 +15,7 @@ import org.idpf.epubcheck.util.css.CssSource; import com.adobe.epubcheck.api.EPUBLocation; +import com.adobe.epubcheck.api.LocalizableReport; import com.adobe.epubcheck.api.Report; import com.adobe.epubcheck.ctc.css.EpubCSSCheckCSSHandler; import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; @@ -28,6 +30,13 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; import com.adobe.epubcheck.util.TextSearchDictionaryEntry; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubCSSCheck implements DocumentValidator { final ZipFile zip; @@ -76,7 +85,9 @@ { InputStream inputStream = getInputStream(fileToParse); CssSource source = new CssSource(fileToParse, inputStream); - CssParser parser = new CssParser(); + CssParser parser = new CssParser( + (report instanceof LocalizableReport) ? ((LocalizableReport) report).getLocale() + : Locale.getDefault()); handler.setPath(fileToParse); parser.parse(source, handler, handler); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubExtLinksCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -18,7 +18,13 @@ import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; import com.adobe.epubcheck.util.TextSearchDictionaryEntry; - +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubExtLinksCheck implements DocumentValidator { private final Report report; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubHTML5StructureCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,6 +1,5 @@ package com.adobe.epubcheck.ctc; -import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.Hashtable; @@ -25,6 +24,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubHTML5StructureCheck implements DocumentValidator { static final int hasHtml = 1; @@ -52,7 +58,6 @@ { boolean result = false; SearchDictionary vtsd = new SearchDictionary(DictionaryType.VALID_TEXT_MEDIA_TYPES); - int landmarkNavCount = 0; boolean isGlobalFixed = EpubPackage.isGlobalFixed(this.epubPackage); Hashtable spineItems = new Hashtable(); @@ -147,14 +152,8 @@ report.info(null, FeatureEnum.HAS_HTML5, "true"); } } - landmarkNavCount += sh.getLandmarkNavCount(); } } - if (landmarkNavCount != 1 && epubPackage.getVersion() == EPUBVersion.VERSION_3) - { - File zipFile = new File(zip.getName()); - report.message(MessageId.ACC_008, EPUBLocation.create(zipFile.getName())); - } return result; } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubLangCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -14,6 +14,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubLangCheck implements DocumentValidator { private final ZipFile zip; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV2Check.java 2018-11-26 10:49:29.000000000 +0000 @@ -6,6 +6,13 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; import com.adobe.epubcheck.opf.DocumentValidator; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubMetaDataV2Check implements DocumentValidator { private final Document doc; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubMetaDataV3Check.java 2018-11-26 10:49:29.000000000 +0000 @@ -6,6 +6,13 @@ import com.adobe.epubcheck.ctc.epubpackage.EpubPackage; import com.adobe.epubcheck.opf.DocumentValidator; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubMetaDataV3Check implements DocumentValidator { diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubNavCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -25,6 +25,13 @@ import com.adobe.epubcheck.util.HandlerUtil; import com.adobe.epubcheck.util.PathUtil; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubNavCheck implements DocumentValidator { @@ -123,6 +130,8 @@ // no need to report an error here because it was already reported inside of the docParser. return false; } + + int landmarkNavCount = 0; NodeList n = doc.getElementsByTagName("nav"); for (int i = 0; i < n.getLength(); i++) @@ -160,9 +169,18 @@ { report.message(MessageId.NAV_002, EPUBLocation.create(navDocEntry, HandlerUtil.getElementLineNumber(navElement), HandlerUtil.getElementColumnNumber(navElement), "page-list")); } + else if (type.equals("landmarks")) + { + ++landmarkNavCount; + } } } + if (landmarkNavCount == 0) + { + report.message(MessageId.ACC_008, EPUBLocation.create(navDocEntry)); + } + PackageManifest manifest = epack.getManifest(); PackageSpine spine = epack.getSpine(); @@ -180,7 +198,7 @@ if (path != null && !path.equals(tocFileName) && !path.equals(navDocEntry) && !tocLinkSet.contains(path)) { - report.message(MessageId.OPF_058, EPUBLocation.create(navDocEntry, -1, -1, path)); + report.message(MessageId.OPF_058, EPUBLocation.create(navDocEntry, -1, -1, path), si.getIdref()); } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubNCXCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -23,6 +23,13 @@ import com.adobe.epubcheck.util.FeatureEnum; import com.adobe.epubcheck.util.PathUtil; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubNCXCheck implements DocumentValidator { private final XmlDocParser docParser; @@ -169,11 +176,11 @@ if (mi != null) { String path = mi.getHref(); - path = PathUtil.resolveRelativeReference(navDocEntry, path, null); + path = PathUtil.resolveRelativeReference(epack.getPackageMainFile(), path, null); if (path != null && !path.equals(tocFileName) && !path.equals(navDocEntry) && !tocLinkSet.contains(path)) { - report.message(MessageId.OPF_059, EPUBLocation.create(navDocEntry, path)); + report.message(MessageId.OPF_059, EPUBLocation.create(navDocEntry, path), si.getIdref()); } } else diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/EpubPackage.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/EpubPackage.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/EpubPackage.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/EpubPackage.java 2018-11-26 10:49:29.000000000 +0000 @@ -7,6 +7,13 @@ import java.io.File; import java.util.zip.ZipFile; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubPackage { private String packageMainFilePath; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/ManifestItem.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/ManifestItem.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/ManifestItem.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/ManifestItem.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,5 +1,12 @@ package com.adobe.epubcheck.ctc.epubpackage; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class ManifestItem { private String id; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/MetadataElement.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/MetadataElement.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/MetadataElement.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/MetadataElement.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,6 +2,13 @@ import java.util.HashMap; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class MetadataElement { private final HashMap attributes = new HashMap(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageManifest.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,6 +2,13 @@ import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class PackageManifest { private final Vector items = new Vector(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageMetadata.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageMetadata.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageMetadata.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageMetadata.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,6 +2,13 @@ import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class PackageMetadata { private final Vector m = new Vector(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageSpine.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageSpine.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageSpine.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/PackageSpine.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,6 +2,13 @@ import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class PackageSpine { private String toc; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/SpineItem.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/SpineItem.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/epubpackage/SpineItem.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/epubpackage/SpineItem.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,5 +1,12 @@ package com.adobe.epubcheck.ctc.epubpackage; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class SpineItem { private String idref; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubRenditionCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -10,6 +10,13 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubRenditionCheck implements DocumentValidator { private final Document doc; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubScriptCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -23,6 +23,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubScriptCheck implements DocumentValidator { private final ZipFile zip; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSpanCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -14,6 +14,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubSpanCheck implements DocumentValidator { private final ZipFile zip; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSpineCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -14,6 +14,13 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubSpineCheck implements DocumentValidator { private static final int MAX_SPINE_ITEM_THRESHOLD = 100; @@ -70,11 +77,14 @@ { if (e.getName().equals("meta")) { - String val = e.getAttribute("property"); + String prop = e.getAttribute("property"); + if (prop != null && prop.equalsIgnoreCase("rendition:layout")) { - if (val != null && val.equalsIgnoreCase("rendition:layout")) + // #727 NPE guard + String val = e.getValue(); + if (val != null && val.equalsIgnoreCase("pre-paginated")) { - isFixedFormat = e.getValue().equalsIgnoreCase("pre-paginated"); + isFixedFormat = true; break; } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubStyleSheetsCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -11,7 +11,13 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; - +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubStyleSheetsCheck implements DocumentValidator { private final Report report; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubSVGCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -16,6 +16,13 @@ import com.adobe.epubcheck.opf.DocumentValidator; import com.adobe.epubcheck.util.SearchDictionary; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubSVGCheck implements DocumentValidator { private static final String svgNS = "http://www.w3.org/2000/svg"; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubTextContentCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,5 +1,7 @@ package com.adobe.epubcheck.ctc; +import java.util.ArrayList; +import java.util.List; import java.util.zip.ZipEntry; import com.adobe.epubcheck.api.Report; @@ -9,16 +11,25 @@ import com.adobe.epubcheck.util.SearchDictionary; import com.adobe.epubcheck.util.SearchDictionary.DictionaryType; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubTextContentCheck implements DocumentValidator { private final Report report; private final EpubPackage epack; - private final EntitySearch search; + private final List search; public EpubTextContentCheck(Report report, EpubPackage epack) { this.epack = epack; - this.search = new EntitySearch(epack.getVersion(), epack.getZip(), report); + this.search = new ArrayList(); + this.search.add(new EntitySearch(epack.getVersion(), epack.getZip(), report)); + this.search.add(new FileLinkSearch(epack.getVersion(), epack.getZip(), report)); this.report = report; } @@ -40,7 +51,11 @@ // report.message(MessageId.RSC_001, EPUBLocation.create(this.epack.getFileName()), fileToParse); continue; } - this.search.Search(fileToParse); + + for(TextSearch ts : this.search) + { + ts.Search(fileToParse); + } } } return true; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/EpubTocCheck.java 2018-11-26 10:49:29.000000000 +0000 @@ -8,6 +8,13 @@ import com.adobe.epubcheck.opf.DocumentValidator; import com.adobe.epubcheck.util.EPUBVersion; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class EpubTocCheck implements DocumentValidator { private final String pathRootFile; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/FileLinkSearch.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/FileLinkSearch.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/FileLinkSearch.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/FileLinkSearch.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,89 @@ +package com.adobe.epubcheck.ctc; + +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 java.io.*; +import java.util.Scanner; +import java.util.Vector; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.zip.ZipFile; + +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ +public class FileLinkSearch extends TextSearch { + private static final Pattern fileLinkPattern = Pattern.compile("href=[\"']file://"); + + public FileLinkSearch(EPUBVersion version, ZipFile zip, Report report) + { + super(version, zip, report); + } + + @Override + Vector Search(String entry) + { + String fileName = new File(zip.getName()).getName(); + InputStream is = null; + BufferedReader br = null; + try + { + is = getInputStream(entry); + br = new BufferedReader(new InputStreamReader(is)); + + int lineCounter = 1; + String line; + while ((line = br.readLine()) != null) + { + Matcher matcher = fileLinkPattern.matcher(line); + int position = 0; + while (matcher.find(position)) + { + int contextStart = Math.max(0, matcher.start() - 20); + int contextEnd = Math.min(contextStart + 40, line.length() - 1); + String context = line.substring(contextStart, contextEnd); + + report.message(MessageId.HTM_053, EPUBLocation.create(entry, lineCounter, matcher.start(), context.trim()), context.trim()); + position = matcher.end(); + } + lineCounter++; + } + } + catch (FileNotFoundException e1) + { + report.message(MessageId.RSC_001, EPUBLocation.create(fileName), entry); + } + catch (IOException e1) + { + report.message(MessageId.PKG_008, EPUBLocation.create(fileName), entry); + } + catch (Exception e) + { + e.printStackTrace(); + report.message(MessageId.RSC_005, EPUBLocation.create(entry), e.getMessage()); + } + finally + { + silentlyClose(br); + silentlyClose(is); + } + return new Vector(); + } + + private void silentlyClose(Closeable c) { + try + { + c.close(); + } + catch (IOException ignored) + { + } + } +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/package-info.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/package-info.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/package-info.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,8 @@ +/** + * === WARNING ==========================================
+ * This package is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ======================================================== + */ +package com.adobe.epubcheck.ctc; \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/PackageReader.java 2018-11-26 10:49:29.000000000 +0000 @@ -18,6 +18,13 @@ import com.adobe.epubcheck.util.EPUBVersion; import com.adobe.epubcheck.util.EpubConstants; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ class PackageReader { private static final String containerEntry = "META-INF/container.xml"; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/TextSearch.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/TextSearch.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/TextSearch.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/TextSearch.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,57 @@ +package com.adobe.epubcheck.ctc; + +import com.adobe.epubcheck.api.Report; +import com.adobe.epubcheck.ocf.EncryptionFilter; +import com.adobe.epubcheck.util.EPUBVersion; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Hashtable; +import java.util.Vector; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ +abstract class TextSearch { + private final Hashtable enc; + final ZipFile zip; + final Report report; + final EPUBVersion version; + + + public TextSearch(EPUBVersion version, ZipFile zip, Report report) + { + this.zip = zip; + this.enc = new Hashtable(); + this.report = report; + this.version = version; + } + + InputStream getInputStream(String name) throws IOException + { + ZipEntry entry = zip.getEntry(name); + if (entry == null) + { + return null; + } + InputStream in = zip.getInputStream(entry); + EncryptionFilter filter = enc.get(name); + if (filter == null) + { + return in; + } + if (filter.canDecrypt()) + { + return filter.decrypt(in); + } + return null; + } + + abstract Vector Search(String entry); +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/AnchorTagHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/AnchorTagHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/AnchorTagHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/AnchorTagHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -8,6 +8,13 @@ import java.util.HashMap; import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class AnchorTagHandler extends DefaultHandler { diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/CSSStyleAttributeHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -17,11 +17,19 @@ import org.xml.sax.helpers.DefaultHandler; import com.adobe.epubcheck.api.EPUBLocation; +import com.adobe.epubcheck.api.LocalizableReport; 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; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class CSSStyleAttributeHandler extends DefaultHandler { String fileName; @@ -246,7 +254,9 @@ String s = currentStyleTag.getValue(); InputStream inputStream = new ByteArrayInputStream(s.getBytes("UTF-8")); CssSource source = new CssSource(this.getFileName(), inputStream); - CssParser parser = new CssParser(); + CssParser parser = new CssParser( + (report instanceof LocalizableReport) ? ((LocalizableReport) report).getLocale() + : Locale.getDefault()); handler.setPath(this.getFileName()); HashMap localStyleMap = localStyles.peek(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/Epub3StructureHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -9,6 +9,13 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class Epub3StructureHandler extends DefaultHandler { Locator locator; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/HTMLTagsAnalyseHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -22,6 +22,13 @@ import com.adobe.epubcheck.util.EpubConstants; import com.adobe.epubcheck.util.NamespaceHelper; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class HTMLTagsAnalyseHandler extends DefaultHandler { private String fileName; @@ -303,8 +310,9 @@ } else if ("nav".compareTo(tagName) == 0) { - String type = attributes.getValue(EpubConstants.EpubTypeNamespaceUri, "type"); - if (type != null && "landmark".compareToIgnoreCase(type) == 0) + String epubPrefix = namespaceHelper.findPrefixForUri(EpubConstants.EpubTypeNamespaceUri); + String type = attributes.getValue(epubPrefix+":type"); + if (type != null && "landmarks".compareToIgnoreCase(type) == 0) { ++landmarkNavCount; } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/LangAttributeHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/LangAttributeHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/LangAttributeHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/LangAttributeHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -4,6 +4,13 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.DefaultHandler; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class LangAttributeHandler extends DefaultHandler { diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/LinkTagHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -14,6 +14,13 @@ import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class LinkTagHandler extends DefaultHandler { private final Report report; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptElement.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptElement.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptElement.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptElement.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,6 +2,13 @@ import java.util.HashMap; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class ScriptElement { private final HashMap attrs = new HashMap(); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/ScriptTagHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -18,6 +18,13 @@ import com.adobe.epubcheck.util.EPUBVersion; import com.adobe.epubcheck.util.FeatureEnum; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class ScriptTagHandler extends DefaultHandler { private Locator locator; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/SpanTagHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/SpanTagHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/SpanTagHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/SpanTagHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -8,10 +8,15 @@ import java.util.Queue; import java.util.Vector; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class SpanTagHandler extends DefaultHandler { - - private Element currentElement = null; private Element topElement = null; private int generateMessage = 0; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/xml/XMLContentDocParser.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,9 +21,15 @@ import com.adobe.epubcheck.messages.MessageId; import com.adobe.epubcheck.ocf.EncryptionFilter; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ public class XMLContentDocParser { - private final ZipFile zip; private final Hashtable enc; private final Report report; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ctc/XmlDocParser.java 2018-11-26 10:49:29.000000000 +0000 @@ -29,6 +29,13 @@ import com.adobe.epubcheck.util.EpubConstants; import com.adobe.epubcheck.util.NamespaceHelper; +/** + * === WARNING ==========================================
+ * This class is scheduled to be refactored and integrated
+ * in another package.
+ * Please keep changes minimal (bug fixes only) until then.
+ * ========================================================
+ */ class XmlDocParser { private final ZipFile zip; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/DefaultSeverities.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,321 @@ +package com.adobe.epubcheck.messages; + +import java.util.EnumMap; +import java.util.Map; + +/** + * A container for handling the default mapping of message id to severity. + */ +class DefaultSeverities implements Severities +{ + + private static final Map severities = new EnumMap(MessageId.class); + + public DefaultSeverities() + { + initialize(); + } + + @Override + public Severity get(MessageId id) + { + Severity severity = severities.get(id); + if (severity == null) + { + //Indicates a programmer error + throw new IllegalArgumentException("Severity " + id.name() + " is invalid."); + } + return severity; + } + + private void initialize() + { + if (severities.isEmpty() == false) + { + return; + } + + // Accessibility + severities.put(MessageId.ACC_001, Severity.USAGE); + severities.put(MessageId.ACC_002, Severity.USAGE); + severities.put(MessageId.ACC_003, Severity.SUPPRESSED); + severities.put(MessageId.ACC_004, Severity.SUPPRESSED); + severities.put(MessageId.ACC_005, Severity.SUPPRESSED); + severities.put(MessageId.ACC_006, Severity.SUPPRESSED); + severities.put(MessageId.ACC_007, Severity.USAGE); + severities.put(MessageId.ACC_008, Severity.USAGE); + severities.put(MessageId.ACC_009, Severity.WARNING); + severities.put(MessageId.ACC_010, Severity.SUPPRESSED); + severities.put(MessageId.ACC_011, Severity.WARNING); + severities.put(MessageId.ACC_012, Severity.SUPPRESSED); + severities.put(MessageId.ACC_013, Severity.USAGE); + severities.put(MessageId.ACC_014, Severity.USAGE); + severities.put(MessageId.ACC_015, Severity.USAGE); + severities.put(MessageId.ACC_016, Severity.USAGE); + severities.put(MessageId.ACC_017, Severity.USAGE); + + // CHK + severities.put(MessageId.CHK_001, Severity.ERROR); + severities.put(MessageId.CHK_002, Severity.ERROR); + severities.put(MessageId.CHK_003, Severity.ERROR); + severities.put(MessageId.CHK_004, Severity.ERROR); + severities.put(MessageId.CHK_005, Severity.ERROR); + severities.put(MessageId.CHK_006, Severity.ERROR); + severities.put(MessageId.CHK_007, Severity.ERROR); + severities.put(MessageId.CHK_008, Severity.ERROR); + + // CSS + severities.put(MessageId.CSS_001, Severity.ERROR); + severities.put(MessageId.CSS_002, Severity.ERROR); + severities.put(MessageId.CSS_003, Severity.ERROR); + severities.put(MessageId.CSS_004, Severity.ERROR); + severities.put(MessageId.CSS_005, Severity.ERROR); + severities.put(MessageId.CSS_006, Severity.WARNING); + severities.put(MessageId.CSS_007, Severity.INFO); + severities.put(MessageId.CSS_008, Severity.ERROR); + severities.put(MessageId.CSS_009, Severity.USAGE); + severities.put(MessageId.CSS_010, Severity.ERROR); + severities.put(MessageId.CSS_011, Severity.SUPPRESSED); + severities.put(MessageId.CSS_012, Severity.USAGE); + severities.put(MessageId.CSS_013, Severity.USAGE); + severities.put(MessageId.CSS_015, Severity.ERROR); + severities.put(MessageId.CSS_016, Severity.SUPPRESSED); + severities.put(MessageId.CSS_017, Severity.WARNING); + severities.put(MessageId.CSS_019, Severity.WARNING); + severities.put(MessageId.CSS_020, Severity.ERROR); + severities.put(MessageId.CSS_021, Severity.USAGE); + severities.put(MessageId.CSS_022, Severity.USAGE); + severities.put(MessageId.CSS_023, Severity.USAGE); + severities.put(MessageId.CSS_024, Severity.USAGE); + severities.put(MessageId.CSS_025, Severity.USAGE); + severities.put(MessageId.CSS_027, Severity.USAGE); + severities.put(MessageId.CSS_028, Severity.USAGE); + + // HTML + severities.put(MessageId.HTM_001, Severity.ERROR); + severities.put(MessageId.HTM_002, Severity.WARNING); + severities.put(MessageId.HTM_003, Severity.ERROR); + severities.put(MessageId.HTM_004, Severity.ERROR); + severities.put(MessageId.HTM_005, Severity.USAGE); + severities.put(MessageId.HTM_006, Severity.USAGE); + severities.put(MessageId.HTM_007, Severity.WARNING); + severities.put(MessageId.HTM_008, Severity.ERROR); + severities.put(MessageId.HTM_009, Severity.ERROR); + severities.put(MessageId.HTM_010, Severity.USAGE); + severities.put(MessageId.HTM_011, Severity.ERROR); + severities.put(MessageId.HTM_012, Severity.USAGE); + severities.put(MessageId.HTM_013, Severity.USAGE); + severities.put(MessageId.HTM_014, Severity.WARNING); + severities.put(MessageId.HTM_014a, Severity.WARNING); + severities.put(MessageId.HTM_015, Severity.SUPPRESSED); + severities.put(MessageId.HTM_016, Severity.SUPPRESSED); + severities.put(MessageId.HTM_017, Severity.ERROR); + severities.put(MessageId.HTM_018, Severity.USAGE); + severities.put(MessageId.HTM_019, Severity.USAGE); + severities.put(MessageId.HTM_020, Severity.USAGE); + severities.put(MessageId.HTM_021, Severity.USAGE); + severities.put(MessageId.HTM_022, Severity.USAGE); + severities.put(MessageId.HTM_023, Severity.WARNING); + severities.put(MessageId.HTM_024, Severity.USAGE); + severities.put(MessageId.HTM_025, Severity.WARNING); + severities.put(MessageId.HTM_027, Severity.USAGE); + severities.put(MessageId.HTM_028, Severity.USAGE); + severities.put(MessageId.HTM_029, Severity.USAGE); + severities.put(MessageId.HTM_033, Severity.USAGE); + severities.put(MessageId.HTM_036, Severity.SUPPRESSED); + severities.put(MessageId.HTM_038, Severity.USAGE); + severities.put(MessageId.HTM_043, Severity.USAGE); + severities.put(MessageId.HTM_044, Severity.USAGE); + severities.put(MessageId.HTM_045, Severity.USAGE); + severities.put(MessageId.HTM_046, Severity.ERROR); + severities.put(MessageId.HTM_047, Severity.ERROR); + severities.put(MessageId.HTM_048, Severity.ERROR); + severities.put(MessageId.HTM_049, Severity.ERROR); + severities.put(MessageId.HTM_050, Severity.USAGE); + severities.put(MessageId.HTM_051, Severity.WARNING); + severities.put(MessageId.HTM_052, Severity.ERROR); + severities.put(MessageId.HTM_053, Severity.INFO); + + // Media + severities.put(MessageId.MED_001, Severity.ERROR); + severities.put(MessageId.MED_002, Severity.ERROR); + severities.put(MessageId.MED_003, Severity.ERROR); + severities.put(MessageId.MED_004, Severity.ERROR); + severities.put(MessageId.MED_005, Severity.ERROR); + severities.put(MessageId.MED_006, Severity.USAGE); + + // NAV + severities.put(MessageId.NAV_001, Severity.ERROR); + severities.put(MessageId.NAV_002, Severity.USAGE); + severities.put(MessageId.NAV_003, Severity.ERROR); + severities.put(MessageId.NAV_004, Severity.USAGE); + severities.put(MessageId.NAV_005, Severity.USAGE); + severities.put(MessageId.NAV_006, Severity.USAGE); + severities.put(MessageId.NAV_007, Severity.USAGE); + severities.put(MessageId.NAV_008, Severity.USAGE); + severities.put(MessageId.NAV_009, Severity.ERROR); + + // NCX + severities.put(MessageId.NCX_001, Severity.ERROR); + severities.put(MessageId.NCX_002, Severity.ERROR); + severities.put(MessageId.NCX_003, Severity.USAGE); + severities.put(MessageId.NCX_004, Severity.USAGE); + severities.put(MessageId.NCX_005, Severity.USAGE); + severities.put(MessageId.NCX_006, Severity.USAGE); + + // OPF + severities.put(MessageId.OPF_001, Severity.ERROR); + severities.put(MessageId.OPF_002, Severity.FATAL); + severities.put(MessageId.OPF_003, Severity.WARNING); + severities.put(MessageId.OPF_004, Severity.WARNING); + severities.put(MessageId.OPF_004a, Severity.ERROR); + severities.put(MessageId.OPF_004b, Severity.ERROR); + severities.put(MessageId.OPF_004c, Severity.ERROR); + severities.put(MessageId.OPF_004d, Severity.ERROR); + severities.put(MessageId.OPF_004e, Severity.WARNING); + severities.put(MessageId.OPF_004f, Severity.WARNING); + severities.put(MessageId.OPF_005, Severity.ERROR); + severities.put(MessageId.OPF_006, Severity.ERROR); + severities.put(MessageId.OPF_007, Severity.WARNING); + severities.put(MessageId.OPF_007a, Severity.ERROR); + severities.put(MessageId.OPF_007b, Severity.WARNING); + severities.put(MessageId.OPF_008, Severity.ERROR); + severities.put(MessageId.OPF_009, Severity.ERROR); + severities.put(MessageId.OPF_010, Severity.ERROR); + severities.put(MessageId.OPF_011, Severity.ERROR); + severities.put(MessageId.OPF_012, Severity.ERROR); + severities.put(MessageId.OPF_013, Severity.ERROR); + severities.put(MessageId.OPF_014, Severity.ERROR); + severities.put(MessageId.OPF_015, Severity.ERROR); + severities.put(MessageId.OPF_016, Severity.ERROR); + severities.put(MessageId.OPF_017, Severity.ERROR); + severities.put(MessageId.OPF_018, Severity.WARNING); + severities.put(MessageId.OPF_019, Severity.FATAL); + severities.put(MessageId.OPF_020, Severity.SUPPRESSED); + severities.put(MessageId.OPF_021, Severity.WARNING); + severities.put(MessageId.OPF_025, Severity.ERROR); + severities.put(MessageId.OPF_026, Severity.ERROR); + severities.put(MessageId.OPF_027, Severity.ERROR); + severities.put(MessageId.OPF_028, Severity.ERROR); + severities.put(MessageId.OPF_029, Severity.ERROR); + severities.put(MessageId.OPF_030, Severity.ERROR); + severities.put(MessageId.OPF_031, Severity.ERROR); + severities.put(MessageId.OPF_032, Severity.ERROR); + severities.put(MessageId.OPF_033, Severity.ERROR); + severities.put(MessageId.OPF_034, Severity.ERROR); + severities.put(MessageId.OPF_035, Severity.WARNING); + severities.put(MessageId.OPF_036, Severity.USAGE); + severities.put(MessageId.OPF_037, Severity.WARNING); + severities.put(MessageId.OPF_038, Severity.WARNING); + severities.put(MessageId.OPF_039, Severity.WARNING); + severities.put(MessageId.OPF_040, Severity.ERROR); + severities.put(MessageId.OPF_041, Severity.ERROR); + severities.put(MessageId.OPF_042, Severity.ERROR); + severities.put(MessageId.OPF_043, Severity.ERROR); + severities.put(MessageId.OPF_044, Severity.ERROR); + severities.put(MessageId.OPF_045, Severity.ERROR); + severities.put(MessageId.OPF_046, Severity.ERROR); + severities.put(MessageId.OPF_047, Severity.USAGE); + severities.put(MessageId.OPF_048, Severity.ERROR); + severities.put(MessageId.OPF_049, Severity.ERROR); + severities.put(MessageId.OPF_050, Severity.ERROR); + severities.put(MessageId.OPF_051, Severity.SUPPRESSED); + severities.put(MessageId.OPF_052, Severity.ERROR); + severities.put(MessageId.OPF_053, Severity.WARNING); + severities.put(MessageId.OPF_054, Severity.ERROR); + severities.put(MessageId.OPF_055, Severity.WARNING); + severities.put(MessageId.OPF_056, Severity.USAGE); + severities.put(MessageId.OPF_057, Severity.SUPPRESSED); + severities.put(MessageId.OPF_058, Severity.USAGE); + severities.put(MessageId.OPF_059, Severity.USAGE); + severities.put(MessageId.OPF_060, Severity.ERROR); + severities.put(MessageId.OPF_061, Severity.WARNING); + severities.put(MessageId.OPF_062, Severity.USAGE); + severities.put(MessageId.OPF_063, Severity.WARNING); + severities.put(MessageId.OPF_064, Severity.INFO); + severities.put(MessageId.OPF_065, Severity.ERROR); + severities.put(MessageId.OPF_066, Severity.ERROR); + severities.put(MessageId.OPF_067, Severity.ERROR); + severities.put(MessageId.OPF_068, Severity.ERROR); + severities.put(MessageId.OPF_069, Severity.ERROR); + severities.put(MessageId.OPF_070, Severity.WARNING); + severities.put(MessageId.OPF_071, Severity.ERROR); + severities.put(MessageId.OPF_072, Severity.USAGE); + severities.put(MessageId.OPF_073, Severity.ERROR); + severities.put(MessageId.OPF_074, Severity.ERROR); + severities.put(MessageId.OPF_075, Severity.ERROR); + severities.put(MessageId.OPF_076, Severity.ERROR); + severities.put(MessageId.OPF_077, Severity.WARNING); + severities.put(MessageId.OPF_078, Severity.ERROR); + severities.put(MessageId.OPF_079, Severity.WARNING); + severities.put(MessageId.OPF_080, Severity.WARNING); + severities.put(MessageId.OPF_081, Severity.ERROR); + severities.put(MessageId.OPF_082, Severity.ERROR); + severities.put(MessageId.OPF_083, Severity.ERROR); + severities.put(MessageId.OPF_084, Severity.ERROR); + severities.put(MessageId.OPF_085, Severity.WARNING); + + // PKG + severities.put(MessageId.PKG_001, Severity.WARNING); + severities.put(MessageId.PKG_003, Severity.ERROR); + severities.put(MessageId.PKG_004, Severity.FATAL); + severities.put(MessageId.PKG_005, Severity.ERROR); + severities.put(MessageId.PKG_006, Severity.ERROR); + severities.put(MessageId.PKG_007, Severity.ERROR); + severities.put(MessageId.PKG_008, Severity.FATAL); + severities.put(MessageId.PKG_009, Severity.ERROR); + severities.put(MessageId.PKG_010, Severity.WARNING); + severities.put(MessageId.PKG_011, Severity.ERROR); + severities.put(MessageId.PKG_012, Severity.WARNING); + severities.put(MessageId.PKG_013, Severity.ERROR); + severities.put(MessageId.PKG_014, Severity.WARNING); + severities.put(MessageId.PKG_015, Severity.FATAL); + severities.put(MessageId.PKG_016, Severity.WARNING); + severities.put(MessageId.PKG_017, Severity.WARNING); + severities.put(MessageId.PKG_018, Severity.FATAL); + severities.put(MessageId.PKG_020, Severity.ERROR); + severities.put(MessageId.PKG_021, Severity.ERROR); + severities.put(MessageId.PKG_022, Severity.WARNING); + severities.put(MessageId.PKG_023, Severity.USAGE); + severities.put(MessageId.PKG_024, Severity.INFO); + + // Resources + severities.put(MessageId.RSC_001, Severity.ERROR); + severities.put(MessageId.RSC_002, Severity.FATAL); + severities.put(MessageId.RSC_003, Severity.ERROR); + severities.put(MessageId.RSC_004, Severity.ERROR); + severities.put(MessageId.RSC_005, Severity.ERROR); + severities.put(MessageId.RSC_006, Severity.ERROR); + severities.put(MessageId.RSC_007, Severity.ERROR); + severities.put(MessageId.RSC_007w, Severity.WARNING); + severities.put(MessageId.RSC_008, Severity.ERROR); + severities.put(MessageId.RSC_009, Severity.ERROR); + severities.put(MessageId.RSC_010, Severity.ERROR); + severities.put(MessageId.RSC_011, Severity.ERROR); + severities.put(MessageId.RSC_012, Severity.ERROR); + severities.put(MessageId.RSC_013, Severity.ERROR); + severities.put(MessageId.RSC_014, Severity.ERROR); + severities.put(MessageId.RSC_015, Severity.ERROR); + severities.put(MessageId.RSC_016, Severity.FATAL); + severities.put(MessageId.RSC_017, Severity.WARNING); + severities.put(MessageId.RSC_018, Severity.WARNING); + severities.put(MessageId.RSC_019, Severity.WARNING); + severities.put(MessageId.RSC_020, Severity.ERROR); + severities.put(MessageId.RSC_021, Severity.ERROR); + severities.put(MessageId.RSC_022, Severity.INFO); + severities.put(MessageId.RSC_023, Severity.WARNING); + + // Scripting + severities.put(MessageId.SCP_001, Severity.USAGE); + severities.put(MessageId.SCP_002, Severity.USAGE); + severities.put(MessageId.SCP_003, Severity.USAGE); + severities.put(MessageId.SCP_004, Severity.ERROR); + severities.put(MessageId.SCP_005, Severity.ERROR); + severities.put(MessageId.SCP_006, Severity.USAGE); + severities.put(MessageId.SCP_007, Severity.USAGE); + severities.put(MessageId.SCP_008, Severity.USAGE); + severities.put(MessageId.SCP_009, Severity.USAGE); + severities.put(MessageId.SCP_010, Severity.USAGE); + } + +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocaleHolder.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocaleHolder.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocaleHolder.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocaleHolder.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,35 @@ +package com.adobe.epubcheck.messages; + +import java.util.Locale; + +/** + * Holds the "currently used" {@code Locale} in a static thread-local variable. + * + * Pieces of code that set or change the locale used in the application runtime + * should update the static locale stored in this class. See for instance how it + * is done in the {@code MasterReport} implementation. + * + */ +public final class LocaleHolder +{ + private static final ThreadLocal current = new InheritableThreadLocal(); + + public static void set(final Locale locale) + { + current.set(locale); + } + + public static Locale get() + { + Locale locale = current.get(); + if (locale == null) + { + locale = Locale.getDefault(); + } + return locale; + } + + private LocaleHolder() + { + } +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocalizedMessageDictionary.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocalizedMessageDictionary.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocalizedMessageDictionary.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocalizedMessageDictionary.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,48 @@ +package com.adobe.epubcheck.messages; + +import java.util.Locale; + +/** + * This is a dictionary that maps the text of a message to a severity. + */ +public class LocalizedMessageDictionary implements MessageDictionary +{ + private LocalizedMessages localizedMessages; + private Locale locale; + + /** + * Convenience constructor will use the default locale. + */ + public LocalizedMessageDictionary() + { + this(null); + } + + /** + * Generate messages with an explicit locale. + * @param locale The locale to localize for. If the locale is not supported + * (or null), the default locale will be used instead. + */ + public LocalizedMessageDictionary(Locale locale) + { + this.locale = (locale != null) ? locale : Locale.getDefault(); + this.localizedMessages = LocalizedMessages.getInstance(locale); + } + + /** + * Returns the locale being used by this class for localization of the messages. + * @return Locale in use. + */ + public Locale getLocale() + { + return locale; + } + + @Override + public Message getMessage(MessageId id) + { + return localizedMessages.getMessage(id); + } + + +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocalizedMessages.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocalizedMessages.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/LocalizedMessages.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/LocalizedMessages.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,192 @@ +package com.adobe.epubcheck.messages; + +import com.google.common.base.Charsets; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.net.URLConnection; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.PropertyResourceBundle; +import java.util.ResourceBundle; + +/** + * Manages storage, caching and retrieval of default localized messages. + */ +public class LocalizedMessages +{ + + private final Locale locale; + private final ResourceBundle bundle; + // Collection (static) will contain one LocalizedMessages instance for each + // Locale that has been requested. + private static final Map localizedMessages = new HashMap(); + // Messages are lazily instantiated and cached as they are requested. + private final Map cachedMessages = new EnumMap(MessageId.class); + private final Severities defaultSeverities = new DefaultSeverities(); + + /** + * Provides messages for the default locale. + * + * @return Localized messages. + */ + public static LocalizedMessages getInstance() + { + return getInstance(null); + } + + /** + * Provides messages for the given locale. + * + * @param locale The locale. If null or unsupported, will use the default + * locale instead. + * @return Localized messages. + */ + public static LocalizedMessages getInstance(Locale locale) + { + LocalizedMessages instance = null; + + if (locale == null) + { + locale = Locale.getDefault(); + } + + String localeKey = locale.getLanguage(); + if (localizedMessages.containsKey(localeKey)) + { + instance = localizedMessages.get(localeKey); + } + else + { + synchronized (LocalizedMessages.class) + { + if (instance == null) + { + instance = new LocalizedMessages(locale); + localizedMessages.put(localeKey, instance); + } + } + } + + return instance; + } + + /** + * Gets the message for the given id. + * + * @param id + * @return A Message object, using the localized string if necessary. + */ + public Message getMessage(MessageId id) + { + // Performance note: this method uses a lazy initialization pattern. When + // a MessageId is first requested, we fetch the data from the ResourceBundle + // and create a new Message object, which is then cached. On the next + // request, we'll use the cached version instead. + Message message; + if (cachedMessages.containsKey(id)) + { + message = cachedMessages.get(id); + } + else + { + message = new Message(id, defaultSeverities.get(id), getMessageAsString(id), getSuggestion(id)); + cachedMessages.put(id, message); + } + + return message; + } + + /** + * Typical pattern for instantiation should use the static getInstance() methods + * to ensure that cached objects are used. If that behavior isn't desired, + * direct instantiation is also an option using this constructor. + * @param locale The locale used to localize the messages, or default. + */ + public LocalizedMessages(Locale locale) + { + this.locale = (locale != null) ? locale : Locale.getDefault(); + bundle = ResourceBundle.getBundle( + "com.adobe.epubcheck.messages.MessageBundle", this.locale, new LocalizedMessages.UTF8Control()); + } + + private String getStringFromBundle(String id) + { + String result = ""; + try + { + result = bundle.getString(id); + } + catch (Exception ignore) + { + // Might not exist + } + + return result; + } + + private String getMessageAsString(MessageId id) + { + return getStringFromBundle(id.name()); + } + + private String getSuggestion(MessageId id) + { + return getStringFromBundle(id.name() + "_SUG"); + } + + public static class UTF8Control extends ResourceBundle.Control + { + + @Override + 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); + String resourceName = toResourceName(bundleName, "properties"); //$NON-NLS-1$ + ResourceBundle bundle = null; + InputStream stream = null; + if (reload) + { + URL url = loader.getResource(resourceName); + if (url != null) + { + URLConnection connection = url.openConnection(); + if (connection != null) + { + connection.setUseCaches(false); + stream = connection.getInputStream(); + } + } + } else + { + stream = loader.getResourceAsStream(resourceName); + } + if (stream != null) + { + try + { + // 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 + { + stream.close(); + } + } + return bundle; + } + } +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageDictionaryDumper.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageDictionaryDumper.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageDictionaryDumper.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageDictionaryDumper.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,44 @@ +package com.adobe.epubcheck.messages; + +import java.io.IOException; +import java.io.OutputStreamWriter; + +/** + * Helper class to handle file output of a MessageDictionary. + */ +public class MessageDictionaryDumper +{ + private final MessageDictionary dictionary; + + public MessageDictionaryDumper(MessageDictionary dictionary) + { + this.dictionary = dictionary; + } + + public void dump(OutputStreamWriter outputStream) throws IOException + { + // Output the messages in a tab separated format + outputStream.write("ID\tSeverity\tMessage\tSuggestion\n"); + for (MessageId id : MessageId.values()) + { + StringBuilder sb = new StringBuilder(); + sb.append(id.toString()); + sb.append("\t"); + Message message = dictionary.getMessage(id); + if (message != null) + { + sb.append(message.getSeverity()); + sb.append("\t"); + sb.append(message.getMessage()); + sb.append("\t"); + sb.append(message.getSuggestion()); + } + else + { + sb.append("null\tnull\tnull\tnull"); + } + sb.append("\n"); + outputStream.write(sb.toString()); + } + } +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageDictionary.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,639 +1,8 @@ package com.adobe.epubcheck.messages; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.net.URL; -import java.net.URLConnection; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.PropertyResourceBundle; -import java.util.ResourceBundle; -import java.util.ResourceBundle.Control; -import java.util.regex.Matcher; -import java.util.regex.Pattern; +public interface MessageDictionary { + + Message getMessage(MessageId id); -import com.adobe.epubcheck.api.EPUBLocation; -import com.adobe.epubcheck.api.Report; -import com.adobe.epubcheck.util.PathUtil; -import com.adobe.epubcheck.util.outWriter; -import com.google.common.base.Charsets; - -/** - * This is a dictionary that maps the text of a message to a severity. - */ -public class MessageDictionary -{ - File overrideFile; - Report report; - static Map defaultSeverityMap = null; - static Pattern parameterPattern = Pattern.compile("%(\\d+)\\$s"); - - public void setOverrideFile(File value) - { - overrideFile = value; - initMessageMap(); - } - - public MessageDictionary(File overrideFile, Report report) - { - this.report = report; - this.overrideFile = overrideFile; - initMessageMap(); - } - - Map messages = new HashMap(); - static final ResourceBundle labels = ResourceBundle.getBundle( - "com.adobe.epubcheck.messages.MessageBundle", Locale.getDefault(), new UTF8Control()); - - public Message getMessage(MessageId id) - { - return this.messages.get(id); - } - - static Map getDefaultSeverities() - { - if (defaultSeverityMap == null) - { - Map map = new HashMap(MessageId.values().length); - - // Accessibility - map.put(MessageId.ACC_001, Severity.USAGE); - map.put(MessageId.ACC_002, Severity.USAGE); - map.put(MessageId.ACC_003, Severity.SUPPRESSED); - map.put(MessageId.ACC_004, Severity.SUPPRESSED); - map.put(MessageId.ACC_005, Severity.SUPPRESSED); - map.put(MessageId.ACC_006, Severity.SUPPRESSED); - map.put(MessageId.ACC_007, Severity.USAGE); - map.put(MessageId.ACC_008, Severity.USAGE); - map.put(MessageId.ACC_009, Severity.WARNING); - map.put(MessageId.ACC_010, Severity.SUPPRESSED); - map.put(MessageId.ACC_011, Severity.WARNING); - map.put(MessageId.ACC_012, Severity.SUPPRESSED); - map.put(MessageId.ACC_013, Severity.USAGE); - map.put(MessageId.ACC_014, Severity.USAGE); - map.put(MessageId.ACC_015, Severity.USAGE); - map.put(MessageId.ACC_016, Severity.USAGE); - map.put(MessageId.ACC_017, Severity.USAGE); - - // CHK - map.put(MessageId.CHK_001, Severity.ERROR); - map.put(MessageId.CHK_002, Severity.ERROR); - map.put(MessageId.CHK_003, Severity.ERROR); - map.put(MessageId.CHK_004, Severity.ERROR); - map.put(MessageId.CHK_005, Severity.ERROR); - map.put(MessageId.CHK_006, Severity.ERROR); - map.put(MessageId.CHK_007, Severity.ERROR); - - // CSS - map.put(MessageId.CSS_001, Severity.ERROR); - map.put(MessageId.CSS_002, Severity.ERROR); - map.put(MessageId.CSS_003, Severity.ERROR); - map.put(MessageId.CSS_004, Severity.ERROR); - map.put(MessageId.CSS_005, Severity.ERROR); - map.put(MessageId.CSS_006, Severity.WARNING); - map.put(MessageId.CSS_007, Severity.INFO); - map.put(MessageId.CSS_008, Severity.ERROR); - map.put(MessageId.CSS_009, Severity.USAGE); - 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); - map.put(MessageId.CSS_015, Severity.ERROR); - map.put(MessageId.CSS_016, Severity.SUPPRESSED); - map.put(MessageId.CSS_017, Severity.WARNING); - map.put(MessageId.CSS_019, Severity.WARNING); - map.put(MessageId.CSS_020, Severity.USAGE); - map.put(MessageId.CSS_021, Severity.USAGE); - map.put(MessageId.CSS_022, Severity.USAGE); - map.put(MessageId.CSS_023, Severity.USAGE); - map.put(MessageId.CSS_024, Severity.USAGE); - map.put(MessageId.CSS_025, Severity.USAGE); - map.put(MessageId.CSS_027, Severity.USAGE); - map.put(MessageId.CSS_028, Severity.USAGE); - - // HTML - map.put(MessageId.HTM_001, Severity.ERROR); - map.put(MessageId.HTM_002, Severity.WARNING); - map.put(MessageId.HTM_003, Severity.ERROR); - map.put(MessageId.HTM_004, Severity.ERROR); - map.put(MessageId.HTM_005, Severity.USAGE); - map.put(MessageId.HTM_006, Severity.USAGE); - map.put(MessageId.HTM_007, Severity.WARNING); - map.put(MessageId.HTM_008, Severity.ERROR); - map.put(MessageId.HTM_009, Severity.ERROR); - map.put(MessageId.HTM_010, Severity.USAGE); - map.put(MessageId.HTM_011, Severity.ERROR); - map.put(MessageId.HTM_012, Severity.USAGE); - map.put(MessageId.HTM_013, Severity.USAGE); - map.put(MessageId.HTM_014, Severity.WARNING); - map.put(MessageId.HTM_014a, Severity.WARNING); - map.put(MessageId.HTM_015, Severity.SUPPRESSED); - map.put(MessageId.HTM_016, Severity.SUPPRESSED); - map.put(MessageId.HTM_017, Severity.ERROR); - map.put(MessageId.HTM_018, Severity.USAGE); - map.put(MessageId.HTM_019, Severity.USAGE); - map.put(MessageId.HTM_020, Severity.USAGE); - map.put(MessageId.HTM_021, Severity.USAGE); - map.put(MessageId.HTM_022, Severity.USAGE); - map.put(MessageId.HTM_023, Severity.WARNING); - map.put(MessageId.HTM_024, Severity.USAGE); - map.put(MessageId.HTM_025, Severity.WARNING); - map.put(MessageId.HTM_027, Severity.USAGE); - map.put(MessageId.HTM_028, Severity.USAGE); - map.put(MessageId.HTM_029, Severity.USAGE); - map.put(MessageId.HTM_033, Severity.USAGE); - map.put(MessageId.HTM_036, Severity.SUPPRESSED); - map.put(MessageId.HTM_038, Severity.USAGE); - map.put(MessageId.HTM_043, Severity.USAGE); - map.put(MessageId.HTM_044, Severity.USAGE); - map.put(MessageId.HTM_045, Severity.USAGE); - map.put(MessageId.HTM_046, Severity.ERROR); - map.put(MessageId.HTM_047, Severity.ERROR); - 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 - map.put(MessageId.MED_001, Severity.ERROR); - map.put(MessageId.MED_002, Severity.ERROR); - map.put(MessageId.MED_003, Severity.ERROR); - map.put(MessageId.MED_004, Severity.ERROR); - map.put(MessageId.MED_005, Severity.ERROR); - map.put(MessageId.MED_006, Severity.USAGE); - - // NAV - map.put(MessageId.NAV_001, Severity.ERROR); - map.put(MessageId.NAV_002, Severity.USAGE); - 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 - map.put(MessageId.OPF_001, Severity.ERROR); - map.put(MessageId.OPF_002, Severity.FATAL); - map.put(MessageId.OPF_003, Severity.WARNING); - map.put(MessageId.OPF_004, Severity.WARNING); - map.put(MessageId.OPF_004a, Severity.ERROR); - map.put(MessageId.OPF_004b, Severity.ERROR); - map.put(MessageId.OPF_004c, Severity.ERROR); - map.put(MessageId.OPF_004d, Severity.ERROR); - map.put(MessageId.OPF_004e, Severity.WARNING); - map.put(MessageId.OPF_004f, Severity.WARNING); - map.put(MessageId.OPF_005, Severity.ERROR); - 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.WARNING); - map.put(MessageId.OPF_008, Severity.ERROR); - map.put(MessageId.OPF_009, Severity.ERROR); - map.put(MessageId.OPF_010, Severity.ERROR); - map.put(MessageId.OPF_011, Severity.ERROR); - map.put(MessageId.OPF_012, Severity.ERROR); - map.put(MessageId.OPF_013, Severity.ERROR); - map.put(MessageId.OPF_014, Severity.ERROR); - map.put(MessageId.OPF_015, Severity.ERROR); - map.put(MessageId.OPF_016, Severity.ERROR); - map.put(MessageId.OPF_017, Severity.ERROR); - map.put(MessageId.OPF_018, Severity.WARNING); - 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_025, Severity.ERROR); - map.put(MessageId.OPF_026, Severity.ERROR); - map.put(MessageId.OPF_027, Severity.ERROR); - map.put(MessageId.OPF_028, Severity.ERROR); - map.put(MessageId.OPF_029, Severity.ERROR); - map.put(MessageId.OPF_030, Severity.ERROR); - map.put(MessageId.OPF_031, Severity.ERROR); - map.put(MessageId.OPF_032, Severity.ERROR); - map.put(MessageId.OPF_033, Severity.ERROR); - map.put(MessageId.OPF_034, Severity.ERROR); - map.put(MessageId.OPF_035, Severity.WARNING); - map.put(MessageId.OPF_036, Severity.USAGE); - map.put(MessageId.OPF_037, Severity.WARNING); - map.put(MessageId.OPF_038, Severity.WARNING); - map.put(MessageId.OPF_039, Severity.WARNING); - map.put(MessageId.OPF_040, Severity.ERROR); - map.put(MessageId.OPF_041, Severity.ERROR); - map.put(MessageId.OPF_042, Severity.ERROR); - map.put(MessageId.OPF_043, Severity.ERROR); - map.put(MessageId.OPF_044, Severity.ERROR); - map.put(MessageId.OPF_045, Severity.ERROR); - map.put(MessageId.OPF_046, Severity.ERROR); - map.put(MessageId.OPF_047, Severity.USAGE); - map.put(MessageId.OPF_048, Severity.ERROR); - map.put(MessageId.OPF_049, Severity.ERROR); - map.put(MessageId.OPF_050, Severity.ERROR); - map.put(MessageId.OPF_051, Severity.SUPPRESSED); - map.put(MessageId.OPF_052, Severity.ERROR); - 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.USAGE); - map.put(MessageId.OPF_057, Severity.SUPPRESSED); - map.put(MessageId.OPF_058, Severity.USAGE); - map.put(MessageId.OPF_059, Severity.USAGE); - map.put(MessageId.OPF_060, Severity.ERROR); - map.put(MessageId.OPF_061, Severity.WARNING); - map.put(MessageId.OPF_062, Severity.USAGE); - map.put(MessageId.OPF_063, Severity.WARNING); - 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); - map.put(MessageId.PKG_005, Severity.ERROR); - map.put(MessageId.PKG_006, Severity.ERROR); - map.put(MessageId.PKG_007, Severity.ERROR); - map.put(MessageId.PKG_008, Severity.FATAL); - map.put(MessageId.PKG_009, Severity.ERROR); - map.put(MessageId.PKG_010, Severity.WARNING); - map.put(MessageId.PKG_011, Severity.ERROR); - map.put(MessageId.PKG_012, Severity.WARNING); - map.put(MessageId.PKG_013, Severity.ERROR); - map.put(MessageId.PKG_014, Severity.WARNING); - map.put(MessageId.PKG_015, Severity.FATAL); - map.put(MessageId.PKG_016, Severity.WARNING); - map.put(MessageId.PKG_017, Severity.WARNING); - map.put(MessageId.PKG_018, Severity.FATAL); - 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 - map.put(MessageId.RSC_001, Severity.ERROR); - map.put(MessageId.RSC_002, Severity.FATAL); - map.put(MessageId.RSC_003, Severity.ERROR); - map.put(MessageId.RSC_004, Severity.ERROR); - 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.ERROR); - map.put(MessageId.RSC_012, Severity.ERROR); - map.put(MessageId.RSC_013, Severity.ERROR); - map.put(MessageId.RSC_014, Severity.ERROR); - map.put(MessageId.RSC_015, Severity.ERROR); - 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 - map.put(MessageId.SCP_001, Severity.USAGE); - map.put(MessageId.SCP_002, Severity.USAGE); - map.put(MessageId.SCP_003, Severity.USAGE); - map.put(MessageId.SCP_004, Severity.ERROR); - map.put(MessageId.SCP_005, Severity.ERROR); - map.put(MessageId.SCP_006, Severity.USAGE); - map.put(MessageId.SCP_007, Severity.USAGE); - map.put(MessageId.SCP_008, Severity.USAGE); - map.put(MessageId.SCP_009, Severity.USAGE); - map.put(MessageId.SCP_010, Severity.USAGE); - - defaultSeverityMap = map; - } - return defaultSeverityMap; - } - - void initDefaultMessageMap() - { - messages.clear(); - for (Map.Entry entry : getDefaultSeverities().entrySet()) - { - this.addMessage(entry.getKey(), entry.getValue()); - } - } - - void initMessageMap() - { - initDefaultMessageMap(); - loadOverriddenMessageSeverities(); - } - - void loadOverriddenMessageSeverities() - { - if (overrideFile != null) - { - int lineNumber = -1; - int columnNumber = -1; - String line; - - FileInputStream fis = null; - BufferedReader br = null; - try - { - fis = new FileInputStream(overrideFile); - br = new BufferedReader(new InputStreamReader(fis, Charset.forName("UTF-8"))); - - lineNumber = 1; - - while (null != (line = br.readLine())) - { - if (1 == lineNumber) - { - if (line.toLowerCase(Locale.ROOT).startsWith("id")) - { - // optionally eat the first line - continue; - } - } - columnNumber = 0; - String[] fields = line.split("\t"); - if (fields.length >= 2) - { - MessageId id; - try - { - id = MessageId.fromString(fields[0]); - } catch (NoSuchElementException unused) - { - report.message(MessageId.CHK_002, EPUBLocation.create("", lineNumber, 0), fields[0], - PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); - continue; - } - - Severity newSeverity; - - try - { - columnNumber += 1 + fields[0].length(); - newSeverity = Severity.fromString(fields[1]); - } catch (NoSuchElementException ignored) - { - report.message(MessageId.CHK_003, EPUBLocation.create("", lineNumber, columnNumber), - fields[1], PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); - continue; - } - - Message message = messages.get(id); - String messageText = message.getMessage(); - if (fields.length >= 3 && fields[2] != null && fields[2].length() > 0) - { - columnNumber += 1 + fields[1].length(); - messageText = checkMessageForParameterCount(lineNumber, columnNumber, - message.getMessage(), fields[2]); - if (messageText == null) - { - report.message(MessageId.CHK_004, EPUBLocation.create("", lineNumber, 0, fields[2]), - PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); - continue; - } - } - if (messageText != null) - { - Severity oldSeverity = getDefaultSeverities().get(message.getID()); - if (newSeverity != oldSeverity) - { - messageText = String.format(" (severity overridden from %1$s) %2$s", oldSeverity, - messageText); - } - } - - String suggestionText = message.getSuggestion(); - if (fields.length >= 4 && fields[3] != null && fields[3].length() > 0) - { - columnNumber += 1 + fields[1].length(); - suggestionText = checkMessageForParameterCount(lineNumber, columnNumber, - message.getSuggestion(), fields[3]); - if (suggestionText == null) - { - 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))) - { - messages.put(id, new Message(message.getID(), newSeverity, message.getSeverity(), - messageText, suggestionText)); - } - } - ++lineNumber; - } - } catch (FileNotFoundException fnf) - { - report.message(MessageId.CHK_001, EPUBLocation.create(overrideFile.getAbsolutePath())); - } catch (IOException ex) - { - report.message(MessageId.CHK_007, EPUBLocation.create("", lineNumber, columnNumber), - PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()), ex.getMessage()); - } finally - { - try - { - if (br != null) - { - br.close(); - } - if (fis != null) - { - fis.close(); - } - } catch (IOException ignored) - { - } - } - } - } - - String checkMessageForParameterCount(int lineNumber, int columnNumber, String originalText, - String newText) - { - if (newText != null) - { - int maxOriginal = getParameterCount(lineNumber, columnNumber, originalText); - int maxNew = getParameterCount(lineNumber, columnNumber, newText); - - if (maxNew <= maxOriginal) - { - return newText; - } - return null; - } - return originalText; - } - - int getParameterCount(int lineNumber, int columnNumber, String text) - { - int max = 0; - { - Matcher m = parameterPattern.matcher(text); - while (m.find()) - { - int absoluteColumnNumber = columnNumber + m.start(); - String s = m.group(1); - try - { - Integer number = Integer.parseInt(s); - if (number > max) - { - max = number; - } - } catch (NumberFormatException ex) - { - String pathAdjustedFileName = PathUtil - .removeWorkingDirectory(overrideFile.getAbsolutePath()); - report.message(MessageId.CHK_006, - EPUBLocation.create("", lineNumber, absoluteColumnNumber, text), - pathAdjustedFileName); - } - } - } - return max; - } - - void addMessage(MessageId messageId, Severity severity) - { - try - { - messages.put(messageId, new Message(messageId, severity, labels.getString(messageId.name()), - getSuggestion(messageId))); - } catch (Exception e) - { - outWriter.println("Couldn't locate message " + messageId.name()); - } - } - - String getSuggestion(MessageId messageId) - { - String result; - try - { - result = labels.getString(messageId.name() + "_SUG"); - } catch (Exception ignore) - { - result = ""; - } - return result; - } - - public void dumpMessages(OutputStreamWriter outputStream) - throws IOException - { - // Output the messages in a tab separated format - outputStream.write("ID\tSeverity\tMessage\tSuggestion\n"); - for (MessageId id : MessageId.values()) - { - StringBuilder sb = new StringBuilder(); - sb.append(id.toString()); - sb.append("\t"); - Message message = this.getMessage(id); - if (message != null) - { - sb.append(message.getSeverity()); - sb.append("\t"); - sb.append(message.getMessage()); - sb.append("\t"); - sb.append(message.getSuggestion()); - } - else - { - sb.append("null\tnull\tnull\tnull"); - } - sb.append("\n"); - outputStream.write(sb.toString()); - } - } - - private static class UTF8Control extends Control - { - 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); - String resourceName = toResourceName(bundleName, "properties"); //$NON-NLS-1$ - ResourceBundle bundle = null; - InputStream stream = null; - if (reload) - { - URL url = loader.getResource(resourceName); - if (url != null) - { - URLConnection connection = url.openConnection(); - if (connection != null) - { - connection.setUseCaches(false); - stream = connection.getInputStream(); - } - } - } - else - { - stream = loader.getResourceAsStream(resourceName); - } - if (stream != null) - { - try - { - // 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 - { - stream.close(); - } - } - return bundle; - } - } } + diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageId.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageId.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/MessageId.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/MessageId.java 2018-11-26 10:49:29.000000000 +0000 @@ -55,6 +55,7 @@ CHK_005("CHK-005"), CHK_006("CHK-006"), CHK_007("CHK-007"), + CHK_008("CHK-008"), // Messages associated with styles CSS_001("CSS-001"), @@ -126,6 +127,7 @@ HTM_050("HTM-050"), HTM_051("HTM-051"), HTM_052("HTM-052"), + HTM_053("HTM_053"), // Messages associated with media (images, audio and video) MED_001("MED-001"), @@ -244,6 +246,7 @@ OPF_082("OPF-082"), OPF_083("OPF-083"), OPF_084("OPF-084"), + OPF_085("OPF-085"), // Messages relating to the entire package PKG_001("PKG-001"), @@ -267,6 +270,7 @@ PKG_021("PKG-021"), PKG_022("PKG-022"), PKG_023("PKG-023"), + PKG_024("PKG-024"), // Messages relating to resources RSC_001("RSC-001"), @@ -292,6 +296,7 @@ RSC_020("RSC-020"), RSC_021("RSC-021"), RSC_022("RSC-022"), + RSC_023("RSC-023"), // Messages relating to scripting SCP_001("SCP-001"), diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/OverriddenMessageDictionary.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/OverriddenMessageDictionary.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/OverriddenMessageDictionary.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/OverriddenMessageDictionary.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,32 @@ +package com.adobe.epubcheck.messages; + +import com.adobe.epubcheck.api.Report; +import java.io.File; + +/** + * Maps a message to a severity using overrides provided in a file. Falls back + * to default messages and severities when an override isn't available. + */ +public class OverriddenMessageDictionary implements MessageDictionary +{ + private final OverriddenMessages messages; + + public OverriddenMessageDictionary(File overrideFile, Report report ) + { + messages = new OverriddenMessages(overrideFile, report); + } + + @Override + public Message getMessage(MessageId id) + { + Message message = messages.getMessage(id); + if( message == null ) + { + // Failure to find the message is a programmer error. + throw new IllegalArgumentException(String.format("MessageId %s is not valid.", id.name())); + } + + return message; + } + +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/OverriddenMessages.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/OverriddenMessages.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/OverriddenMessages.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/OverriddenMessages.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,239 @@ +package com.adobe.epubcheck.messages; + +import com.adobe.epubcheck.api.EPUBLocation; +import com.adobe.epubcheck.api.Report; +import com.adobe.epubcheck.util.PathUtil; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.util.EnumMap; +import java.util.Locale; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Loads a list of messages from an override file and manages logic to choose + * between an override or default message based on which is available. + */ +public class OverriddenMessages +{ + + private final DefaultSeverities defaultSeverities = new DefaultSeverities(); + private final Map overridenMessages = new EnumMap(MessageId.class); + // We could provide other localizations here as well, but it's probably better + // to keep this simple. + private final LocalizedMessages defaultMessages = LocalizedMessages.getInstance(); + private final Pattern parameterPattern = Pattern.compile("%(\\d+)\\$s"); + private final File overrideFile; + private final Report report; + + public OverriddenMessages(File overrideFile, Report report) + { + this.overrideFile = overrideFile; + this.report = report; + loadOverriddenMessageSeverities(); + } + + public Message getMessage(MessageId id) + { + // First, check for an overridden message + Message m = overridenMessages.get(id); + if (m == null) + { + // If not overridden, fall back to the default + m = defaultMessages.getMessage(id); + + if (m == null) + { + // Indicates a programmer error + throw new IllegalArgumentException("MessageId " + id.name() + " is invalid."); + } + } + return m; + } + + + private void loadOverriddenMessageSeverities() + { + // Method lifted directly from the old MessageDictionary class. I've avoided + // making any changes, but this method deserves a refactor. -mm + if (overrideFile != null) + { + int lineNumber = -1; + int columnNumber = -1; + String line; + + FileInputStream fis = null; + BufferedReader br = null; + try + { + fis = new FileInputStream(overrideFile); + br = new BufferedReader(new InputStreamReader(fis, Charset.forName("UTF-8"))); + + lineNumber = 1; + + while (null != (line = br.readLine())) + { + if (1 == lineNumber) + { + if (line.toLowerCase(Locale.ROOT).startsWith("id")) + { + // optionally eat the first line + continue; + } + } + columnNumber = 0; + String[] fields = line.split("\t"); + if (fields.length >= 2) + { + MessageId id; + try + { + id = MessageId.fromString(fields[0]); + } catch (NoSuchElementException unused) + { + report.message(MessageId.CHK_002, EPUBLocation.create("", lineNumber, 0), fields[0], + PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); + continue; + } + + Severity newSeverity; + + try + { + columnNumber += 1 + fields[0].length(); + newSeverity = Severity.fromString(fields[1]); + } catch (NoSuchElementException ignored) + { + report.message(MessageId.CHK_003, EPUBLocation.create("", lineNumber, columnNumber), + fields[1], PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); + continue; + } + + Message message = defaultMessages.getMessage(id); + String messageText = message.getMessage(); + if (fields.length >= 3 && fields[2] != null && fields[2].length() > 0) + { + columnNumber += 1 + fields[1].length(); + messageText = checkMessageForParameterCount(lineNumber, columnNumber, + message.getMessage(), fields[2]); + if (messageText == null) + { + report.message(MessageId.CHK_004, EPUBLocation.create("", lineNumber, 0, fields[2]), + PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath())); + continue; + } + } + if (messageText != null) + { + Severity oldSeverity = defaultSeverities.get(message.getID()); + if (newSeverity != oldSeverity) + { + messageText = String.format(" (severity overridden from %1$s) %2$s", oldSeverity, + messageText); + } + } + + String suggestionText = message.getSuggestion(); + if (fields.length >= 4 && fields[3] != null && fields[3].length() > 0) + { + columnNumber += 1 + fields[1].length(); + suggestionText = checkMessageForParameterCount(lineNumber, columnNumber, + message.getSuggestion(), fields[3]); + if (suggestionText == null) + { + 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))) + { + overridenMessages.put(id, new Message(message.getID(), newSeverity, message.getSeverity(), + messageText, suggestionText)); + } + } + ++lineNumber; + } + } catch (FileNotFoundException fnf) + { + report.message(MessageId.CHK_001, EPUBLocation.create(overrideFile.getAbsolutePath())); + } catch (IOException ex) + { + report.message(MessageId.CHK_007, EPUBLocation.create("", lineNumber, columnNumber), + PathUtil.removeWorkingDirectory(overrideFile.getAbsolutePath()), ex.getMessage()); + } finally + { + try + { + if (br != null) + { + br.close(); + } + if (fis != null) + { + fis.close(); + } + } catch (IOException ignored) + { + } + } + } + } + + private String checkMessageForParameterCount(int lineNumber, int columnNumber, String originalText, + String newText) + { + if (newText != null) + { + int maxOriginal = getParameterCount(lineNumber, columnNumber, originalText); + int maxNew = getParameterCount(lineNumber, columnNumber, newText); + + if (maxNew <= maxOriginal) + { + return newText; + } + return null; + } + return originalText; + } + + private int getParameterCount(int lineNumber, int columnNumber, String text) + { + int max = 0; + { + Matcher m = parameterPattern.matcher(text); + while (m.find()) + { + int absoluteColumnNumber = columnNumber + m.start(); + String s = m.group(1); + try + { + Integer number = Integer.parseInt(s); + if (number > max) + { + max = number; + } + } catch (NumberFormatException ex) + { + String pathAdjustedFileName = PathUtil + .removeWorkingDirectory(overrideFile.getAbsolutePath()); + report.message(MessageId.CHK_006, + EPUBLocation.create("", lineNumber, absoluteColumnNumber, text), + pathAdjustedFileName); + } + } + } + return max; + } + +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/Severities.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/Severities.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/messages/Severities.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/messages/Severities.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,7 @@ +package com.adobe.epubcheck.messages; + +public interface Severities { + + Severity get(MessageId id); + +} diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ncx/NCXChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -28,7 +28,6 @@ import com.adobe.epubcheck.ocf.OCFPackage; import com.adobe.epubcheck.opf.ContentChecker; 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; @@ -71,19 +70,17 @@ ncxParser.addXMLHandler(ncxHandler); ncxParser.process(); - if (context.version == EPUBVersion.VERSION_2) + // report this for EPUB2 and ALSO for EPUB3 (see discussion in #669) + String ncxId = ncxHandler.getUid(); + if (ncxId != null && !ncxId.equals(ncxId.trim())) { - String ncxId = ncxHandler.getUid(); - if (ncxId != null && !ncxId.equals(ncxId.trim())) - { - report.message(MessageId.NCX_004, ncxParser.getLocation()); - } - // 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())) - { - report.message(MessageId.NCX_001, ncxParser.getLocation(), ncxHandler.getUid(), uid); - } + report.message(MessageId.NCX_004, ncxParser.getLocation()); + } + // 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())) + { + report.message(MessageId.NCX_001, ncxParser.getLocation(), ncxHandler.getUid(), uid); } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -209,6 +209,7 @@ { // Validation profile is unsupported for EPUB 2.0 report.message(MessageId.PKG_023, EPUBLocation.create(opfPaths.get(0))); + validationProfile = EPUBProfile.DEFAULT; } else if (validationVersion == EPUBVersion.VERSION_3) { @@ -307,9 +308,11 @@ // try { + // report duplicate entries Set entriesSet = new HashSet(); Set normalizedEntriesSet = new HashSet(); - for (final String entry : ocf.getFileEntries()) + // run duplicate check from the LinkedList which may contain duplicates + for (final String entry : ocf.getEntries()) { if (!entriesSet.add(entry.toLowerCase(Locale.ENGLISH))) { @@ -319,7 +322,11 @@ { report.message(MessageId.OPF_061, EPUBLocation.create(ocf.getPackagePath()), entry); } + } + // check all file entries without duplicates + for (final String entry : ocf.getFileEntries()) + { ocf.reportMetadata(entry, report); // if the entry is not in the whitelist (META-INF/* + mimetype) @@ -345,6 +352,7 @@ OCFFilenameChecker.checkCompatiblyEscaped(entry, report, validationVersion); } + // check all directory entries without duplicates for (String directory : ocf.getDirectoryEntries()) { boolean hasContents = false; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFPackage.java 2018-11-26 10:49:29.000000000 +0000 @@ -107,14 +107,14 @@ throws IOException; /** - * @return a set of relative file names of files in this container + * @return a set of relative file names of files in this container (cleaned from duplicates) * @throws IOException */ public abstract Set getFileEntries() throws IOException; /** - * @return a set of relative directory entries in this container + * @return a set of relative directory entries in this container (cleaned from duplicates) * @throws IOException */ public abstract Set getDirectoryEntries() diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ocf/OCFZipPackage.java 2018-11-26 10:49:29.000000000 +0000 @@ -6,7 +6,6 @@ import java.security.MessageDigest; import java.util.Collections; import java.util.Enumeration; -import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -150,16 +149,14 @@ public Set getDirectoryEntries() throws IOException { - HashSet entryNames = new HashSet(); - for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) + synchronized (zip) { - ZipEntry entry = entries.nextElement(); - if (entry.isDirectory()) + if (allEntries == null) { - entryNames.add(entry.getName()); + listEntries(); } + return Collections.unmodifiableSet(dirEntries); } - return entryNames; } public void reportMetadata(String fileName, Report report) diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/OPFChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -416,11 +416,15 @@ } 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(); + try { + // 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(); + } catch (IllegalStateException e) { + report.message(MessageId.CHK_008, EPUBLocation.create(path), item.getPath()); + } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/OPFHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -29,6 +29,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.UUID; import java.util.Vector; import com.adobe.epubcheck.api.EPUBLocation; @@ -507,6 +508,18 @@ if (idval != null) { report.info(null, FeatureEnum.UNIQUE_IDENT, idval.trim()); + + uid = idval.trim(); + + // #853 + String opfSchemeAttr = e.getAttributeNS("http://www.idpf.org/2007/opf", "scheme"); + if(uid.startsWith("urn:uuid:") || (opfSchemeAttr != null && opfSchemeAttr.toLowerCase().equals("uuid"))) { + try { + UUID.fromString(uid.replaceAll("urn:uuid:", "")); + } catch (Throwable t) { + report.message(MessageId.OPF_085, EPUBLocation.create(path, parser.getLineNumber(), parser.getColumnNumber()), uid); + } + } } } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/ValidationContext.java 2018-11-26 10:49:29.000000000 +0000 @@ -2,15 +2,18 @@ import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Locale; import java.util.Set; import com.adobe.epubcheck.api.EPUBProfile; import com.adobe.epubcheck.api.FeatureReport; +import com.adobe.epubcheck.api.LocalizableReport; 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.MoreObjects; import com.google.common.base.Optional; import com.google.common.base.Preconditions; import com.google.common.base.Predicate; @@ -47,6 +50,10 @@ */ public final Report report; /** + * The locale used to log validation messages. Guaranteed non-null. + */ + public final Locale locale; + /** * Used to report some features of the validated resource, without logging. * Guaranteed non-null. */ @@ -76,9 +83,9 @@ public final Set properties; private ValidationContext(String path, String mimeType, EPUBVersion version, EPUBProfile profile, - Report report, FeatureReport featureReport, GenericResourceProvider resourceProvider, - Optional ocf, Optional xrefChecker, Set pubTypes, - Set properties) + Report report, Locale locale, FeatureReport featureReport, + GenericResourceProvider resourceProvider, Optional ocf, + Optional xrefChecker, Set pubTypes, Set properties) { super(); this.path = path; @@ -86,6 +93,7 @@ this.version = version; this.profile = profile; this.report = report; + this.locale = locale; this.featureReport = featureReport; this.resourceProvider = resourceProvider; this.ocf = ocf; @@ -220,12 +228,16 @@ resourceProvider = (resourceProvider == null && ocf != null) ? ocf : resourceProvider; checkNotNull(resourceProvider); checkNotNull(report); + Locale locale = MoreObjects.firstNonNull( + (report instanceof LocalizableReport) ? ((LocalizableReport) report).getLocale() : null, + Locale.getDefault()); 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. of(), properties.build()); + version != null ? version : EPUBVersion.Unknown, + profile != null ? profile : EPUBProfile.DEFAULT, report, locale, + featureReport != null ? featureReport : new FeatureReport(), resourceProvider, + Optional.fromNullable(ocf), Optional.fromNullable(xrefChecker), + pubTypes != null ? ImmutableSet.copyOf(pubTypes) : ImmutableSet. of(), + properties.build()); } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/opf/XRefChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -60,7 +60,7 @@ private static class Reference { - public final String resource; + public final String source; public final int lineNumber; public final int columnNumber; public final String refResource; @@ -70,11 +70,11 @@ public Reference(String srcResource, int srcLineNumber, int srcColumnNumber, String refResource, String fragment, Type type) { - this.fragment = fragment; + this.source = srcResource; this.lineNumber = srcLineNumber; this.columnNumber = srcColumnNumber; this.refResource = refResource; - this.resource = srcResource; + this.fragment = fragment; this.type = type; } @@ -238,7 +238,7 @@ private void checkReference(Reference ref) { Resource res = resources.get(ref.refResource); - Resource host = resources.get(ref.resource); + Resource host = resources.get(ref.source); // Check undeclared resources if (res == null) @@ -252,26 +252,29 @@ else { report.message(MessageId.RSC_007w, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource), + ref.refResource); } } else if (ref.refResource.matches("^[^:/?#]+://.*") && !(version == EPUBVersion.VERSION_3 && (ref.type == Type.AUDIO || ref.type == Type.VIDEO))) { report.message(MessageId.RSC_006, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource)); } else if (!ocf.hasEntry(ref.refResource) && !ref.refResource.matches("^[^:/?#]+://.*")) { report.message(MessageId.RSC_007, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource), + ref.refResource); } else if (!undeclared.contains(ref.refResource)) { undeclared.add(ref.refResource); report.message(MessageId.RSC_008, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource), + ref.refResource); } return; } @@ -286,20 +289,20 @@ && !res.hasValidItemFallback) { report.message(MessageId.RSC_010, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + ((ref.fragment != null) ? '#' + ref.fragment : ""))); } if (/* !res.mimeType.equals("font/opentype") && */!res.item.isInSpine()) { report.message(MessageId.RSC_011, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, + EPUBLocation.create(ref.source, 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, + report.message(MessageId.RSC_009, EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment)); return; } @@ -307,7 +310,7 @@ if (!OPFChecker.isBlessedImageType(res.item.getMimeType()) && !res.hasValidImageFallback) { report.message(MessageId.MED_003, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber), + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber), res.item.getMimeType()); } break; @@ -315,7 +318,7 @@ if (!res.item.isFixedLayout()) { report.message(MessageId.NAV_009, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber)); } return; case SEARCH_KEY: @@ -323,13 +326,13 @@ 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); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber), ref.refResource); } break; case STYLESHEET: if (ref.fragment != null) { - report.message(MessageId.RSC_013, EPUBLocation.create(ref.resource, ref.lineNumber, + report.message(MessageId.RSC_013, EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment)); return; } @@ -354,7 +357,7 @@ if (ref.fragment == null) { report.message(MessageId.RSC_015, - EPUBLocation.create(ref.resource, ref.lineNumber, ref.columnNumber, ref.refResource)); + EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource)); return; } break; @@ -384,7 +387,7 @@ Anchor anchor = res.anchors.get(ref.fragment); if (anchor == null) { - report.message(MessageId.RSC_012, EPUBLocation.create(ref.resource, ref.lineNumber, + report.message(MessageId.RSC_012, EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment)); return; } @@ -394,7 +397,7 @@ case SVG_CLIP_PATH: if (anchor.type != ref.type) { - report.message(MessageId.RSC_014, EPUBLocation.create(ref.resource, ref.lineNumber, + report.message(MessageId.RSC_014, EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment)); } break; @@ -402,7 +405,7 @@ case HYPERLINK: if (anchor.type != ref.type && anchor.type != Type.GENERIC) { - report.message(MessageId.RSC_014, EPUBLocation.create(ref.resource, ref.lineNumber, + report.message(MessageId.RSC_014, EPUBLocation.create(ref.source, ref.lineNumber, ref.columnNumber, ref.refResource + "#" + ref.fragment)); } break; diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ops/OPSHandler30.java 2018-11-26 10:49:29.000000000 +0000 @@ -679,6 +679,10 @@ { inRegionBasedNav = false; } + else if (name.equals("svg")) + { + inSvg = false; + } } /* diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/ops/OPSHandler.java 2018-11-26 10:49:29.000000000 +0000 @@ -224,9 +224,20 @@ URI uri = checkURI(href); if (uri == null) return; - if ("http".equals(uri.getScheme())) + if ("http".equals(uri.getScheme()) || "https".equals(uri.getScheme())) { report.info(path, FeatureEnum.REFERENCE, href); + + /* + * #708 report invalid HTTP/HTTPS URLs + * uri.scheme may be correct, but missing a : or a / from the // + * leads to uri.getHost() == null + */ + if (uri.getHost() == null) + { + int missingSlashes = uri.getSchemeSpecificPart().startsWith("/") ? 1 : 2; + report.message(MessageId.RSC_023, parser.getLocation(), uri, missingSlashes, uri.getScheme()); + } } /* diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/tool/EpubChecker.java 2018-11-26 10:49:29.000000000 +0000 @@ -35,7 +35,9 @@ import com.adobe.epubcheck.api.EPUBProfile; import com.adobe.epubcheck.api.EpubCheck; import com.adobe.epubcheck.api.EpubCheckFactory; +import com.adobe.epubcheck.api.LocalizableReport; import com.adobe.epubcheck.api.Report; +import com.adobe.epubcheck.messages.MessageDictionaryDumper; import com.adobe.epubcheck.nav.NavCheckerFactory; import com.adobe.epubcheck.opf.DocumentValidator; import com.adobe.epubcheck.opf.DocumentValidatorFactory; @@ -62,6 +64,13 @@ public class EpubChecker { + static { + /* fix #665 (window-less "Checker" gui app on Mac) + * set -Djava.awt.headless=true programmatically as early as possible + */ + System.setProperty("java.awt.headless", "true"); + } + String path = null; String mode = null; EPUBProfile profile = null; @@ -77,6 +86,8 @@ boolean listChecks = false; boolean useCustomMessageFile = false; boolean failOnWarnings = false; + private Messages messages = Messages.getInstance(); + private Locale locale = Locale.getDefault(); int reportingLevel = ReportingLevel.Info; @@ -117,6 +128,10 @@ documentValidatorFactoryMap = map; } + public Locale getLocale() { + return locale; + } + int validateFile(String path, EPUBVersion version, Report report, EPUBProfile profile) { GenericResourceProvider resourceProvider; @@ -134,7 +149,7 @@ } else { - System.err.println(String.format(Messages.get("file_not_found"), path)); + System.err.println(String.format(messages.get("file_not_found"), path)); return 1; } } @@ -145,10 +160,10 @@ if (factory == null) { - outWriter.println(Messages.get("display_help")); - System.err.println(String.format(Messages.get("mode_version_not_supported"), mode, version)); + outWriter.println(messages.get("display_help")); + 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, + throw new RuntimeException(String.format(messages.get("mode_version_not_supported"), mode, version)); } @@ -161,27 +176,36 @@ int validationResult = ((EpubCheck) check).doValidate(); if (validationResult == 0) { - outWriter.println(Messages.get("no_errors__or_warnings")); + outWriter.println(messages.get("no_errors__or_warnings")); return 0; } else if (validationResult == 1) { - System.err.println(Messages.get("there_were_warnings")); + System.err.println(messages.get("there_were_warnings")); return failOnWarnings ? 1 : 0; } - System.err.println(Messages.get("there_were_errors")); + System.err.println(messages.get("there_were_errors")); return 1; } else { - if (check.validate()) + boolean validationResult = check.validate(); + if (validationResult) { - outWriter.println(Messages.get("no_errors__or_warnings")); + outWriter.println(messages.get("no_errors__or_warnings")); return 0; } - System.err.println(Messages.get("there_were_errors")); + else if (report.getWarningCount() > 0 && report.getFatalErrorCount() == 0 && report.getErrorCount() == 0) + { + System.err.println(messages.get("there_were_warnings")); + return failOnWarnings ? 1 : 0; + } + else + { + System.err.println(messages.get("there_were_errors")); + return 1; + } } - return 1; } int validateEpubFile(String path, EPUBVersion version, Report report) @@ -201,7 +225,7 @@ } else { - System.err.println(String.format(Messages.get("file_not_found"), path)); + System.err.println(String.format(messages.get("file_not_found"), path)); return 1; } } @@ -212,10 +236,10 @@ if (factory == null) { - outWriter.println(Messages.get("display_help")); - System.err.println(String.format(Messages.get("mode_version_not_supported"), mode, version)); + outWriter.println(messages.get("display_help")); + 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, + throw new RuntimeException(String.format(messages.get("mode_version_not_supported"), mode, version)); } @@ -224,24 +248,33 @@ .report(report).resourceProvider(resourceProvider).mimetype(modeMimeTypeMap.get(opsType)) .version(version).profile(profile).build()); - if (check.validate()) + boolean validationResult = check.validate(); + if (validationResult) { - outWriter.println(Messages.get("no_errors__or_warnings")); + outWriter.println(messages.get("no_errors__or_warnings")); return 0; } - System.err.println(Messages.get("there_were_errors")); - - return 1; + else if (report.getWarningCount() > 0 && report.getFatalErrorCount() == 0 && report.getErrorCount() == 0) + { + System.err.println(messages.get("there_were_warnings")); + return failOnWarnings ? 1 : 0; + } + else + { + System.err.println(messages.get("there_were_errors")); + return 1; + } } public int run(String[] args) { + Report report = null; int returnValue = 1; try { if (processArguments(args)) { - Report report = createReport(); + report = createReport(); report.initialize(); if (listChecks) { @@ -264,12 +297,40 @@ returnValue = 1; } finally { - outWriter.println(Messages.get("epubcheck_completed")); - outWriter.setQuiet(false); + printEpubCheckCompleted(report); } return returnValue; } + private void printEpubCheckCompleted(Report report) + { + if(report != null) { + StringBuilder messageCount = new StringBuilder(); + if(reportingLevel <= ReportingLevel.Fatal) { + messageCount.append(messages.get("messages") + ": "); + messageCount.append(String.format(messages.get("counter_fatal"), report.getFatalErrorCount())); + } + if(reportingLevel <= ReportingLevel.Error) { + messageCount.append(" / " + String.format(messages.get("counter_error"), report.getErrorCount())); + } + if(reportingLevel <= ReportingLevel.Warning) { + messageCount.append(" / " + String.format(messages.get("counter_warn"), report.getWarningCount())); + } + if(reportingLevel <= ReportingLevel.Info) { + messageCount.append(" / " + String.format(messages.get("counter_info"), report.getInfoCount())); + } + if(reportingLevel <= ReportingLevel.Usage) { + messageCount.append(" / " + String.format(messages.get("counter_usage"), report.getUsageCount())); + } + if(messageCount.length() > 0) { + messageCount.append("\n"); + outWriter.println(messageCount); + } + } + outWriter.println(messages.get("epubcheck_completed")); + outWriter.setQuiet(false); + } + private void dumpMessageDictionary(Report report) throws IOException { @@ -284,12 +345,12 @@ { fw = new OutputStreamWriter(System.out); } - report.getDictionary().dumpMessages(fw); + new MessageDictionaryDumper(report.getDictionary()).dump(fw); } catch (Exception e) { if (listChecksOut != null) { - System.err.println(String.format(Messages.get("error_creating_config_file"), + System.err.println(String.format(messages.get("error_creating_config_file"), listChecksOut.getAbsoluteFile())); } System.err.println(e.getMessage()); @@ -310,7 +371,7 @@ private Report createReport() throws IOException { - Report report; + LocalizableReport report; if (listChecks) { report = new DefaultReportImpl("none"); @@ -350,6 +411,7 @@ report = new DefaultReportImpl(path); } report.setReportingLevel(this.reportingLevel); + report.setLocale(locale); if (useCustomMessageFile) { report.setOverrideFile(customMessageFile); @@ -360,12 +422,13 @@ public int processEpubFile(String[] args) { + Report report = null; int returnValue = 1; try { if (processArguments(args)) { - Report report = createReport(); + report = createReport(); report.initialize(); if (listChecks) { @@ -388,8 +451,7 @@ returnValue = 1; } finally { - outWriter.println(Messages.get("epubcheck_completed")); - outWriter.setQuiet(false); + printEpubCheckCompleted(report); } return returnValue; } @@ -408,13 +470,13 @@ if (mode != null) { report.info(null, FeatureEnum.EXEC_MODE, - String.format(Messages.get("single_file"), mode, version.toString(), profile)); + String.format(messages.get("single_file"), mode, version.toString(), profile)); } result = validateFile(path, version, report, profile); } else { - System.err.println(Messages.get("error_processing_unexpanded_epub")); + System.err.println(messages.get("error_processing_unexpanded_epub")); return 1; } @@ -440,14 +502,21 @@ { if (expanded) { - Archive epub; + // check existance of path (fix #525) + File f = new File(path); + if (!f.exists()) + { + System.err.println(String.format(messages.get("directory_not_found"), path)); + return 1; + } + Archive epub; try { epub = new Archive(path, true); } catch (RuntimeException ex) { - System.err.println(Messages.get("there_were_errors")); + System.err.println(messages.get("there_were_errors")); return 1; } @@ -457,17 +526,17 @@ int validationResult = check.doValidate(); if (validationResult == 0) { - outWriter.println(Messages.get("no_errors__or_warnings")); + outWriter.println(messages.get("no_errors__or_warnings")); result = 0; } else if (validationResult == 1) { - System.err.println(Messages.get("there_were_warnings")); + System.err.println(messages.get("there_were_warnings")); result = failOnWarnings ? 1 : 0; } else if (validationResult >= 2) { - System.err.println(Messages.get("there_were_errors")); + System.err.println(messages.get("there_were_errors")); result = 1; } @@ -476,7 +545,7 @@ if ((report.getErrorCount() > 0) || (report.getFatalErrorCount() > 0)) { // keep if valid or only warnings - System.err.println(Messages.get("deleting_archive")); + System.err.println(messages.get("deleting_archive")); epub.deleteEpubFile(); } } @@ -490,7 +559,7 @@ if (mode != null) { report.info(null, FeatureEnum.EXEC_MODE, - String.format(Messages.get("single_file"), mode, version.toString(), profile)); + String.format(messages.get("single_file"), mode, version.toString(), profile)); } result = validateFile(path, version, report, profile); } @@ -524,14 +593,14 @@ // Exit if there are no arguments passed to main if (args.length < 1) { - System.err.println(Messages.get("argument_needed")); + System.err.println(messages.get("argument_needed")); return false; } setCustomMessageFileFromEnvironment(); for (int i = 0; i < args.length; i++) { - if (args[i].equals("--version") || args[i].equals("-version") || args[i].equals("-v")) + if (args[i].equals("-v")) { if (i + 1 < args.length) { @@ -546,15 +615,15 @@ } else { - outWriter.println(Messages.get("display_help")); + outWriter.println(messages.get("display_help")); throw new RuntimeException(new InvalidVersionException( InvalidVersionException.UNSUPPORTED_VERSION)); } } else { - outWriter.println(Messages.get("display_help")); - throw new RuntimeException(Messages.get("version_argument_expected")); + outWriter.println(messages.get("display_help")); + throw new RuntimeException(messages.get("version_argument_expected")); } } else if (args[i].equals("--mode") || args[i].equals("-mode") || args[i].equals("-m")) @@ -566,8 +635,8 @@ } else { - outWriter.println(Messages.get("display_help")); - throw new RuntimeException(Messages.get("mode_argument_expected")); + outWriter.println(messages.get("display_help")); + throw new RuntimeException(messages.get("mode_argument_expected")); } } else if (args[i].equals("--profile") || args[i].equals("-profile") || args[i].equals("-p")) @@ -580,14 +649,14 @@ profile = EPUBProfile.valueOf(profileStr.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { - System.err.println(Messages.get("mode_version_ignored", profileStr)); + 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")); + 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")) @@ -727,7 +796,7 @@ } else { - System.err.println(String.format(Messages.get("expected_message_filename"), fileName)); + System.err.println(String.format(messages.get("expected_message_filename"), fileName)); displayHelp(); return false; } @@ -748,11 +817,42 @@ } listChecks = true; } + else if (args[i].equals("--locale")) + { + if(i + 1 < args.length) + { + if(args[i + 1].startsWith("-")) + { + System.err.println(String.format(messages.get("incorrect_locale"), args[i + 1], "incorrect")); + displayHelp(); + return false; + } + else + { + String langTag = args[++i]; + // Rather than attempting to validate the locale, we will just + // allow it to fallback to the default in the case of invalid + // language tags. + this.locale = Locale.forLanguageTag(langTag); + this.messages = Messages.getInstance(this.locale); + } + } + else + { + System.err.println(String.format(messages.get("incorrect_locale"), "", "missing")); + displayHelp(); + return false; + } + } else if (args[i].equals("--help") || args[i].equals("-help") || args[i].equals("-h") || args[i].equals("-?")) { displayHelp(); // display help message } + else if (args[i].equals("--version") || args[i].equals("-version")) + { + displayVersion(); + } else { if (path == null) @@ -761,7 +861,7 @@ } 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; } @@ -770,7 +870,7 @@ if ((xmlOutput && xmpOutput) || (xmlOutput && jsonOutput) || (xmpOutput && jsonOutput)) { - System.err.println(Messages.get("output_type_conflict")); + System.err.println(messages.get("output_type_conflict")); return false; } if (path != null) @@ -798,7 +898,7 @@ } else { - System.err.println(Messages.get("no_file_specified")); + System.err.println(messages.get("no_file_specified")); return false; } } @@ -806,13 +906,13 @@ { if (mode != null || version != EPUBVersion.VERSION_3) { - System.err.println(Messages.get("mode_version_ignored")); + System.err.println(messages.get("mode_version_ignored")); mode = null; } } - else if (mode == null) + else if (mode == null && profile == null) { - outWriter.println(Messages.get("mode_required")); + outWriter.println(messages.get("mode_required")); return false; } @@ -838,8 +938,16 @@ * This method displays a short help message that describes the command-line * usage of this tool */ - private static void displayHelp() + private void displayHelp() + { + outWriter.println(String.format(messages.get("help_text"), EpubCheck.version())); + } + + /** + * This method displays the EpubCheck version. + */ + private void displayVersion() { - outWriter.println(String.format(Messages.get("help_text"), EpubCheck.version())); + outWriter.println(String.format(messages.get("epubcheck_version_text"), EpubCheck.version())); } } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/CheckUtil.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/CheckUtil.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/CheckUtil.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/CheckUtil.java 2018-11-26 10:49:29.000000000 +0000 @@ -69,13 +69,16 @@ { if ((c = input.read()) == -1) { - return false; + return true; // ignored; should be checked by checkEpubHeader() in com.adobe.epubcheck.api.EpubCheck } else { baos.write(c); } } + if (! baos.toString().equals("application/epub+zip")) { + return true; // ignored; should be checked by checkEpubHeader() in com.adobe.epubcheck.api.EpubCheck + } int ch = input.read(); if (version == EPUBVersion.VERSION_2 && ch != -1) diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/DefaultReportImpl.java 2018-11-26 10:49:29.000000000 +0000 @@ -37,14 +37,14 @@ public DefaultReportImpl(String ePubName) { this(ePubName, null, false); - } + } public DefaultReportImpl(String ePubName, String info, boolean quiet) - { - this.quiet = quiet; + { + this.quiet = quiet; String adjustedPath = PathUtil.removeWorkingDirectory(ePubName); this.setEpubFileName(adjustedPath); - if (info != null) + if (info != null) { //warning("", 0, 0, info); } @@ -89,12 +89,14 @@ String formatMessage(Message message, EPUBLocation location, Object... args) { - String fileName = (location.getPath() == null ? "" : "/" + location.getPath()); - fileName = PathUtil.removeWorkingDirectory(fileName); + String epubFileName = PathUtil.removeWorkingDirectory(this.getEpubFileName()); + String fileName = PathUtil.removeWorkingDirectory(location.getPath()); + // remove duplicate epub name from path and empty fileName variable + fileName = epubFileName.endsWith(fileName) ? "" : "/" + fileName; return String.format("%1$s(%2$s): %3$s%4$s(%5$s,%6$s): %7$s", message.getSeverity(), message.getID(), - PathUtil.removeWorkingDirectory(this.getEpubFileName()), + epubFileName, fileName, location.getLine(), location.getColumn(), @@ -111,7 +113,7 @@ case FORMAT_VERSION: if (!quiet) { - outWriter.println(String.format(Messages.get("validating_version_message"), value)); + outWriter.println(String.format(getMessages().get("validating_version_message"), value)); } break; default: diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/Messages.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/Messages.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/Messages.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/Messages.java 2018-11-26 10:49:29.000000000 +0000 @@ -22,8 +22,6 @@ package com.adobe.epubcheck.util; -import com.google.common.base.Charsets; - import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -37,32 +35,104 @@ import java.util.ResourceBundle; import java.util.ResourceBundle.Control; -public class Messages { +import com.google.common.base.Charsets; +import com.google.common.collect.HashBasedTable; +import com.google.common.collect.Table; - private static final String BUNDLE_NAME = "com.adobe.epubcheck.util.messages"; //$NON-NLS-1$ - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault(), new UTF8Control()); +public class Messages +{ - private Messages() + private static final String BUNDLE_NAME = "com.adobe.epubcheck.util.messages"; + private static final Table messageTable = HashBasedTable.create(); + + private ResourceBundle bundle; + private Locale locale; + + /** + * Returns messages localized for the default (host) locale. + * @return Messages localized for the default locale. + */ + public static Messages getInstance() { + return getInstance(null, null); } - public static String get(String key) + /** + * Get a Messages instance that has been localized for the given locale, or the + * default locale if locale is null. Note that passing an unknown locale returns + * the default messages. + * + * @param locale + * The locale to use for localization of the messages. + * @return The localized messages or default. + */ + public static Messages getInstance(Locale locale) { - try - { - return RESOURCE_BUNDLE.getString(key); - } - catch (MissingResourceException e) + return getInstance(locale, null); + } + + /** + * Get a Messages instance that has been localized for the given locale, or + * the default locale if locale is null. Note that passing an unknown locale + * returns the default messages. + * + * @param locale + * The locale to use for localization of the messages. + * @return The localized messages or default. + */ + public static Messages getInstance(Locale locale, Class cls) + { + Messages instance = null; + locale = (locale == null) ? Locale.getDefault() : locale; + + String bundleKey = (cls==null)? BUNDLE_NAME : getBundleName(cls); + String localeKey = locale.getLanguage(); + if (messageTable.contains(bundleKey, localeKey)) { + instance = messageTable.get(bundleKey, localeKey); + } + else { - return key; + synchronized (Messages.class) + { + if (instance == null) + { + instance = new Messages(locale, bundleKey); + messageTable.put(bundleKey, localeKey, instance); + } + } } + + return instance; + + } + + private static String getBundleName(Class cls) { + String className = cls.getName(); + int i = className.lastIndexOf('.'); + return ((i > 0) ? className.substring(0, i + 1) : "") + "messages"; + } + + protected Messages() + { + this(null); + } + + protected Messages(Locale locale) + { + this(locale, BUNDLE_NAME); + } + + protected Messages(Locale locale, String bundleName) + { + this.locale = (locale != null) ? locale : Locale.getDefault(); + this.bundle = ResourceBundle.getBundle(bundleName, this.locale, new UTF8Control()); } - public static String get(String key, Object... arguments) + public String get(String key) { try { - return MessageFormat.format(RESOURCE_BUNDLE.getString(key), arguments); + return bundle.getString(key); } catch (MissingResourceException e) { @@ -70,8 +140,19 @@ } } - private static class UTF8Control extends Control + public String get(String key, Object... arguments) + { + return MessageFormat.format(get(key), arguments); + } + + public Locale getLocale() + { + return locale; + } + + private class UTF8Control extends Control { + @Override public ResourceBundle newBundle (String baseName, Locale locale, String format, ClassLoader loader, boolean reload) throws diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/WriterReportImpl.java 2018-11-26 10:49:29.000000000 +0000 @@ -114,7 +114,7 @@ case FORMAT_VERSION: if (DEBUG && !quiet) { - outWriter.println(String.format(Messages.get("validating_version_message"), value)); + outWriter.println(String.format(getMessages().get("validating_version_message"), value)); } break; default: diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/XmlReportAbstract.java 2018-11-26 10:49:29.000000000 +0000 @@ -1,5 +1,6 @@ package com.adobe.epubcheck.util; +import java.io.File; import java.io.PrintWriter; import java.text.CharacterIterator; import java.text.SimpleDateFormat; @@ -122,6 +123,9 @@ @Override public void info(String resource, FeatureEnum feature, String value) { + // Dont store 'null' values + if (value == null) return; + switch (feature) { case TOOL_DATE: if (value != null && !value.startsWith("$")) { @@ -221,9 +225,19 @@ if (path == null || path.length() == 0) { return null; } + // Try / because of uris int lastSlash = path.lastIndexOf('/'); if (lastSlash == -1) { - return path; + if (File.separatorChar != '/') { + int lastSlash2 = path.lastIndexOf(File.separatorChar); + if (lastSlash2 == -1) { + return path; + } else { + return path.substring(lastSlash2 + 1); + } + } else { + return path; + } } else { return path.substring(lastSlash + 1); } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/util/XmlReportImpl.java 2018-11-26 10:49:29.000000000 +0000 @@ -27,14 +27,16 @@ try { setNamespace("http://hul.harvard.edu/ois/xml/ns/jhove"); + addPrefixNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance"); List> attrs = new ArrayList>(); attrs.add(KeyValue.with("name", epubCheckName)); attrs.add(KeyValue.with("release", epubCheckVersion)); attrs.add(KeyValue.with("date", epubCheckDate)); + attrs.add(KeyValue.with("xsi:schemaLocation", "http://hul.harvard.edu/ois/xml/ns/jhove http://hul.harvard.edu/ois/xml/xsd/jhove/jhove.xsd")); startElement("jhove", attrs); generateElement("date", generationDate); - startElement("repInfo", KeyValue.with("uri", getNameFromPath(getEpubFileName()))); + startElement("repInfo", KeyValue.with("uri", getEpubFileName())); generateElement("created", creationDate); generateElement("lastModified", lastModifiedDate); if (formatName == null) { @@ -108,6 +110,7 @@ generateElement("mimeType", formatName); startElement("properties"); + generateProperty("FileName", getNameFromPath(getEpubFileName()), "String"); generateProperty("PageCount", pagesCount); generateProperty("CharacterCount", charsCount); generateProperty("Language", language, "String"); @@ -162,7 +165,7 @@ generateElement("name", "Font"); startElement("values", KeyValue.with("arity", "List"), KeyValue.with("type", "Property")); generateProperty("FontName", getNameFromPath(f), "String"); - generateProperty("FontFile", false); + generateProperty("FontFile", true); endElement("values"); endElement("property"); } diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/vocab/PrefixDeclarationParser.java 2018-11-26 10:49:29.000000000 +0000 @@ -9,7 +9,7 @@ import java.util.List; import java.util.Map; -import net.sf.saxon.om.Name10Checker; +import net.sf.saxon.om.NameChecker; import com.adobe.epubcheck.api.EPUBLocation; import com.adobe.epubcheck.api.Report; @@ -102,7 +102,7 @@ { // empty prefix report.message(MessageId.OPF_004a, location); - } else if (!Name10Checker.getInstance().isValidNCName(chars)) + } else if (!NameChecker.isValidNCName(chars)) { // bad prefix report.message(MessageId.OPF_004b, location, chars); diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/xml/XMLParser.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/xml/XMLParser.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/xml/XMLParser.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/xml/XMLParser.java 2018-11-26 10:49:29.000000000 +0000 @@ -333,7 +333,8 @@ else { report.message(MessageId.RSC_005, - EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), message); + EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), + message); } } @@ -341,14 +342,16 @@ throws SAXException { report.message(MessageId.RSC_016, - EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), ex.getMessage()); + EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), + ex.getMessage()); } public void warning(SAXParseException ex) throws SAXException { report.message(MessageId.RSC_017, - EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), ex.getMessage()); + EPUBLocation.create(path, ex.getLineNumber(), ex.getColumnNumber()), + ex.getMessage()); } public void characters(char[] arg0, int arg1, int arg2) @@ -1005,7 +1008,7 @@ // 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.0 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", diff -Nru epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java --- epubcheck-4.0.2/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/adobe/epubcheck/xml/XMLValidator.java 2018-11-26 10:49:29.000000000 +0000 @@ -28,6 +28,7 @@ import java.net.URISyntaxException; import java.net.URL; +import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import org.idpf.epubcheck.util.saxon.ColumnNumberFunction; @@ -54,8 +55,13 @@ import net.sf.saxon.Configuration; import net.sf.saxon.TransformerFactoryImpl; +import net.sf.saxon.lib.FeatureKeys; +import net.sf.saxon.lib.StandardErrorListener; import net.sf.saxon.sxpath.IndependentContext; import net.sf.saxon.sxpath.XPathStaticContext; +import net.sf.saxon.trans.SymbolicName; +import net.sf.saxon.trans.XPathException; + public class XMLValidator { @@ -171,22 +177,39 @@ public void initTransformerFactory(TransformerFactory factory) { super.initTransformerFactory(factory); + SymbolicName.F lineNumberFn = new SymbolicName.F(LineNumberFunction.QNAME, 0); + SymbolicName.F columnNumberFn = new SymbolicName.F(ColumnNumberFunction.QNAME, 0); + SymbolicName.F systemIdFn = new SymbolicName.F(SystemIdFunction.QNAME, 0); if (factory instanceof TransformerFactoryImpl) { Configuration configuration = ((TransformerFactoryImpl) factory).getConfiguration(); XPathStaticContext xpathContext = new IndependentContext(configuration); - if (!xpathContext.getFunctionLibrary().isAvailable(LineNumberFunction.QNAME, -1)) + if (!xpathContext.getFunctionLibrary().isAvailable(lineNumberFn)) { configuration.registerExtensionFunction(new LineNumberFunction()); } - if (!xpathContext.getFunctionLibrary().isAvailable(ColumnNumberFunction.QNAME, -1)) + if (!xpathContext.getFunctionLibrary().isAvailable(columnNumberFn)) { configuration.registerExtensionFunction(new ColumnNumberFunction()); } - if (!xpathContext.getFunctionLibrary().isAvailable(SystemIdFunction.QNAME, -1)) + if (!xpathContext.getFunctionLibrary().isAvailable(systemIdFn)) { configuration.registerExtensionFunction(new SystemIdFunction()); } + // Used to silence Saxon's warning about an XPath expression in Jing's built-in Schematron XSLT + // See issue #859 + factory.setAttribute(FeatureKeys.XSLT_STATIC_ERROR_LISTENER_CLASS, SilencingErrorListener.class.getName()); + } + } + } + + public static class SilencingErrorListener extends StandardErrorListener { + + @Override + public void warning(TransformerException exception) { + XPathException xe = XPathException.makeXPathException(exception); + if (!"SXWN9000".equals(xe.getErrorCodeLocalPart())) { + super.warning(exception); } } } diff -Nru epubcheck-4.0.2/src/main/java/com/thaiopensource/util/Localizer.java epubcheck-4.1.0/src/main/java/com/thaiopensource/util/Localizer.java --- epubcheck-4.0.2/src/main/java/com/thaiopensource/util/Localizer.java 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/com/thaiopensource/util/Localizer.java 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1,67 @@ +package com.thaiopensource.util; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.ResourceBundle; + +import com.adobe.epubcheck.messages.LocaleHolder; +import com.adobe.epubcheck.messages.LocalizedMessages; + +import java.text.MessageFormat; + +/** + * This is a monkey-patch for Jing's {@link Localizer} class to attempt at + * making it slightly more locale-aware. + * + * Whenever a message is localized, is uses a {@link ResourceBundle} for the + * {@code Locale} held as a thread-local static variable in the + * {@code LocaleHolder} class. + * + */ +public class Localizer +{ + private final Class cls; + private final Map bundles = new HashMap<>(); + + public Localizer(Class cls) + { + this.cls = cls; + } + + public String message(String key) + { + return MessageFormat.format(getBundle().getString(key), new Object[]{}); + } + + public String message(String key, Object arg) + { + return MessageFormat.format(getBundle().getString(key), new Object[] { arg }); + } + + public String message(String key, Object arg1, Object arg2) + { + return MessageFormat.format(getBundle().getString(key), new Object[] { arg1, arg2 }); + } + + public String message(String key, Object[] args) + { + return MessageFormat.format(getBundle().getString(key), args); + } + + private ResourceBundle getBundle() + { + Locale locale = LocaleHolder.get(); + if (!bundles.containsKey(locale)) + { + String s = cls.getName(); + int i = s.lastIndexOf('.'); + if (i > 0) s = s.substring(0, i + 1); + else + s = ""; + bundles.put(locale, ResourceBundle.getBundle(s + "resources.Messages", LocaleHolder.get(), + new LocalizedMessages.UTF8Control())); + } + return bundles.get(locale); + } +} diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssEscape.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssEscape.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssEscape.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssEscape.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,17 +21,20 @@ */ package org.idpf.epubcheck.util.css; -import com.google.common.base.CharMatcher; -import com.google.common.base.Objects; -import com.google.common.base.Optional; -import org.idpf.epubcheck.util.css.CssExceptions.CssException; -import org.idpf.epubcheck.util.css.CssToken.TokenBuilder; +import static com.google.common.base.Preconditions.checkArgument; +import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.SCANNER_PREMATURE_EOF; +import static org.idpf.epubcheck.util.css.CssScanner.HEXCHAR; +import static org.idpf.epubcheck.util.css.CssScanner.WHITESPACE; +import static org.idpf.epubcheck.util.css.CssScanner.isNewLine; import java.io.IOException; -import static com.google.common.base.Preconditions.checkArgument; -import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.SCANNER_PREMATURE_EOF; -import static org.idpf.epubcheck.util.css.CssScanner.*; +import org.idpf.epubcheck.util.css.CssExceptions.CssException; +import org.idpf.epubcheck.util.css.CssToken.TokenBuilder; + +import com.google.common.base.CharMatcher; +import com.google.common.base.MoreObjects; +import com.google.common.base.Optional; /** * Represents a CSS escape sequence. @@ -190,7 +193,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .add("escaped", sequence) .add("unescaped", (char) character) .toString(); diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssExceptions.java 2018-11-26 10:49:29.000000000 +0000 @@ -22,11 +22,14 @@ package org.idpf.epubcheck.util.css; -import com.google.common.base.Objects; -import com.google.common.base.Optional; - import static com.google.common.base.Preconditions.checkNotNull; +import java.util.Locale; + +import com.adobe.epubcheck.util.Messages; +import com.google.common.base.MoreObjects; +import com.google.common.base.Optional; + /** * Exception types and error codes. * @@ -59,20 +62,20 @@ @Override public String toString() { - return Objects.toStringHelper(this.getClass()).addValue(value).toString(); + return MoreObjects.toStringHelper(this.getClass()).addValue(value).toString(); } } - /** * An exception with grammatical origins. */ static class CssGrammarException extends CssException { - CssGrammarException(final CssErrorCode errorCode, final CssLocation location, final Object... arguments) + CssGrammarException(final CssErrorCode errorCode, final CssLocation location, + final Locale locale, final Object... arguments) { - super(errorCode, location, arguments); + super(errorCode, location, locale, arguments); } private static final long serialVersionUID = -7470976690623543450L; @@ -84,14 +87,16 @@ static class CssScannerException extends CssException { - CssScannerException(final CssToken token, final CssErrorCode errorCode, final CssLocation location, final Object... arguments) + CssScannerException(final CssToken token, final CssErrorCode errorCode, + final CssLocation location, Locale locale, final Object... arguments) { - super(token, errorCode, location, arguments); + super(token, errorCode, location, locale, arguments); } - CssScannerException(CssErrorCode errorCode, CssLocation location, Object... arguments) + CssScannerException(CssErrorCode errorCode, CssLocation location, Locale locale, + Object... arguments) { - super(errorCode, location, arguments); + super(errorCode, location, locale, arguments); } private static final long serialVersionUID = 7105109387886737631L; @@ -103,17 +108,19 @@ final CssLocation location; final Optional token; - CssException(final CssToken token, final CssErrorCode errorCode, final CssLocation location, final Object... arguments) + CssException(final CssToken token, final CssErrorCode errorCode, final CssLocation location, + final Locale locale, final Object... arguments) { - super(Messages.get(errorCode.value, arguments)); + super(Messages.getInstance(locale, CssExceptions.class).get(errorCode.value, arguments)); this.errorCode = checkNotNull(errorCode); this.location = checkNotNull(location); this.token = token == null ? absent : Optional.of(token); } - CssException(final CssErrorCode errorCode, final CssLocation location, final Object... arguments) + CssException(final CssErrorCode errorCode, final CssLocation location, final Locale locale, + final Object... arguments) { - this(null, errorCode, location, arguments); + this(null, errorCode, location, locale, arguments); } public CssErrorCode getErrorCode() @@ -129,10 +136,8 @@ @Override public String toString() { - return Objects.toStringHelper(this.getClass()) - .add("errorCode", errorCode) - .add("location", location.toString()) - .toString(); + return MoreObjects.toStringHelper(this.getClass()).add("errorCode", errorCode) + .add("location", location.toString()).toString(); } @Override @@ -141,8 +146,7 @@ if (obj instanceof CssException) { CssException exc = (CssException) obj; - if (exc.errorCode.equals(this.errorCode) - && exc.location.equals(this.location)) + if (exc.errorCode.equals(this.errorCode) && exc.location.equals(this.location)) { return true; } diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssGrammar.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssGrammar.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssGrammar.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssGrammar.java 2018-11-26 10:49:29.000000000 +0000 @@ -22,23 +22,41 @@ package org.idpf.epubcheck.util.css; -import com.google.common.base.*; -import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.GRAMMAR_UNEXPECTED_TOKEN; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_ATTRIBUTE_SELECTOR_MATCHERS; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_CLOSEPAREN; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_CLOSESQUAREBRACKET; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_COLON; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_COMBINATOR_CHAR; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_COMMA; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_OPENBRACE; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_OPENPAREN; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_OPENSQUAREBRACKET; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_PIPE; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_STAR; +import static org.idpf.epubcheck.util.css.CssToken.Matchers.MATCH_STAR_PIPE; +import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_NONE; + +import java.util.List; +import java.util.Locale; +import java.util.Map; + import org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode; import org.idpf.epubcheck.util.css.CssExceptions.CssException; import org.idpf.epubcheck.util.css.CssExceptions.CssGrammarException; import org.idpf.epubcheck.util.css.CssParser.ContextRestrictions; import org.idpf.epubcheck.util.css.CssTokenList.CssTokenIterator; -import java.util.List; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode.GRAMMAR_UNEXPECTED_TOKEN; -import static org.idpf.epubcheck.util.css.CssToken.Matchers.*; -import static org.idpf.epubcheck.util.css.CssTokenList.Filters.FILTER_NONE; +import com.adobe.epubcheck.util.Messages; +import com.google.common.base.Ascii; +import com.google.common.base.Joiner; +import com.google.common.base.MoreObjects; +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Lists; /** * CSS grammar components. @@ -125,7 +143,7 @@ @Override public String toString() { - return Objects.toStringHelper(this).addValue(value).toString(); + return MoreObjects.toStringHelper(this).addValue(value).toString(); } @Override @@ -349,7 +367,7 @@ @Override public String toString() { - return Objects.toStringHelper(this).addValue(subType.name()).addValue(value).toString(); + return MoreObjects.toStringHelper(this).addValue(subType.name()).addValue(value).toString(); } } @@ -401,7 +419,7 @@ @Override public String toString() { - return Objects.toStringHelper(this).addValue(subType.name()).addValue(value).toString(); + return MoreObjects.toStringHelper(this).addValue(subType.name()).addValue(value).toString(); } } @@ -449,7 +467,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .addValue(type) .addValue(name.isPresent() ? name.get() : "") .addValue(components.isEmpty() ? "" : Joiner.on(" ").join(components)) @@ -593,7 +611,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .addValue(type) .addValue(subType) .addValue(Joiner.on(" ").join(components)) @@ -659,7 +677,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .addValue(getSubType().name()) .addValue(getName().get()) .addValue(function != null ? Joiner.on(" ").join(function.components) : "") @@ -772,13 +790,21 @@ static final class CssSelectorConstructFactory { + private final Locale locale; + private final Messages messages; + + public CssSelectorConstructFactory(Locale locale) { + this.locale = locale; + this.messages = Messages.getInstance(locale, CssGrammar.class); + } + /** * Create a simple selector sequence. If creation fails, * errors are issued, and null is returned. * * @throws CssException */ - public static CssSimpleSelectorSequence createSimpleSelectorSequence(final CssToken start, + public CssSimpleSelectorSequence createSimpleSelectorSequence(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -816,7 +842,7 @@ * errors are issued, and null is returned. On return, the iterator * will return the next token after the constructs last token. */ - static CssConstruct createSimpleSelector(final CssToken start, final CssTokenIterator iter, + CssConstruct createSimpleSelector(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -862,7 +888,7 @@ else { - err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, start.location, start.chars)); + err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, start.location, locale, start.chars)); return null; } @@ -872,7 +898,7 @@ * Create a combinator. Note that this method does not support the S combinator. * This method also returns null without issuing errors */ - static CssSelectorCombinator createCombinator(final CssToken start, + CssSelectorCombinator createCombinator(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) { char symbol; @@ -904,7 +930,7 @@ return new CssSelectorCombinator(symbol, start.location); } - static CssPseudoSelector createPseudoSelector(final CssToken start, + CssPseudoSelector createPseudoSelector(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -957,7 +983,7 @@ if (func == null) { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_UNEXPECTED_TOKEN, iter.last.location, iter.last.chars, + CssErrorCode.GRAMMAR_UNEXPECTED_TOKEN, iter.last.location, locale, iter.last.chars, next.getChars())); return null; } @@ -966,7 +992,7 @@ return cps; } - static CssConstruct createFunctionalPseudo(final CssToken start, + CssConstruct createFunctionalPseudo(final CssToken start, final CssTokenIterator iter, final Predicate limit, final CssErrorHandler err) { @@ -995,7 +1021,7 @@ return function; } - static CssConstruct createNegationPseudo(final CssToken start, + CssConstruct createNegationPseudo(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -1005,7 +1031,7 @@ CssFunction negation = new CssFunction(name, start.location); CssToken tk = iter.next(); - CssConstruct cc = CssSelectorConstructFactory.createSimpleSelector(tk, iter, err); + CssConstruct cc = createSimpleSelector(tk, iter, err); if (cc == null || !ContextRestrictions.PSEUDO_NEGATION.apply(cc)) { return null; @@ -1018,7 +1044,7 @@ return negation; } - static CssAttributeSelector createAttributeSelector(final CssToken start, + CssAttributeSelector createAttributeSelector(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -1051,8 +1077,8 @@ else { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, next.chars, - Messages.get("a_string_or_dentifier"))); + CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, locale, next.chars, + messages.get("a_string_or_dentifier"))); return null; } iter.next(); // ']' @@ -1060,15 +1086,15 @@ else { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, next.chars, - Messages.get("an_attribute_value_matcher"))); + CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, locale, next.chars, + messages.get("an_attribute_value_matcher"))); return null; } } return cas; } - static CssAttributeMatchSelector createAttributeMatchSelector(final CssToken tk, + CssAttributeMatchSelector createAttributeMatchSelector(final CssToken tk, final CssTokenIterator iter, final CssErrorHandler err) { CssAttributeMatchSelector.Type type; @@ -1096,7 +1122,7 @@ return new CssAttributeMatchSelector(tk.getChars(), type, tk.location); } - private static CssTypeSelector createTypeSelector(final CssToken start, + CssTypeSelector createTypeSelector(final CssToken start, final CssTokenIterator iter, final CssErrorHandler err) throws CssException { @@ -1104,8 +1130,8 @@ if (start.type != CssToken.Type.IDENT && !MATCH_STAR_PIPE.apply(start)) { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_EXPECTING_TOKEN, start.location, - start.getChars(), Messages.get("a_type_or_universal_selector"))); + CssErrorCode.GRAMMAR_EXPECTING_TOKEN, start.location, locale, + start.getChars(), messages.get("a_type_or_universal_selector"))); return null; } @@ -1119,8 +1145,8 @@ if (next.type != CssToken.Type.IDENT) { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, - next.getChars(), Messages.get("a_type_or_universal_selector"))); + CssErrorCode.GRAMMAR_EXPECTING_TOKEN, next.location, locale, + next.getChars(), messages.get("a_type_or_universal_selector"))); return null; } else @@ -1136,8 +1162,8 @@ if (next.type != CssToken.Type.IDENT && !MATCH_STAR.apply(next)) { err.error(new CssGrammarException( - CssErrorCode.GRAMMAR_EXPECTING_TOKEN, start.location, - next.getChars(), Messages.get("a_type_or_universal_selector"))); + CssErrorCode.GRAMMAR_EXPECTING_TOKEN, start.location, locale, + next.getChars(), messages.get("a_type_or_universal_selector"))); return null; } else diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssLocation.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssLocation.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssLocation.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssLocation.java 2018-11-26 10:49:29.000000000 +0000 @@ -22,10 +22,10 @@ package org.idpf.epubcheck.util.css; -import com.google.common.base.Objects; - import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.MoreObjects; + /** * Represents a location in a CSS file. * @@ -75,7 +75,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .add("line", line) .add("col", col) .add("charOffset", charOffset) diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssParser.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssParser.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssParser.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssParser.java 2018-11-26 10:49:29.000000000 +0000 @@ -30,6 +30,7 @@ import java.io.IOException; import java.io.Reader; import java.util.List; +import java.util.Locale; import java.util.NoSuchElementException; import org.idpf.epubcheck.util.css.CssExceptions.CssException; @@ -46,6 +47,7 @@ import org.idpf.epubcheck.util.css.CssTokenList.CssTokenIterator; import org.idpf.epubcheck.util.css.CssTokenList.PrematureEOFException; +import com.adobe.epubcheck.util.Messages; import com.google.common.base.Predicate; import com.google.common.collect.Lists; @@ -57,6 +59,32 @@ public final class CssParser { private final boolean debug = false; + private final Messages messages; + private final CssSelectorConstructFactory cssSelectorFactory; + + /** + * Builds a new CSS parser reporting errors in the default locale. + *

+ * The localized constructor {@link #CssParser(Locale)} should be preferred over + * this one, except for tests. + *

+ */ + public CssParser() + { + this(Locale.getDefault()); + } + + /** + * Builds a new CSS parser that will report parsing errors in the given locale. + * + * @param locale + * the locale used in the parsing errors. + */ + public CssParser(Locale locale) + { + this.messages = Messages.getInstance(locale, CssParser.class); + this.cssSelectorFactory = new CssSelectorConstructFactory(locale); + } /* * TODOs @@ -181,7 +209,7 @@ { tokens.add(token); } - }).scan(); + }, messages.getLocale()).scan(); return tokens.iterator(FILTER_S_CMNT); // default filter } @@ -222,8 +250,8 @@ } catch (NoSuchElementException nse) { - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, - iter.last.location, "'" + errChar + "'")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), "'" + errChar + "'")); throw new PrematureEOFException(); } @@ -234,9 +262,8 @@ } /** - * With start token being the first non-ignorable token inside the - * declaration block, iterate issuing CssDeclaration objects until the block - * ends. + * With start token being the first non-ignorable token inside the declaration + * block, iterate issuing CssDeclaration objects until the block ends. */ private void handleDeclarationBlock(CssToken start, CssTokenIterator iter, final CssContentHandler doc, CssErrorHandler err) throws @@ -294,8 +321,8 @@ } catch (NoSuchElementException nse) { - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' " - + Messages.get("or") + " '}'")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), "';' " + messages.get("or") + " '}'")); throw new PrematureEOFException(); } } @@ -313,8 +340,8 @@ if (name.type != CssToken.Type.IDENT) { - err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location, name - .getChars(), Messages.get("a_property_name"))); + err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location, + messages.getLocale(), name.getChars(), messages.get("a_property_name"))); return null; } @@ -324,14 +351,15 @@ { if (!MATCH_COLON.apply(iter.next())) { - err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location, iter.last - .getChars(), ":")); + err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, name.location, + messages.getLocale(), iter.last.getChars(), ":")); return null; } } catch (NoSuchElementException nse) { - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, ":")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), ":")); throw new PrematureEOFException(); } @@ -344,9 +372,8 @@ { if (declaration.components.size() < 1) { - err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, - iter.last.location, value.getChar(), Messages - .get("a_property_value"))); + err.error(new CssGrammarException(GRAMMAR_EXPECTING_TOKEN, iter.last.location, + messages.getLocale(), value.getChar(), messages.get("a_property_value"))); return null; } else @@ -358,8 +385,8 @@ { if (!handlePropertyValue(declaration, value, iter, isStyleAttribute)) { - err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, - iter.last.location, iter.last.getChars())); + err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, iter.last.location, + messages.getLocale(), iter.last.getChars())); return null; } else @@ -374,8 +401,8 @@ } catch (NoSuchElementException nse) { - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' " - + Messages.get("or") + " '}'")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), "';' " + messages.get("or") + " '}'")); throw new PrematureEOFException(); } @@ -447,8 +474,8 @@ CssSelector selector = new CssSelector(start.location); while (true) { //combinator loop - CssSimpleSelectorSequence seq = CssSelectorConstructFactory - .createSimpleSelectorSequence(start, iter, err); + CssSimpleSelectorSequence seq = cssSelectorFactory.createSimpleSelectorSequence(start, iter, + err); if (seq == null) { //errors already issued @@ -467,8 +494,7 @@ break; } - CssSelectorCombinator comb = - CssSelectorConstructFactory.createCombinator(start, iter, err); + CssSelectorCombinator comb = cssSelectorFactory.createCombinator(start, iter, err); if (comb != null) { selector.components.add(comb); @@ -480,8 +506,8 @@ } else { - err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, - iter.last.location, iter.last.chars)); + err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, iter.last.location, + messages.getLocale(), iter.last.chars)); return null; } } //combinator loop @@ -535,8 +561,8 @@ if (param == null) { // issue error, forward, then return - err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, - iter.last.location, iter.last.chars)); + err.error(new CssGrammarException(GRAMMAR_UNEXPECTED_TOKEN, iter.last.location, + messages.getLocale(), iter.last.chars)); //skip to atrule closebrace, ignoring any inner blocks int stack = 0; while (true) @@ -572,8 +598,8 @@ { // UAs required to close any open constructs on premature EOF doc.startAtRule(atRule); - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "';' " - + Messages.get("or") + " '{'")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), "';' " + messages.get("or") + " '{'")); doc.endAtRule(atRule.getName().get()); throw new PrematureEOFException(); } @@ -611,7 +637,8 @@ } catch (NoSuchElementException nse) { - err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, "'}'")); + err.error(new CssGrammarException(GRAMMAR_PREMATURE_EOF, iter.last.location, + messages.getLocale(), "'}'")); doc.endAtRule(atRule.name.get()); throw new PrematureEOFException(); } diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssReader.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssReader.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssReader.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssReader.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,17 +21,19 @@ */ package org.idpf.epubcheck.util.css; -import com.google.common.base.CharMatcher; -import com.google.common.base.Objects; -import com.google.common.collect.Lists; -import com.google.common.primitives.Ints; +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Preconditions.checkState; import java.io.BufferedReader; import java.io.IOException; import java.io.Reader; import java.util.List; -import static com.google.common.base.Preconditions.*; +import com.google.common.base.CharMatcher; +import com.google.common.base.MoreObjects; +import com.google.common.collect.Lists; +import com.google.common.primitives.Ints; /** * A wrapper around java.io.Reader with a pushback buffer, offset and @@ -380,7 +382,7 @@ @Override public String toString() { - return Objects.toStringHelper(this) + return MoreObjects.toStringHelper(this) .add("curChar", (char) curChar) .add("prevChar", (char) prevChar) .toString(); diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssScanner.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssScanner.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssScanner.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssScanner.java 2018-11-26 10:49:29.000000000 +0000 @@ -38,6 +38,7 @@ import java.io.IOException; import java.io.Reader; import java.util.List; +import java.util.Locale; import java.util.Map; import static com.google.common.base.Preconditions.*; @@ -65,20 +66,22 @@ private final CssErrorHandler errHandler; private final boolean debug = false; private char cur; + private Locale locale; private CssScanner(final Reader in, final String systemID, final CssErrorHandler errHandler, - final CssTokenConsumer consumer, final int pushbackBufferSize) + final CssTokenConsumer consumer, final int pushbackBufferSize, final Locale locale) { this.consumer = checkNotNull(consumer); this.errHandler = checkNotNull(errHandler); this.reader = new CssReader(in, systemID, pushbackBufferSize); this.escapes = new CssEscapeMemoizer(reader); + this.locale = locale; } CssScanner(Reader in, final String systemID, final CssErrorHandler errHandler, - final CssTokenConsumer consumer) + final CssTokenConsumer consumer, final Locale locale) { - this(in, systemID, errHandler, consumer, CssReader.DEFAULT_PUSHBACK_BUFFER_SIZE); + this(in, systemID, errHandler, consumer, CssReader.DEFAULT_PUSHBACK_BUFFER_SIZE, locale); } void scan() throws @@ -94,7 +97,7 @@ { break; } - builder = new TokenBuilder(reader, /* this, */errHandler); + builder = new TokenBuilder(reader, /* this, */errHandler, locale); cur = (char) ch; next = reader.peek(); escapes.reset(builder); @@ -741,7 +744,7 @@ * that if a specific quantity literal is found. */ builder.type = Type.QNTY_DIMEN; - TokenBuilder suffix = new TokenBuilder(reader, errHandler); + TokenBuilder suffix = new TokenBuilder(reader, errHandler, locale); append(QNTSTART, suffix); if (suffix.getLast() != '%') { // QNTSTART = NMSTART | '%' diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssSource.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssSource.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssSource.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssSource.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,12 +21,17 @@ */ package org.idpf.epubcheck.util.css; -import java.io.UnsupportedEncodingException; -import com.google.common.base.Objects; +import static com.google.common.base.Preconditions.checkNotNull; -import java.io.*; +import java.io.BufferedReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.MoreObjects; /** * Represents a CSS source. @@ -86,7 +91,7 @@ @Override public String toString() { - return Objects.toStringHelper(this).addValue(systemID).toString(); + return MoreObjects.toStringHelper(this).addValue(systemID).toString(); } @Override diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssToken.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssToken.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/CssToken.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/CssToken.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,16 +21,22 @@ */ package org.idpf.epubcheck.util.css; -import com.google.common.base.*; -import com.google.common.collect.Lists; -import org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode; -import org.idpf.epubcheck.util.css.CssExceptions.CssException; -import org.idpf.epubcheck.util.css.CssExceptions.CssScannerException; +import static com.google.common.base.Preconditions.checkState; import java.util.Iterator; import java.util.List; +import java.util.Locale; -import static com.google.common.base.Preconditions.checkState; +import org.idpf.epubcheck.util.css.CssExceptions.CssErrorCode; +import org.idpf.epubcheck.util.css.CssExceptions.CssException; +import org.idpf.epubcheck.util.css.CssExceptions.CssScannerException; + +import com.google.common.base.Joiner; +import com.google.common.base.MoreObjects; +import com.google.common.base.Optional; +import com.google.common.base.Predicate; +import com.google.common.base.Strings; +import com.google.common.collect.Lists; /** * Represents a CSS token. @@ -48,7 +54,8 @@ /** * Constructor for tokens with type other than CHAR */ - CssToken(final Type type, final CssLocation location, final String chars, final List errors) + CssToken(final Type type, final CssLocation location, final String chars, + final List errors) { this.type = type; this.location = location; @@ -62,7 +69,8 @@ /** * Constructor for CHAR tokens */ - CssToken(final Type type, final CssLocation location, final char chr, final List errors) + CssToken(final Type type, final CssLocation location, final char chr, + final List errors) { this.type = type; this.location = location; @@ -111,11 +119,8 @@ @Override public String toString() { - return Objects.toStringHelper(this) - .add("type", type.name()) - .add("value", chars) - .add("errors", errors.isPresent() ? Joiner.on(", ").join(errors.get()) : "none") - .toString(); + return MoreObjects.toStringHelper(this).add("type", type.name()).add("value", chars) + .add("errors", errors.isPresent() ? Joiner.on(", ").join(errors.get()) : "none").toString(); } @Override @@ -124,8 +129,7 @@ if (obj instanceof CssToken) { CssToken tk = (CssToken) obj; - if (tk.type.equals(this.type) - && tk.chars.equals(this.chars) + if (tk.type.equals(this.type) && tk.chars.equals(this.chars) && tk.location.equals(this.location)) { return true; @@ -230,8 +234,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == ':'); + return input.type == CssToken.Type.CHAR && (input.getChar() == ':'); } }; @@ -242,8 +245,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '|'); + return input.type == CssToken.Type.CHAR && (input.getChar() == '|'); } }; @@ -254,8 +256,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '}'); + return input.type == CssToken.Type.CHAR && (input.getChar() == '}'); } }; @@ -266,23 +267,20 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '{'); + return input.type == CssToken.Type.CHAR && (input.getChar() == '{'); } }; /** - * Matches a CssToken.Type.CHAR with value '>', '+' or '~'. Note that S is the fourth - * CSS combinator which is not matched here. + * Matches a CssToken.Type.CHAR with value '>', '+' or '~'. Note that S is the + * fourth CSS combinator which is not matched here. */ static final Predicate MATCH_COMBINATOR_CHAR = new Predicate() { public final boolean apply(final CssToken input) { return input.type == CssToken.Type.CHAR - && (input.getChar() == '>' - || input.getChar() == '+' - || input.getChar() == '~'); + && (input.getChar() == '>' || input.getChar() == '+' || input.getChar() == '~'); } }; @@ -293,8 +291,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == ';'); + return input.type == CssToken.Type.CHAR && (input.getChar() == ';'); } }; @@ -305,8 +302,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == ','); + return input.type == CssToken.Type.CHAR && (input.getChar() == ','); } }; @@ -317,8 +313,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == ')'); + return input.type == CssToken.Type.CHAR && (input.getChar() == ')'); } }; @@ -329,8 +324,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '('); + return input.type == CssToken.Type.CHAR && (input.getChar() == '('); } }; @@ -353,8 +347,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '*'); + return input.type == CssToken.Type.CHAR && (input.getChar() == '*'); } }; @@ -365,8 +358,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == '['); + return input.type == CssToken.Type.CHAR && (input.getChar() == '['); } }; @@ -377,8 +369,7 @@ { public final boolean apply(final CssToken input) { - return input.type == CssToken.Type.CHAR - && (input.getChar() == ']'); + return input.type == CssToken.Type.CHAR && (input.getChar() == ']'); } }; @@ -398,12 +389,9 @@ { public final boolean apply(final CssToken input) { - return (input.type == CssToken.Type.CHAR - && input.getChar() == '=') - || input.type == CssToken.Type.INCLUDES - || input.type == CssToken.Type.DASHMATCH - || input.type == CssToken.Type.PREFIXMATCH - || input.type == CssToken.Type.SUFFIXMATCH + return (input.type == CssToken.Type.CHAR && input.getChar() == '=') + || input.type == CssToken.Type.INCLUDES || input.type == CssToken.Type.DASHMATCH + || input.type == CssToken.Type.PREFIXMATCH || input.type == CssToken.Type.SUFFIXMATCH || input.type == CssToken.Type.SUBSTRINGMATCH; } @@ -421,8 +409,10 @@ final List errors; private final boolean debug = false; private final CssErrorHandler errorListener; + private final Locale locale; - TokenBuilder(final String systemID, final int line, final int col, final int offset, final CssErrorHandler errorListener) + private TokenBuilder(final String systemID, final int line, final int col, final int offset, + final CssErrorHandler errorListener, final Locale locale) { this.systemID = systemID; this.line = line; @@ -431,11 +421,12 @@ this.chars = new StringBuilder(); this.errors = Lists.newArrayList(); this.errorListener = errorListener; + this.locale = locale; } - TokenBuilder(final CssReader reader, final CssErrorHandler errorListener) + TokenBuilder(final CssReader reader, final CssErrorHandler errorListener, final Locale locale) { - this(reader.systemID, reader.line, reader.col, reader.offset, errorListener); + this(reader.systemID, reader.line, reader.col, reader.offset, errorListener, locale); } TokenBuilder append(int ch) @@ -470,14 +461,15 @@ } /** - * All lexer-time errors are funnelled through this method. Reported errors are stored in - * the resulting CssToken. This method also passes the error on to a CssErrorHandler, - * which can opt to rethrow to terminate the scanning. + * All lexer-time errors are funnelled through this method. Reported errors are + * stored in the resulting CssToken. This method also passes the error on to a + * CssErrorHandler, which can opt to rethrow to terminate the scanning. */ - void error(CssErrorCode errorCode, CssReader reader, Object... arguments) throws - CssException + void error(CssErrorCode errorCode, CssReader reader, Object... arguments) + throws CssException { - CssScannerException cse = new CssScannerException(errorCode, CssLocation.create(reader), arguments); + CssScannerException cse = new CssScannerException(errorCode, CssLocation.create(reader), + locale, arguments); errors.add(cse); errorListener.error(cse); } diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/Messages.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/Messages.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/css/Messages.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/css/Messages.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2012 International Digital Publishing Forum - * - * 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 org.idpf.epubcheck.util.css; - -import com.google.common.base.Charsets; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URL; -import java.net.URLConnection; -import java.text.MessageFormat; -import java.util.Locale; -import java.util.MissingResourceException; -import java.util.PropertyResourceBundle; -import java.util.ResourceBundle; -import java.util.ResourceBundle.Control; - -final class Messages -{ - private static final String BUNDLE_NAME = "org.idpf.epubcheck.util.css.messages"; //$NON-NLS-1$ - private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME, Locale.getDefault(), new UTF8Control()); - - static String get(String key) - { - try - { - return RESOURCE_BUNDLE.getString(key); - } - catch (MissingResourceException e) - { - return key; - } - } - - static String get(String key, Object... arguments) - { - try - { - return MessageFormat.format(RESOURCE_BUNDLE.getString(key), arguments); - } - catch (MissingResourceException e) - { - return key; - } - } - - private static class UTF8Control extends Control - { - 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); - String resourceName = toResourceName(bundleName, "properties"); //$NON-NLS-1$ - ResourceBundle bundle = null; - InputStream stream = null; - if (reload) - { - URL url = loader.getResource(resourceName); - if (url != null) - { - URLConnection connection = url.openConnection(); - if (connection != null) - { - connection.setUseCaches(false); - stream = connection.getInputStream(); - } - } - } - else - { - stream = loader.getResourceAsStream(resourceName); - } - if (stream != null) - { - try - { - // 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 - { - stream.close(); - } - } - return bundle; - } - } - - private Messages() - { - } -} diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/saxon/Int64ValueSequence.java 2018-11-26 10:49:29.000000000 +0000 @@ -21,7 +21,7 @@ } @Override - public SequenceIterator iterate() throws + public SequenceIterator iterate() throws XPathException { return item.iterate(); diff -Nru epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java --- epubcheck-4.0.2/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/java/org/idpf/epubcheck/util/saxon/SystemIdFunction.java 2018-11-26 10:49:29.000000000 +0000 @@ -94,7 +94,7 @@ } @Override - public SequenceIterator iterate() throws + public SequenceIterator iterate() throws XPathException { return item.iterate(); diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_de.properties 2018-11-26 10:49:29.000000000 +0000 @@ -9,17 +9,17 @@ 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_009=MathML sollte entweder ein 'alttext'-Attribut besitzen oder ein 'annotation-xml'-Kindelement. ACC_010=Überschriften sollten nicht innerhalb von 'blockquote' oder 'figure'-Elementen benutzt werden. ACC_011=SVG-Hyperlinks sollten einen für Menschen lesbaren Titel besitzen ('title' Kindelement oder 'xlink:title'-Attribut). 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=Wert der CSS-Eigenschaft 'font-size' ist keine relative Größenangabe: '%1$s' 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=CSS-Eigenschaft 'font-size' sollte in einer relativen Größe angegeben werden: '%1$s' 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'. @@ -32,6 +32,7 @@ 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 +CHK_008=Fehler beim Verarbeiten von '%1$s', weitere Checks werden übersprungen. #CSS CSS_001=Die CSS-Eigenschaft '%1$s' darf im EPUB nicht verwendet werden! @@ -120,6 +121,7 @@ HTM_050=Das Attribut epub:type="pagebreak" wurde im Dokument gefunden. HTM_051=Semantische 'Microdata'-Erweiterungen wurden gefunden, aber kein RDFa. EDUPUB empfiehlt die Nutzung von RDFa Lite. HTM_052=Die Eigenschaft 'region-based' ist nur an 'nav'-Elementen in EPUB 3-Navigationsdokumenten erlaubt. +HTM_053=In der Datei '%1$s' wurde ein Datei-Link ('file://') gefunden. #media MED_001=Das Video-Standbild muss in einem vom OPF-Standard unterstützten Dateiformate für Bilder vorliegen! @@ -213,12 +215,12 @@ OPF_055='%1$s'-Element ist leer. OPF_056=MimeType '%1$s' ist kein gültiger Audio-MimeType. 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 in der NCX-Datei referenziert. +OPF_058='spine'-Eintrag '%1$s' wird nicht aus der Navigationsdatei referenziert. +OPF_058_SUG=Jeder 'spine'-Eintrag im OPF-Manifest sollte von mindestens einem TOC-Eintrag in der Navigationsdatei referenziert werden. +OPF_059= 'spine'-Eintrag '%1$s' wird nicht in der NCX-Datei referenziert. OPF_059_SUG=Jeder 'spine'-Eintrag im OPF-Manifest sollte von mindestens einem Eintrag in der NCX-Datei 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_060=Doppelte Datei im EPUB-Archiv: '%1$s' +OPF_061=Doppelte Datei im EPUB-Archiv (nach Unicode-NFC-Normalisierung): '%1$s' 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. OPF_064=Im OPF wird der Typ '%1$s' deklariert, deshalb wird mit dem Profil '%2$s' validiert. @@ -267,6 +269,8 @@ 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'. PKG_023=Validierung gegen den EPUB-Standard 2.0 mit dem Standard-Validierungsprofil. +PKG_024=Unbekannte EPUB-Dateiendung. +PKG_024_SUG=Für bestmögliche Kompatibilität sollte '.epub' verwendet werden. #Resources RSC_001=Datei '%1$s' wurde nicht gefunden. @@ -276,9 +280,9 @@ 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 referenzierte Datei wurde im EPUB nicht gefunden. -RSC_007w=Die Datei wurde im EPUB nicht gefunden. -RSC_008=Die referenzierte Datei ist im OPF-Manifest nicht deklariert. +RSC_007=Die referenzierte Datei '%1$s' wurde im EPUB nicht gefunden. +RSC_007w=Die referenzierte Datei '%1$s' wurde im EPUB nicht gefunden. +RSC_008=Die referenzierte Datei '%1$s' 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. @@ -286,13 +290,14 @@ RSC_013=Fragmentbezeichner wird in einem Link zu einem Stylesheet-Dokument genutzt. RSC_014=Fragmentbezeichner an einer inkompatiblen Ressource. RSC_015=Das SVG-Element 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_016=Schwerer Fehler beim Parsen der Datei: %1$s +RSC_017=Warnung beim Parsen der Datei: %1$s RSC_018=Alternativabbildung '%1$s' wurde nicht gefunden. RSC_019=EPUBs mit mehreren Darstellungen ('renditions') sollten eine Datei 'META-INF/metadata.xml' enthalten. RSC_020='%1$s' ist keine gültige URI. RSC_021=Das Stichwortverzeichnis muss auf Inhaltsdokumente verweisen ('%1$s' wurde nicht im 'Spine' gefunden). RSC_022=Bilddetails können nicht geprüft werden (Java 7 oder neuer wird benötigt). +RSC_023=In der URL '%1$s' fehlen %2$d Schrägstrich(e) '/' nach dem Protokoll '%3$s:' #Scripting SCP_001=Die Nutzung der JavaScript-Funktion 'eval()' in EPUBs ist ein Sicherheitsrisiko! @@ -308,4 +313,3 @@ 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 -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_en.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_en.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_es.properties 2018-11-26 10:49:29.000000000 +0000 @@ -9,17 +9,17 @@ 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_009=MathML debe tener un atributo 'alttext' o un elemento 'annotation-xml' hijo. ACC_010=Los encbezados no deben utilizarse dentro de etiquetas 'blockquote' o 'figure'. ACC_011=Los enlaces SVG deberían tener un título legible (mediante el uso del elemento-hijo 'title' o el 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=El valor de la propiedad CSS 'font-size' no usa medidas relativas: '%1$s' 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=El valor de la propiedad CSS 'font-size' debe usar medidas relativas: '%1$s' 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'. @@ -32,6 +32,7 @@ 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". +CHK_008=Error encountered while processing an item '%1$s'; skip other checkes for the item. #CSS CSS_001=La propiedad \'%1$s\' no debe incluirse en la hoja de estilos del EPUB. @@ -120,6 +121,7 @@ HTM_050=Se ha encontrado un atributo epub:type="pagebreak" en el documento. HTM_051=Se han encontrado enriquecimientos semánticos Microdata pero no RDFa. EDUPUB recomienda utilizar RDFa Lite. HTM_052=La propiedad 'region-based' solo está permitida para elementos nav en Documentos de Datos de Navegación. +HTM_053=Found an external file link (file://) in file: '%1$s'. #media MED_001=El poster de vídeo debe ser un tipo de imagen soportado. @@ -213,12 +215,12 @@ OPF_055=La etiqueta %1$s está vacía. OPF_056=El tipo de archivo multimedia '%1$s' no es un tipo de audio recomendado. OPF_057=El tamaño del archivo de imagen excede el tamaño recomendado. -OPF_058=Un elmento de no tiene referencia en una entrada del TOC. -OPF_058_SUG=Cada elemento de debe estar referenciado por al menos una entrada del TOC. -OPF_059=El elemento en no tiene una referencia NCX. +OPF_058=El elemento '%1$s' en no tiene una referencia del NAV. +OPF_058_SUG=Cada uno de los elementos en deben estar referenciados por, al menos, una entrada NAV. +OPF_059=El elemento '%1$s' en no tiene una referencia NCX. OPF_059_SUG=Cada uno de los elementos en deben estar referenciados por, al menos, una entrada NCX. -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_060=Entrada duplicada en el archivo ZIP: '%1$s'. +OPF_061=Entrada duplicada en el archivo ZIP (tras la normalización Unicode NFC) '%1$s'. OPF_062=Se ha encontrado un atributo page-map de Adobe en un elemento de en el archivo OPF. OPF_063=El elemento page-map de Adobe '%1$s' referenciado no se ha encontrado en . OPF_064=OPF declara el tipo '%1$s'; se valida con el perfil '%2$s'. @@ -267,18 +269,20 @@ 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'. PKG_023=Validando el EPUB con la versión 2.0; se usará el perfil de validación por defecto. +PKG_024=Uncommon EPUB file extension. +PKG_024_SUG=For maximum compatibility, use '.epub'. #Resources RSC_001=No se encuentra el archivo '%1$s'. RSC_002=No se encuentra el archivo 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_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 ha encontrado en el EPUB. -RSC_007w=El recurso referenciado no se ha encontrado en el EPUB. -RSC_008=El recurso referenciado no está declarado en el del archivo OPF. +RSC_007=El recurso referenciado '%1$s' no se ha encontrado en el EPUB. +RSC_007w=El recurso referenciado '%1$s' no se ha encontrado en el EPUB. +RSC_008=El recurso referenciado '%1$s' no está declarado en el 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 . @@ -286,13 +290,14 @@ 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_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'. RSC_019=EPUBs con Multiple Renditions deben contener un archivo META-INF/metadata.xml. RSC_020='%1$s' no es una URI válida. RSC_021=El documento de mapeado de búsqueda debe apuntar a archivos de contenido (no se encontró '%1$s' en la sección ). RSC_022=No se pueden comprobar detalles de imagen (requiere la versión 7 de Java o superior). +RSC_023=The URL '%1$s' is missing %2$d slash(es) '/' after the protocol '%3$s:' #Scripting SCP_001=La utilización de la función Javascript eval() en los scripts de un archivo EPUB constituye un riesgo de seguridad. @@ -308,4 +313,3 @@ 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 -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_fr.properties 2018-11-26 10:49:29.000000000 +0000 @@ -15,11 +15,11 @@ 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=La valeur de la propriété CSS 'font-size' n'utilise pas une taille relative: '%1$s' 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=La valeur de la propriété CSS 'font-size' devrait utiliser une taille relative: '%1$s' 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'. @@ -32,6 +32,7 @@ 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". +CHK_008=Error encountered while processing an item '%1$s'; skip other checkes for the item. #CSS CSS_001=La propriété \'%1$s\' ne doit pas être incluse dans une feuille de style ePub. @@ -120,6 +121,7 @@ HTM_050=Un attribut epub:type="pagebreak" est présent dans le document de contenu. HTM_051=Enrichissements sémantiques trouvés en Microdata mais pas en RDFa. EDUPUB recommande l'utilisation de RDFa Lite. HTM_052=La propriété 'region-based' n'est autorisée que dans les éléments nav dans les Documents de Navigation de Données (Data Navigation Documents) +HTM_053=Found an external file link (file://) in file: '%1$s'. #media MED_001=Le 'poster' de 'video' doit être un type d'image Core Media Type. @@ -213,12 +215,12 @@ OPF_055=L'élément %1$s est vide. OPF_056=Le media type '%1$s' n'est pas un type audio principal. 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'item du spine n'a pas de référence d'entrée NCX. +OPF_058=L'item du spine '%1$s' n'a pas de référence d'entrée de NAV. +OPF_058_SUG=Chaque élément du spine dans le manifest devrait être référencé par au moins une entrée de NAV. +OPF_059=L'item du spine '%1$s' n'a pas de référence d'entrée NCX. OPF_059_SUG=Chaque élément du spine dans le manifest devrait être référencé par au moins une entrée NCX. -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_060=Double entrée dans le fichier ZIP : '%1$s'. +OPF_061=Double entrée dans le fichier ZIP (après normalisation Unicode NFC) : '%1$s'. 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. OPF_064=Le type '%1$s' est déclaré dans l'OPF ; utilisation du profil de validation '%2$s'. @@ -267,18 +269,20 @@ 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'. PKG_023=Validation de l'EPUB selon la version 2.0, le profil de validation par défaut sera utilisé. +PKG_024=Uncommon EPUB file extension. +PKG_024_SUG=For maximum compatibility, use '.epub'. #Resources 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_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_007w=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_007=La ressource référencée '%1$s' n'est pas présente dans l'EPUB. +RSC_007w=La ressource référencée '%1$s' n'est pas présente dans l'EPUB. +RSC_008=La ressource référencée '%1$s' 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. @@ -286,13 +290,14 @@ 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_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 image alternatif '%1$s' est introuvable. RSC_019=Les EPUB avec de Multiple Représentations (Multiple Renditions) devrait contenir un fichier META-INF/metadata.xml. RSC_020='%1$s' n'est pas une URI valide RSC_021=Un index de clés de recherche (Search Key Map) doit référencer des documents de contenus uniquement ('%1$s' n'a pas été trouvé dans le bloc "spine"). RSC_022=Impossible de contrôler les détails de l'image (nécessite Java version 7 ou plus). +RSC_023=L'URL '%1$s' ne comporte que%2$dslash(es) après le protocole %3$s : #Scripting SCP_001=L'utilisation de la fonction JavaScript eval() dans les scripts EPUB présente un risque de sécurité. @@ -308,4 +313,3 @@ 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 -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_ja.properties 2018-11-26 10:49:29.000000000 +0000 @@ -9,17 +9,17 @@ ACC_006=tableはアクセシビリティのため 'thead' 要素を持つべきです. ACC_007=コンテンツ文書がepub:type属性を意味変化のために使っていません. ACC_008=ナビゲーション文書が、landmarks nav要素を持っていません. -ACC_009=MathMLはalt属性のテキストか、annotation-xml子要素を持つべきです. +ACC_009=MathMLはalttext属性のテキストか、annotation-xml子要素を持つべきです. ACC_010=blockquote要素かfigure要素内では見出しを使うべきではありません. -ACC_011=SVG内のlink要素はxlink:title属性を持つべきです. +ACC_011=SVGのハイパーリンクには人間が読める('title'子要素か'xlink:title'属性を使った)titleを持つべきです. ACC_012=table要素はcaption要素を含むべきです. ACC_013=コンテンツファイルは少なくとも1つのインラインスタイル宣言を含むべきです. ACC_013_SUG=インラインスタイルはアクセシビリティ設定と表示のパーソナライゼーションに適合しません. 代わりにCSSスタイルを使って下さい. -ACC_014=CSSセレクタのfont-size属性値に相対サイズを使っていません. +ACC_014=CSSセレクタのfont-size属性値に相対サイズを使っていません: '%1$s' ACC_014_SUG=取りうる値はパーセンテージか、em単位か、'larger'、'smaller'、'normal'、または 'inherit' です. ACC_015=CSSセレクタのフォントのline-height属性値に相対サイズを使っていません. ACC_015_SUG=取りうる値はパーセンテージか、数値単位か、em単位か、'normal'、または 'inherit' です. -ACC_016=CSSセレクタのfont-size属性値には相対サイズを使うべきです. +ACC_016=CSSセレクタのfont-size属性値には相対サイズを使うべきです: '%1$s' ACC_016_SUG=取りうる値はパーセンテージか、em単位か、'larger'、'smaller'、'normal'、または 'inherit' です. ACC_017=CSSセレクタのフォントのline-height属性値に相対サイズを使っていません. ACC_017_SUG=取りうる値はパーセンテージか、数値単位か、em単位か、'normal'、または 'inherit' です. @@ -32,6 +32,7 @@ CHK_005=ファイル '%1$s' を上書きするメッセージ内のカスタムサジェッションに含まれるパラメタが多すぎます. CHK_006=ファイル '%1$s' を上書きするメッセージ内のカスタムフォーマットパラメタが解析できません. CHK_007=カスタムメッセージファイル '%1$s' の処理中にエラーが発生しました: "%2$s". +CHK_008=要素'%1$s'の処理中にエラーが見つかりました; この要素に対する他のチェックをスキップします. #CSS CSS_001=プロパティ \'%1$s\' は EPUBのスタイルシートに含めることはできません. @@ -120,6 +121,7 @@ HTM_050=epub:type="pagebreak" 属性をコンテンツ文書中に発見しました. HTM_051=RDFaではないMicrodata semantic enrichmentsが見つかりました. EDUPUBではRDFa Liteの使用が推奨されています. HTM_052='region-based'プロパティはデータナビゲーション文書中のnav要素でのみ許可されています. +HTM_053=外部ファイルへのリンク(file://)がファイル: '%1$s'内に見つかりました. #media MED_001=video posterにはcore media image typeが必要です. @@ -213,18 +215,18 @@ OPF_055=%1$sタグが空です. OPF_056=メディアタイプ '%1$s' は標準のオーディオ用メディアタイプではありません. OPF_057=画像の辺の長さが推奨のサイズを超えています. -OPF_058=spineアイテムにTOCエントリからの参照がありません. -OPF_058_SUG=マニフェストのspineアイテムは少なくとも一つのTOCエントリーによって参照されなければなりません. -OPF_059=spineアイテムにNCXエントリーからの参照がありません. -OPF_059_SUG=マニフェストのどのspineアイテムも、少なくとも一つのNCXエントリから参照されなければなりません. -OPF_060=ZIPファイル中の以下のエントリが重複しています: '%1$f' -OPF_061=ZIPファイル中の以下のエントリが重複しています(UnicodeのNFC正規化後): '%1$f'. +OPF_058=spine要素 '%1$s' はナビゲーション文書内のTOCから参照されていません. +OPF_058_SUG=マニフェスト内のすべてのspine要素はナビゲーション文書内にある最低1つのTOCエントリから参照されるべきです. +OPF_059=spine要素 '%1$s' はNCX内のTOCから参照されていません. +OPF_059_SUG=マニフェスト内のすべてのspine要素はNCXファイル内にある最低1つのTOCエントリから参照されるべきです. +OPF_060=ZIPファイル中の以下のエントリが重複しています: '%1$s' +OPF_061=ZIPファイル中の以下のエントリが重複しています(UnicodeのNFC正規化後): '%1$s'. OPF_062=Adobeのpage-map属性がopfファイルのspine要素にあります. OPF_063=Adobeのpage-map項目'%1$s'はmanifestに存在しません. OPF_064=OPFでタイプ '%1$s'が宣言されているため、'%2$s' プロファイルを使って検証します. OPF_065=不正なメタデータ宣言があります. これは'refines'メタデータの循環参照によるものと思われます. OPF_066='dc:source' または 'source-of' のページネーションメタデータがありません. コンテンツが改ページマーカを含む場合、ページネーションソースは'dc:source' か 'source-of' 属性を使って一意に指定されなければいけません. -OPF_067=リソース '%1$s' はパッケージのmetadata内の'link'要素としても, minifestのアイテムとしてもリストされていません. +OPF_067=リソース '%1$s' はパッケージのmetadata内の'link'要素としても, manifestのアイテムとしてもリストされていません. OPF_068=collection要素のrole属性が不明な値 '%1$s' です. OPF_069=collection要素のrole属性として指定されているカスタムのURI '%1$s'には, ホストコンポーネントとして'idpf.org' という文字列を含んではいけません. OPF_070=collection要素のrole属性として指定されているカスタムのURI '%1$s'は, 不正なURIです. @@ -267,18 +269,20 @@ PKG_021=壊れた画像ファイルがありました. PKG_022=イメージへの拡張子が間違っています.イメージは'%1$s'ファイルですが、拡張子'%2$s'を持っています。 PKG_023=EPUBバージョン2.0として検証するため, デフォルトの検証用プロファイルが使われます. +PKG_024=一般的ではないEPUBファイル拡張子です. +PKG_024_SUG=互換性を高めるため、'.epub'を使って下さい. #Resources RSC_001=ファイル '%1$s' が見つかりません. RSC_002=必須の META-INF/container.xml リソースが見つかりません. RSC_003=コンテナ内にメディアタイプ 'application/oebps-package+xml' を持つルートファイルタグが見つかりませんでした. RSC_004=ファイル '%1$s' が復号できませんでした. -RSC_005=ファイル解析時のエラー '%1$s'. +RSC_005=ファイル解析時のエラー: %1$s RSC_006=外部リソースへの参照は許されていません; リソースはOCF内になければいけません. RSC_006_SUG=音声と画像の外部リソースのみ許可されています. -RSC_007=参照されているリソースがEPUB内に見つかりません. -RSC_007w=参照されたリソースがEPUB内に見つかりませんでした. -RSC_008=参照されているリソースがOPF manifest内で宣言されていません. +RSC_007=参照されているリソース '%1$s' がEPUB内に見つかりません. +RSC_007w=参照されているリソース '%1$s' がEPUB内に見つかりません. +RSC_008=参照されているリソース '%1$s' がOPF manifest内で宣言されていません. RSC_009=フラグメント識別子はimg要素のsrc属性で使うべきではありません. RSC_010=標準ではないリソースタイプへの参照が見つかりました. RSC_011=spine項目ではないリソースへの参照が見つかりました. @@ -286,13 +290,14 @@ RSC_013=スタイルシートへの参照の中でフラグメント識別子が使われています. RSC_014=不適合なリソースタイプ内でフラグメント識別子が定義されています. RSC_015=タグリファレンスを使ったSVGにはフラグメント識別子が必要です. -RSC_016=ファイル解析時の致命的なエラー '%1$s'. -RSC_017=ファイル解析時の警告 '%1$s'. +RSC_016=ファイル解析時の致命的なエラー: %1$s +RSC_017=ファイル解析時の警告: %1$s RSC_018=代替画像ファイル '%1$s' が見つかりません. RSC_019=Renditionを複数持つEPUBはMETA-INF/metadata.xmlを含むべきです. RSC_020='%1$s' は正しいURIではありません. RSC_021=Search Key Map文書はコンテンツ文書を指示していなければいけません('%1$s' はspine内では見つかりませんでした). RSC_022=画像の詳細情報が確認できません(Java version 7以降が必要です). +RSC_023=URL '%1$s' のプロトコル '%3$s:' の後には %2$d 個のスラッシュ(群) '/' が必要です #Scripting SCP_001=EPUBスクリプト内でのJavascript eval()関数の使用にはセキュリティ上のリスクがあります. @@ -308,4 +313,3 @@ SCP_009=コンテンツファイルがmouse event handlerを使っています. SCP_009_SUG=全てのマウスを使った機能がキーボードやタッチデバイスからも利用可能か確認してください. SCP_010=EPUB 3 コンテンツファイルがスクリプトを含んでいます. - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_nl.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_nl.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_nl.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle_nl.properties 2018-11-26 10:49:29.000000000 +0000 @@ -9,17 +9,17 @@ ACC_006=Tabellen zouden een 'thead' elementen moeten bevatten. Dit komt de toegankelijkheid ten goede. ACC_007=Contentdocumenten gebruiken geen 'epub:type' attributen. Dit komt de toegankelijkheid ten goede. ACC_008=Het navigatiedocument bevat geen 'landmarks nav' element. -ACC_009=MathML zou een 'alt' tekstattribuut of een 'annotation-xml' kind-element moeten bevatten. +ACC_009=MathML zou een 'alttext' attribuut of een 'annotation-xml' kind-element moeten bevatten. ACC_010=Binnen 'blockquote' en 'figure' elementen zouden headings niet gebruikt moeten worden. ACC_011=Hyperlinks binnen SVG zouden een voor mensen leesbare titel moeten bevatten (gebruik daarvoor het 'title' child element of het 'xlink:title' attribuut). ACC_012='table' elementen zouden een 'caption' element moeten bevatten. ACC_013=Contentbestand bevat tenminste 1 inline style verklaring. ACC_013_SUG=Inline stijlen zijn niet verenigbaar met de instellingen voor toegankelijkheid en het leesgenot van de gebruiker. Gebruikt u liever CSS stijlen. -ACC_014=De waarde van 'font-size' in uw CSS gebruikt geen relatieve grootte. +ACC_014=De waarde van 'font-size' in uw CSS gebruikt geen relatieve grootte: '%1$s' ACC_014_SUG=Acceptabele waarden omvatten percentages, meervouden van em, 'larger', 'smaller, 'normal' of 'inherit'. ACC_015=De waarde van 'line-height' in uw CSS gebruikt geen relatieve grootte. ACC_015_SUG=Acceptabele waarden omvatten percentages, nummers, meervouden van em, 'normal' of 'inherit'. -ACC_016=De waarde van 'font-size' in uw CSS zou een relatieve grootte moeten gebruiken. +ACC_016=De waarde van 'font-size' in uw CSS zou een relatieve grootte moeten gebruiken: '%1$s' ACC_016_SUG=Acceptabele waarden omvatten percentages, meervouden van em, 'larger', 'smaller, 'normal' of 'inherit'. ACC_017=De waarde van 'line-height' in uw CSS gebruikt geen relatieve grootte. ACC_017_SUG=Acceptabele waarden omvatten percentages, nummers, meervouden van em, 'normal' of 'inherit'. @@ -32,6 +32,7 @@ CHK_005=De aangepaste suggestie bevat teveel parameters. Het gaat om het aangepaste berichtenbestand '%1$s'. CHK_006=Het is niet gelukt om de instelling van het aangepaste formaat te verwerken uit het aangepaste berichtenbestand '%1$s'. CHK_007=Foutmelding tegengekomen bij het verwerken van het aangepaste berichtenbestand '%1$s': "%2$s". +CHK_008=Error encountered while processing an item '%1$s'; skip other checkes for the item. #CSS CSS_001=Eigenschap \'%1$s\' mag niet in een EPUB Style Sheet opgenomen worden. @@ -120,6 +121,7 @@ HTM_050=Het attribuut epub:type="pagebreak" is aangetroffen in het contentbestand. HTM_051=Microdata semantische verrijkingen aangetroffen zonder RDFa. De EDUPUB standaard raadt aan om een RDFa Lite te gebruiken. HTM_052=Eigenschap 'region-based' alleen toegestaan bij nav elementen in Data Navigation Documents. +HTM_053=Found an external file link (file://) in file: '%1$s'. #media MED_001=De poster van de video dient een core media image type te zijn. Toegestane types zijn png, jpg, svg en gif. @@ -213,12 +215,12 @@ OPF_055=Lege %1$s code. OPF_056=Media type '%1$s' is geen core audio type. OPF_057=Beeldbestand is groter dan de aangeraden omvang. -OPF_058=SPINE item heeft geen verwijzing in de inhoudsopgave TOC. -OPF_058_SUG=Elk SPINE item in het manifest zou door tenminste 1 TOC item moeten zijn verwezen. -OPF_059=SPINE item heeft geen verwijzing in de NCX inhoudsopgave. +OPF_058=SPINE item '%1$s' heeft geen verwijzing in de NAV inhoudsopgave. +OPF_058_SUG=Elk SPINE item in het manifest zou door tenminste 1 NAV item moeten zijn verwezen. +OPF_059=SPINE item '%1$s' heeft geen verwijzing in de NCX inhoudsopgave. OPF_059_SUG=Elk SPINE item in het manifest zou door tenminste 1 NCX item moeten zijn verwezen. -OPF_060=Dubbel aanwezig in het ZIP bestand: '%1$f'. -OPF_061=Dubbel aanwezig in het ZIP bestand (na de Unicode NFC normalisatie): '%1$f'. +OPF_060=Dubbel aanwezig in het ZIP bestand: '%1$s'. +OPF_061=Dubbel aanwezig in het ZIP bestand (na de Unicode NFC normalisatie): '%1$s'. OPF_062=Adobe page-map attribuut aangetroffen in het SPINE element in het OPF bestand. OPF_063=Het Adobe page-map item waarnaar wordt verwezen '%1$s' is niet aangetroffen in het manifest. OPF_064=Het OPF bestand verklaart type '%1$s', maar er wordt gevalideerd volgens het profiel van type '%2$s'. @@ -267,18 +269,20 @@ PKG_021=Beschadigd beeldbestand aangetroffen. PKG_022=Verkeerde bestandsextensie voor het beeldbestand. Het beeld is een '%1$s' bestand maar heeft de extensie '%2$s'. PKG_023=De ePub wordt gevalideerd als versie 2.0; het standaard validatieprofiel wordt gebruikt. +PKG_024=Uncommon EPUB file extension. +PKG_024_SUG=For maximum compatibility, use '.epub'. #Resources RSC_001=Bestand '%1$s' niet aangetroffen. RSC_002=Vereist bestand META-INF/container.xml niet aangetroffen. RSC_003=Geen rootfile code met het mediatype 'application/oebps-package+xml' aangetroffen. RSC_004=Bestand '%1$s' kon niet worden ontcijferd. -RSC_005=Foutmelding bij het verwerken van bestand '%1$s'. +RSC_005=Foutmelding bij het verwerken van bestand: %1$s RSC_006=Remote resource verwijzing is niet toegestaan; het bronbestand moet in de OCF worden opgenomen. RSC_006_SUG=De enige remote resources die zijn toegestaan zijn audio en video bestanden. -RSC_007=Bronbestand waarnaar verwezen wordt is niet aangetroffen in de ePub. -RSC_007w=Bronbestand waarnaar verwezen wordt is niet aangetroffen in de ePub. -RSC_008=Bronbestand waarnaar verwezen wordt is niet aangetroffen in het OPF manifest. +RSC_007=Bronbestand waarnaar verwezen wordt is niet aangetroffen in de EPUB: '%1$s' +RSC_007w=Bronbestand waarnaar verwezen wordt is niet aangetroffen in de EPUB: '%1$s' +RSC_008=Bronbestand waarnaar verwezen wordt is niet aangetroffen in het OPF manifest: '%1$s' RSC_009=Een fragmentidentifier - CFI - kan niet worden gebruikt in combinatie met een img src attribuut. RSC_010=Verwijzing naar een niet-standaard brontype is aangetroffen. RSC_011=Verwijzing naar een bronbestand dat geen SPINE item is aangetroffen. @@ -286,13 +290,14 @@ RSC_013=Fragmentidentifier - CFI - gebruikt in een verwijzing naar een CSS bestand. RSC_014=Fragmentidentifier - CFI - definieert een niet-compatibel brontype. RSC_015=Bij het gebruiken van de SVG code USE is een fragmentidentifier - CFI - benodigd. -RSC_016=Fatale fout bij het verwerken van bestand '%1$s'. -RSC_017=Waarschuwing bij het verwerken van bestand '%1$s'. +RSC_016=Fatale fout bij het verwerken van bestand: %1$s +RSC_017=Waarschuwing bij het verwerken van bestand: %1$s RSC_018=Altimg bestand '%1$s' werd niet aangetroffen. RSC_019=Uw ePub maakt gebruik van Multiple Renditions. Dat is prettig voor de verschillende mogelijke schermen en schermresoluties waarop uw boek kan worden vertoond. Het is dan wel nodig om een META-INF/metadata.xml bestand op te nemen in uw ePub bestand. RSC_020='%1$s' is geen geldige URI. RSC_021=Een Search Key Map Document moet verwijzen naar contentbestanden ('%1$s' werd niet aangetroffen in de spine). RSC_022=Kan de details van het beeldbestand niet controleren (daarvoor heeft het programma Java versie 7 of hoger nodig). +RSC_023=The URL '%1$s' is missing %2$d slash(es) '/' after the protocol '%3$s:' #Scripting SCP_001=Het gebruik van de Javascript functie eval() behelst beveiligingsrisico's. @@ -308,4 +313,3 @@ SCP_009=Contentbestand gebruikt mouse event handlers. SCP_009_SUG=Vergewis u ervan dat alle functionaliteit waarvoor een muis wordt gebruikt OOK toegankelijk is vanaf het toetsenbord EN apparaten die met aanraking werken. SCP_010=ePub 3 contentbestand bevat een script. - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/messages/MessageBundle.properties 2018-11-26 10:49:29.000000000 +0000 @@ -15,11 +15,11 @@ 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=Value of CSS property 'font-size' does not use a relative size. +ACC_014=Value of CSS property 'font-size' does not use a relative size: '%1$s' ACC_014_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'. 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=Value of CSS property 'font-size' should use a relative size. +ACC_016=Value of CSS property 'font-size' should use a relative size: '%1$s' ACC_016_SUG=Acceptable values include percentages, em multiples, 'larger', 'smaller', 'normal' or 'inherit'. 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'. @@ -32,6 +32,7 @@ CHK_005=The custom suggestion contains too many parameters in message overrides file '%1$s'. CHK_006=Unable to parse the custom format parameter in message overrides file '%1$s'. CHK_007=Error encountered while processing custom message file '%1$s': "%2$s". +CHK_008=Error encountered while processing an item '%1$s'; skip other checkes for the item. #CSS CSS_001=The \'%1$s\' property must not be included in an EPUB Style Sheet. @@ -120,6 +121,7 @@ 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. +HTM_053=Found an external file link (file://) in file: '%1$s'. #media MED_001=Video poster must have core media image type. @@ -141,7 +143,7 @@ NAV_009=Region-based navigation links must point to Fixed-Layout Documents. #NCX EPUB v2 Table of Contents -NCX_001=NCX identifier ('%1$s') does not match OPF identifier ('%2$s'). +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 ('dtb:uid' metadata) should not contain leading or trailing whitespace. @@ -190,7 +192,7 @@ OPF_034=The spine contains multiple references to the manifest item with id '%1$s'. OPF_035=Media type 'text/html' is not appropriate for XHTML/OPS. OPF_035_SUG=Use 'application/xhtml+xml' instead. -OPF_036=Video type '%1$s' might not be supported by reading systems +OPF_036=Video type '%1$s' might not be supported by reading systems OPF_036_SUG=Use 'video/mp4', 'video/h264' or 'video/webm' instead. OPF_037=Found deprecated media-type '%1$s'. OPF_038=Media type '%1$s' is not appropriate for an OEBPS 1.2 context; Use 'text/x-oeb1-document' instead. @@ -213,16 +215,16 @@ OPF_055=%1$s tag is empty. 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 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_058=Spine item '%1$s' is not referenced from the TOC in the Nav Doc. +OPF_058_SUG=Every spine item in the manifest should be referenced by at least one TOC entry in the Nav Doc. +OPF_059=Spine item '%1$s' is not referenced from the TOC in the NCX. +OPF_059_SUG=Every spine item in the manifest should be referenced by at least one TOC entry in the NCX file. +OPF_060=Duplicate entry in the ZIP file: '%1$s'. +OPF_061=Duplicate entry in the ZIP file (after Unicode NFC normalization) '%1$s'. 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_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'. @@ -232,17 +234,18 @@ 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_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_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. - +OPF_085='dc:identifier' value '%1$s' is marked as a UUID, but is an invalid UUID. + #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. @@ -267,18 +270,20 @@ 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. +PKG_024=Uncommon EPUB file extension. +PKG_024_SUG=For maximum compatibility, use '.epub'. #Resources 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_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 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_007=Referenced resource '%1$s' could not be found in the EPUB. +RSC_007w=Referenced resource '%1$s' could not be found in the EPUB. +RSC_008=Referenced resource '%1$s' 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. RSC_011=Found a reference to a resource that is not a spine item. @@ -286,13 +291,14 @@ RSC_013=Fragment identifier is used in a reference to a stylesheet resource. 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_016=Fatal Error while parsing file: %1$s +RSC_017=Warning while parsing file: %1$s RSC_018=Alternative image 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_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 ('%1$s' was not found in the spine). -RSC_022=Cannot check image details (requires Java version 7 or higher). +RSC_022=Cannot check image details (requires Java version 7 or higher). +RSC_023=The URL '%1$s' is missing %2$d slash(es) '/' after the protocol '%3$s:' #Scripting SCP_001=Use of Javascript eval() function in EPUB scripts is a security risk. @@ -308,4 +314,3 @@ SCP_009=Content file uses mouse event handlers. SCP_009_SUG=Ensure that all mouse driven functionality is accessible from the keyboard and touch devices. SCP_010=Epub 3 content file contains script. - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/dtd/svg11.dtd epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/dtd/svg11.dtd --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/dtd/svg11.dtd 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/dtd/svg11.dtd 2018-11-26 10:49:29.000000000 +0000 @@ -2272,10 +2272,16 @@ diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx-old.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx-old.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx-old.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx-old.rng 2018-11-26 10:49:29.000000000 +0000 @@ -195,7 +195,11 @@ - + + front + normal + special + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/ncx.rng 2018-11-26 10:49:29.000000000 +0000 @@ -223,7 +223,11 @@ - + + front + normal + special + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/opf20.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/opf20.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/opf20.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/opf20.rng 2018-11-26 10:49:29.000000000 +0000 @@ -333,7 +333,7 @@ - + @@ -440,7 +440,7 @@ - + @@ -458,9 +458,9 @@ - + - + @@ -475,7 +475,7 @@ - + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/svg/svg-style.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/svg/svg-style.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/svg/svg-style.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/svg/svg-style.rng 2018-11-26 10:49:29.000000000 +0000 @@ -102,10 +102,18 @@ - - - - + + + + + + + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/csismap.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/csismap.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/csismap.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/csismap.rng 2018-11-26 10:49:29.000000000 +0000 @@ -71,7 +71,7 @@ - + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/datatypes.rng epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/datatypes.rng --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/datatypes.rng 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/rng/xhtml/datatypes.rng 2018-11-26 10:49:29.000000000 +0000 @@ -91,6 +91,10 @@ + + + + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/20/sch/opf.sch 2018-11-26 10:49:29.000000000 +0000 @@ -1,14 +1,27 @@ - + - + The "id" attribute does not have a unique value + + + + + + + WARNING: Duplicate 'reference' elements with the same 'type' and 'href' attributes + + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -1,10 +1,21 @@ - - + default namespace = "http://www.w3.org/1999/xhtml" namespace epub = "http://www.idpf.org/2007/ops" - + include "epub-xhtml-30.rnc" { - html5.nav.content = html5.headings.class?, html5.ol - html5.oli.content = html5.a.phrasing | ((html5.a.phrasing | html5.span), html5.ol) + html5.nav.attlist &= epub.nav.attrs } - \ No newline at end of file + + epub.nav.attrs &= html5.global.common.attrs & epub.nav.xml.attrs + epub.nav.xml.attrs &= html5.xml.lang.attr? & html5.xml.base.attr? & html5.xml.space.attr? + + html5.sections.class |= epub.nav + + epub.nav = element nav { epub.type.attr & epub.nav.attrs & epub.nav.content } + epub.nav.content = html5.headings.class?, epub.nav.ol + + epub.nav.ol = element ol { html5.ol.attlist & epub.nav.ol.content } + epub.nav.ol.content = epub.nav.oli+ + + epub.nav.oli = element li { html5.oli.attlist & epub.nav.oli.content } + epub.nav.oli.content = html5.a.phrasing | ((html5.a.phrasing | html5.span), epub.nav.ol) diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/epub-nav-30.sch 2018-11-26 10:49:29.000000000 +0000 @@ -16,7 +16,7 @@ - + The span element must only be used as heading for flat sublists (not hierarchical navigation structures) @@ -24,13 +24,26 @@ - Missing epub:type attribute on anchor inside 'landmarks' nav - element + + + + + Missing epub:type attribute on anchor inside 'landmarks' nav element + + + WARNING: Duplicate 'a' elements with the same 'epub:type' and 'href' attributes inside 'landmarks' nav element - + Anchors within nav elements must contain text @@ -38,7 +51,7 @@ - + Spans within nav elements must contain text @@ -48,21 +61,25 @@ - - nav - elements other than 'toc', 'page-list' and 'landmarks' must contain a heading as the + nav + elements other than 'toc', 'page-list' and 'landmarks' must have a heading as their first child - + Heading elements must contain text - + + + + WARNING: nav elements should have an epub:type attribute + + + Attributes 'clipBegin' and 'clipEnd' must not be equal! + + + + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/datatypes.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -6,7 +6,7 @@ datatype.languagecode = datatype.BCP47 # http://www.w3.org/TR/xmlschema11-2/#language - datatype.BCP47 = xsd:language { pattern = "[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*" } + datatype.BCP47 = xsd:language # http://www.w3.org/TR/xmlschema11-2/#ID datatype.ID.xsd = xsd:ID # http://www.w3.org/TR/xmlschema11-2/#NCName diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-svg11-30.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-svg11-30.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-svg11-30.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/epub-svg11-30.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -1,7 +1,10 @@ # $Id: epub-svg11-30.rnc 3093 2011-08-22 18:33:36Z markus.gylling@gmail.com $ # Contributors: MURATA Makoto and Markus Gylling + default namespace = "http://www.w3.org/2000/svg" namespace epub = "http://www.idpf.org/2007/ops" - + namespace a = "http://relaxng.org/ns/compatibility/annotations/1.0" + + SVG.aria.attr = parent aria.role.attr? & parent aria.global & parent aria.widget.excl & parent aria.relationship.excl include "svg11/svg11-flat.rnc" { start = svg SVG.id.attrib = attribute id { parent datatype.ID }? @@ -9,6 +12,285 @@ SVG.Animation.class = notAllowed SVG.foreignObject.extra.content = parent html5.flow.class SVG.title.extra.content = parent html5.phrasing.class - SVG.Core.extra.attrib &= attribute epub:type { parent datatype.properties }? - } + SVG.Core.extra.attrib &= attribute epub:type { parent datatype.properties }? + a = + element a { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.XLinkReplace.attrib, + SVG.External.attrib, + attribute transform { TransformList.datatype }?, + attribute target { LinkTarget.datatype }?, + SVG.a.content + } + circle = + element circle { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute cx { Coordinate.datatype }?, + attribute cy { Coordinate.datatype }?, + attribute r { Length.datatype }, + attribute transform { TransformList.datatype }?, + SVG.circle.content + } + ellipse = + element ellipse { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute cx { Coordinate.datatype }?, + attribute cy { Coordinate.datatype }?, + attribute rx { Length.datatype }, + attribute ry { Length.datatype }, + attribute transform { TransformList.datatype }?, + SVG.ellipse.content + } + foreignObject = + element foreignObject { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x { Coordinate.datatype }?, + attribute y { Coordinate.datatype }?, + attribute width { Length.datatype }, + attribute height { Length.datatype }, + attribute transform { TransformList.datatype }?, + SVG.foreignObject.content + } + g = + element g { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute transform { TransformList.datatype }?, + SVG.g.content + } + image = + element image { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.XLinkEmbed.attrib, + SVG.External.attrib, + attribute x { Coordinate.datatype }?, + attribute y { Coordinate.datatype }?, + attribute width { Length.datatype }, + attribute height { Length.datatype }, + [ a:defaultValue = "xMidYMid meet" ] + attribute preserveAspectRatio { PreserveAspectRatioSpec.datatype }?, + attribute transform { TransformList.datatype }?, + SVG.image.content + } + line = + element line { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x1 { Coordinate.datatype }?, + attribute y1 { Coordinate.datatype }?, + attribute x2 { Coordinate.datatype }?, + attribute y2 { Coordinate.datatype }?, + attribute transform { TransformList.datatype }?, + SVG.line.content + } + path = + element path { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute d { PathData.datatype }, + attribute pathLength { Number.datatype }?, + attribute transform { TransformList.datatype }?, + SVG.path.content + } + polygon = + element polygon { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute points { Points.datatype }, + attribute transform { TransformList.datatype }?, + SVG.polygon.content + } + polyline = + element polyline { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute points { Points.datatype }, + attribute transform { TransformList.datatype }?, + SVG.polyline.content + } + rect = + element rect { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x { Coordinate.datatype }?, + attribute y { Coordinate.datatype }?, + attribute width { Length.datatype }, + attribute height { Length.datatype }, + attribute rx { Length.datatype }?, + attribute ry { Length.datatype }?, + attribute transform { TransformList.datatype }?, + SVG.rect.content + } + svg = + element svg { + SVG.aria.attr, + SVG.xmlns.attrib, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.DocumentEvents.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x { Coordinate.datatype }?, + attribute y { Coordinate.datatype }?, + attribute width { Length.datatype }?, + attribute height { Length.datatype }?, + attribute viewBox { ViewBoxSpec.datatype }?, + [ a:defaultValue = "xMidYMid meet" ] + attribute preserveAspectRatio { PreserveAspectRatioSpec.datatype }?, + [ a:defaultValue = "magnify" ] + attribute zoomAndPan { "disable" | "magnify" }?, + [ a:defaultValue = "1.1" ] attribute version { string "1.1" }?, + attribute baseProfile { Text.datatype }?, + [ a:defaultValue = "application/ecmascript" ] + attribute contentScriptType { ContentType.datatype }?, + [ a:defaultValue = "text/css" ] + attribute contentStyleType { ContentType.datatype }?, + SVG.svg.content + } + switch = + element switch { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute transform { TransformList.datatype }?, + SVG.switch.content + } + \text = + element text { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x { Coordinates.datatype }?, + attribute y { Coordinates.datatype }?, + attribute dx { Lengths.datatype }?, + attribute dy { Lengths.datatype }?, + attribute rotate { Numbers.datatype }?, + attribute textLength { Length.datatype }?, + attribute lengthAdjust { "spacing" | "spacingAndGlyphs" }?, + attribute transform { TransformList.datatype }?, + SVG.text.content + } + textPath = + element textPath { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.XLinkRequired.attrib, + SVG.External.attrib, + attribute startOffset { Length.datatype }?, + attribute textLength { Length.datatype }?, + attribute lengthAdjust { "spacing" | "spacingAndGlyphs" }?, + attribute method { "align" | "stretch" }?, + attribute spacing { "auto" | "exact" }?, + SVG.textPath.content + } + tspan = + element tspan { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.External.attrib, + attribute x { Coordinates.datatype }?, + attribute y { Coordinates.datatype }?, + attribute dx { Lengths.datatype }?, + attribute dy { Lengths.datatype }?, + attribute rotate { Numbers.datatype }?, + attribute textLength { Length.datatype }?, + attribute lengthAdjust { "spacing" | "spacingAndGlyphs" }?, + SVG.tspan.content + } + use = + element use { + SVG.aria.attr, + SVG.Core.attrib, + SVG.Conditional.attrib, + SVG.Style.attrib, + SVG.Presentation.attrib, + SVG.GraphicalEvents.attrib, + SVG.XLinkEmbed.attrib, + SVG.External.attrib, + attribute x { Coordinate.datatype }?, + attribute y { Coordinate.datatype }?, + attribute width { Length.datatype }?, + attribute height { Length.datatype }?, + attribute transform { TransformList.datatype }?, + SVG.use.content + } + } + + \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-attrib-30.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -9,8 +9,8 @@ - html5.lang.attr = attribute lang { datatype.languagecode } - html5.xml.lang.attr = attribute xml:lang { datatype.languagecode } + html5.lang.attr = attribute lang { datatype.languagecode | string "" } + html5.xml.lang.attr = attribute xml:lang { datatype.languagecode | string "" } html5.dir.attr = attribute dir { 'ltr' | 'rtl' | 'auto' } html5.id.attr = attribute id { datatype.html5.token } html5.title.attr = attribute title { string } @@ -19,7 +19,7 @@ html5.xml.space.attr = attribute xml:space { 'preserve' | 'default' } html5.href.attr = attribute href { datatype.html5.URL.spaces } - html5.hreflang.attr = attribute hreflang { datatype.languagecode } + html5.hreflang.attr = attribute hreflang { datatype.languagecode | string ""} html5.target.attr = attribute target { datatype.html5.browsing.context.name.or.keyword } html5.rel.attr = attribute rel { datatype.html5.space.separated.tokens } html5.media.attr = attribute media { datatype.html5.media.query } diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/html5/html5-embed-30.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -37,7 +37,7 @@ & html5.track.srclang.attr? & html5.track.label.attr? html5.track.kind.attr = attribute kind { 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata' } - html5.track.srclang.attr = attribute srclang { datatype.languagecode } + html5.track.srclang.attr = attribute srclang { datatype.languagecode | string "" } html5.track.label.attr = attribute label { datatype.string } html5.track.default.attr = attribute default { 'default' | '' } diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/svg11/svg11-flat.rnc epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/svg11/svg11-flat.rnc --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/mod/svg11/svg11-flat.rnc 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/mod/svg11/svg11-flat.rnc 2018-11-26 10:49:29.000000000 +0000 @@ -1619,7 +1619,7 @@ SVG.base.attrib, SVG.lang.attrib, SVG.Core.extra.attrib, - attribute type { ContentType.datatype }, + attribute type { ContentType.datatype }?, attribute media { MediaDesc.datatype }?, attribute title { Text.datatype }?, SVG.style.content diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/schema/30/package-30.sch 2018-11-26 10:49:29.000000000 +0000 @@ -281,6 +281,19 @@ + + + + + + WARNING: Duplicate 'reference' elements with the same 'type' and 'href' attributes + + + diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_de.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_de.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_de.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_de.properties 2018-11-26 10:49:29.000000000 +0000 @@ -1,32 +1,41 @@ single_file=Validierung erfolgt für diese Datei als Einzeldatei vom Typ %1$s, gegen EPUB-Version %2$s und mit dem %3$s-Profil. Nur ein kleiner Teil 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. +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 +there_were_errors=\nEPUBCheck mit Fehlern abgeschlossen +there_were_warnings=\nEPUBCheck mit Warnungen abgeschlossen. + +messages=Meldungen +counter_fatal=%1$d Fatale(r) Fehler +counter_error=%1$d Fehler +counter_warn=%1$d Warnung(en) +counter_info=%1$d Info(s) +counter_usage=%1$d Konvention(en) 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. +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!. profile_argument_expected=Dem --profile Parameter fehlt der Profilname. profile_unknown=Unbekanntes Profil '%1$s'. Es wird das Standard-Validierungsprofil angewendet. -no_file_specified=In den Parametern wurde keine Datei spezifiziert. EpubCheck wird beendet! +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 +directory_not_found=Verzeichnis 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' +epubcheck_version_text=EPUBCheck v%1$s -help_text = EpubCheck v%1$s\n\n\ +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\ Um ein Validierungsprofil anzugeben, verwende den Parameter --profile\n\ @@ -53,7 +62,7 @@ --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\ + EPUBCheck akzeptiert diese weiteren Optionen:\n\ --save = generiert ein EPUB aus dem entpackten Ordner\n\ --out = speichert das Ergebnis der Validierung im XML-Format\n\ --xmp = speichert das Ergebnis der Validierung im XMP-Format\n\ @@ -63,19 +72,19 @@ -o = Synonym zu --out\n\ -x = Synonym zu --xmp\n\ -j = Synonym zu --json\n\ - --failonwarnings[+|-] = Standardmäßig endet EpubCheck mit ExitCode 1 falls Fehler im EPUB gefunden wurden\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\ + \ 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\ + -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 [] = Ausgabe aller Message-ID's und Fehler-Level in eine\n\ \ benutzerdefinierte Datei oder auf der Konsole.\n\ - -c, --customMessages [] = Überschreibt die Fehler-Level von EpubCheck wie in der\n\ + -c, --customMessages [] = Überschreibt die Fehler-Level von EPUBCheck wie in der\n\ \ benutzerdefinierten Datei angegeben.\n\n\ + --version = Zeigt die EPUBCheck-Versionsnummer an\n\n\ -h, -? oder --help = Zeigt diese Hilfe an\n\ - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_en.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_en.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_es.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_es.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_es.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_es.properties 2018-11-26 10:49:29.000000000 +0000 @@ -3,14 +3,21 @@ 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 +there_were_errors=\nPrueba finalizada con errores +there_were_warnings=\nPrueba finalizada con advertencias + +messages=Messages +counter_fatal=%1$d fatal +counter_error=%1$d errors +counter_warn=%1$d warnings +counter_info=%1$d info +counter_usage=%1$d usage 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. +version_argument_expected=El número de versión se ha omitido en el argumento -v. mode_argument_expected=El tipo se ha omitido en el argumento -mode. profile_argument_expected=El nombre de perfil se ha omitido después del argumento -profile. profile_unknown=Perfil '%1$s' desconocido; se usará el perfil por defecto. @@ -21,22 +28,24 @@ 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' +directory_not_found=Directory not found: '%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' +epubcheck_version_text=EPUBCheck v%1$s -help_text = EpubCheck v%1$s\n\n\ +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\ Para especificar un perfil de validación (ejecuta comprobaciones sobre un perfil EPUB 3 específico\n\ o una especificación), use la opción -profile:\n\n\ Perfiles de validación soportados:\n\ - --profile default // perfil de validación por defecto\n\ - --profile dict // valida sobre la especificación EPUB Diccionarios y Glosarios\n\ - --profile edupub // valida sobre el perfil EDUPUB \n\ - --profile idx // valida sobre la especificación EPUB Índices\n\ - --profile preview // valida sobre la especificación EPUB Vistas Previas\n\n\ + --profile default // perfil de validación por defecto\n\ + --profile dict // valida sobre la especificación EPUB Diccionarios y Glosarios\n\ + --profile edupub // valida sobre el perfil EDUPUB \n\ + --profile idx // valida sobre la especificación EPUB Índices\n\ + --profile preview // valida sobre la especificación EPUB Vistas Previas\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 archivo con -mode.\n\ La versión por defecto es: 3.0.\n\n\ @@ -48,8 +57,8 @@ --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\ + --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 \t = guarda el epub creado a partir del epub expandido\n\ --out = extrae un fichero XML de validación (utilice - para salida a la consola)\n\ @@ -73,6 +82,6 @@ -l, --listChecks [] = enumera los identificadores de mensaje y los niveles de gravedad en el archivo personalizado de mensajes \n\ \ o en la consola\n\ -c, --customMessages [] = sobreescribe los niveles de gravedad del mensaje según los parámetros del archivo personalizado de mensajes \n\n\ + --version = displays the EPUBCheck version\n\n\ -h, -? or --help = muestra este texto de ayuda\n\ - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_fr.properties 2018-11-26 10:49:29.000000000 +0000 @@ -3,14 +3,21 @@ 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 +there_were_errors=\nVérification terminée avec des erreurs +there_were_warnings=\nVérification terminée avec des avertissements + +messages=Messages +counter_fatal=%1$d fatal +counter_error=%1$d errors +counter_warn=%1$d warnings +counter_info=%1$d info +counter_usage=%1$d usage 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. +version_argument_expected=Le numéro de version a été omis dans l'argument -v. mode_argument_expected=Le type a été omis dans l'argument -mode. profile_argument_expected=Le nom du profil a été omis après l'argument -profile. profile_unknown=Profile '%1$s' inconnu, utilisation du profil de validation par défaut. @@ -21,20 +28,22 @@ 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' +directory_not_found=Directory not found: '%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' +epubcheck_version_text=EPUBCheck v%1$s -help_text = EpubCheck v%1$s\n\n\ +help_text = EPUBCheck v%1$s\n\n\ Pour utiliser cet outil, le premier argument doit être le nom (ou le chemin) du fichier à valider.\n\n\ Pour spécifier un profil de validation (pour effectuer les vérifications spécifiques à un profil ou une extension EPUB 3), utilisez l'option -profile.\n\n\ Profils de validation acceptés :\n\ - --profile default // le profil de validation par défaut\n\ - --profile dict // vérifie les règles de la spécification Dictionnaires et Glossaires EPUB\n\ - --profile edupub // vérifie les règles du profil EDUPUB\n\ - --profile idx // vérifie les règles de la spécification Indexes EPUB\n\ - --profile preview // vérifie les règles de la spécification Aperçus EPUB\n\n\ + --profile default // le profil de validation par défaut\n\ + --profile dict // vérifie les règles de la spécification Dictionnaires et Glossaires EPUB\n\ + --profile edupub // vérifie les règles du profil EDUPUB\n\ + --profile idx // vérifie les règles de la spécification Indexes EPUB\n\ + --profile preview // vérifie les règles de la spécification Aperçus EPUB\n\n\ En cas de vérification d'un fichier simple inclus dans un EPUB, la version de la spécification EPUB à vérifier doit être spécifiée avec l'option -v et le type de \n\ fichier avec l'option -mode.\n\ La version par défaut est 3.0.\n\n\ @@ -46,8 +55,8 @@ --mode svg -v 2.0\n\ --mode svg -v 3.0\n\ --mode nav -v 3.0\n\ - --mode mo -v 3.0 // Pour une vérification des Media Overlays\n\ - --mode exp // Pour une vérification de répertoire EPUB non-compressé\n\n\ + --mode mo -v 3.0 // Pour une vérification des Media Overlays\n\ + --mode exp // Pour une vérification de répertoire EPUB non-compressé\n\n\ Cet outil accepte les options suivantes :\n\ --save \t = sauvegarde un EPUB créé depuis un EPUB non-compressé\n\ --out = produit un rapport de validation XML (utiliser - pour le produire sur la\n\ @@ -71,10 +80,10 @@ -w, --warn = inclure uniquement les erreurs, erreurs fatales, et warnings dans la sortie.\n\ -u, --usage = inclure les informations d'usage dans la sortie (OFF par défaut) ;\n\ \ si cette option est activée, des informations d'usage apparaitront systématiquement\n\ - \ dans les rapports de validation.\n\n\ + \ dans les rapports de validation.\n\ -l, --listChecks [] = liste les identificateurs de message et les niveaux de sévérité dans le fichier\n\ \ de sortie ou sur la sortie standard.\n\ -c, --customMessages [] = remplace les niveaux de sévérité par défaut par ceux contenus\n\ - \ dans le fichier \n\n\ - -h, -? or --help = affiche cette aide - + \ dans le fichier \n\ + --version = affiche la version EPUBCheck\n\ + -h, -? or --help = affiche cette aide diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_it.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_it.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_it.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_it.properties 2018-11-26 10:49:29.000000000 +0000 @@ -25,7 +25,7 @@ unrecognized_argument=Argumento non riconosciuto: '%1$s'. help_text = \ - EpubCheck v%1$s\n\n\ + 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\ diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_ja.properties 2018-11-26 10:49:29.000000000 +0000 @@ -3,14 +3,21 @@ mode_version_not_supported=このチェッカーではファイル種別 %1$s、 version %2$s の検証はできません. no_errors__or_warnings=エラーも警告も検出されませんでした. -there_were_errors=\nエラーが検出されました\n -there_were_warnings=\n警告が検出されました\n +there_were_errors=\nチェックは終了しましたがエラーが検出されました +there_were_warnings=\nチェックは終了しましたが警告が検出されました + +messages=メッセージ +counter_fatal=%1$d 件の致命的エラー +counter_error=%1$d 件のエラー +counter_warn=%1$d 件の警告 +counter_info=%1$d 件の情報 +counter_usage=%1$d 件の利用法情報 error_processing_unexpanded_epub=\nこのチェックは展開されたepubでは実行できません\n deleting_archive=\nエラーの検出のためEPUBの生成を中止しました.\n -display_help=-help ヘルプを表示 +display_help=-help ヘルプメッセージを表示します argument_needed=少なくとも1つの引数が必要です -version_argument_expected=オプション -version で与えられるバージョン番号が省略されています +version_argument_expected=オプション -v で与えられるバージョン番号が省略されています mode_argument_expected=オプション --mode で与えられるファイル種別が省略されています profile_argument_expected=オプション --profile で与えられるプロファイル名が省略されています. profile_unknown=不明なプロファイル '%1$s' が指定されたため, デフォルトの検証用プロファイルを使用します. @@ -21,22 +28,24 @@ output_type_conflict=一度に指定できる出力フォーマットは1つのみです. validating_against_epub_version=EPUBバージョン %1$s のファイルに対して検証します - カスタムバリデーション file_not_found=ファイルが見つかりませんでした: '%1$s' +directory_not_found=ディレクトリが見つかりませんでした: '%1$s' epubcheck_completed=epubcheck 完了 -error_creating_config_file=Error creating config file '%1$s'. +error_creating_config_file=設定ファイル '%1$s' の作成に失敗しました. expected_message_filename=カスタムメッセージファイル名として指定されている引数が '%1$s' となっていました unrecognized_argument=認識できない引数です: '%1$s' +epubcheck_version_text=EPUBCheck v%1$s -help_text = EpubCheck v%1$s\n\n\ +help_text = EPUBCheck v%1$s\n\n\ このツールを実行するには、最初の引数をチェックしたいファイルの(パスを含んだ)\n\ 名前にして下さい.\n\n\ (特定のEPUB 3 プロファイルや拡張仕様に対してチェックするため)検証用プロファイルを\n\ 指定するには, -profile オプションを使用します:\n\n\ サポートしている検証用プロファイル:\n\ - --profile default // デフォルトの検証用プロファイルを使用します\n\ - --profile dict // EPUB Dictionaries and Glossaries 仕様に対して検証します\n\ - --profile edupub // EDUPUB Profile に対して検証します\n\ - --profile idx // EPUB Indexes 仕様に対して検証します\n\ - --profile preview // EPUB Previews 仕様に対して検証します\n\n\ + --profile default // デフォルトの検証用プロファイルを使用します\n\ + --profile dict // EPUB Dictionaries and Glossaries 仕様に対して検証します\n\ + --profile edupub // EDUPUB Profile に対して検証します\n\ + --profile idx // EPUB Indexes 仕様に対して検証します\n\ + --profile preview // EPUB Previews 仕様に対して検証します\n\n\ 非epubファイルを検証する際は、-v オプションでepubのバージョンを、\n\ -modeオプションでファイル種別を指定します.\n\ デフォルトのバージョン: 3.0.\n\n\ @@ -48,7 +57,7 @@ --mode svg -v 2.0\n\ --mode svg -v 3.0\n\ --mode nav -v 3.0 // メディアオーバーレイ検証用\n\ - --mode mo -v 3.0 // 展開済みEPUBアーカイブ\n\ + --mode mo -v 3.0 // 展開済みEPUBアーカイブ\n\ --mode exp\n\n\ 以下のオプションも受け付けます:\n\ --save \t = 展開されたepubパスから生成されたepubファイルを保存します\n\ @@ -73,6 +82,6 @@ -l, --listChecks [] = メッセージIDと深刻度レベルをカスタムメッセージファイル または\n\ \ コンソールに出力します\n\ -c, --customMessages [] = カスタムメッセージファイル でメッセージ深刻度レベルを上書きします\n\n\ + --version = displays the EPUBCheck version\n\n\ -h, -? or --help = ヘルプメッセージを表示します\n\ - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages_nl.properties 2018-11-26 10:49:29.000000000 +0000 @@ -3,14 +3,21 @@ mode_version_not_supported=De check kan type %1$s en versie %2$s niet valideren. no_errors__or_warnings=Geen fouten of waarschuwingen gedetecteerd. -there_were_errors=\nDe check heeft fouten opgeleverd.\n -there_were_warnings=\nDe check heeft waarschuwingen opgeleverd.\n +there_were_errors=\nDe check heeft fouten opgeleverd. +there_were_warnings=\nDe check heeft waarschuwingen opgeleverd. + +messages=Messages +counter_fatal=%1$d fatal +counter_error=%1$d errors +counter_warn=%1$d warnings +counter_info=%1$d info +counter_usage=%1$d usage error_processing_unexpanded_epub=\nDeze check kan niet gebruikt worden voor het controleren van uitgepakte epubs.\n deleting_archive=\nHet vervaardigen van uw epub is afgebroken wegens ontdekte fouten.\n display_help=-help geeft de hulpboodschappen weer argument_needed=Er wordt tenminste 1 argument verwacht -version_argument_expected=U heeft het versienummer niet ingevuld bij het -version argument. +version_argument_expected=U heeft het versienummer niet ingevuld bij het -v argument. mode_argument_expected=U heeft het type niet ingevuld bij het -mode argument. profile_argument_expected=Geen profielnaam ingevuld na het het -profile argument. profile_unknown=Onbekend profiel '%1$s', het standaard validatieprofiel wordt gebruikt. @@ -21,22 +28,25 @@ output_type_conflict=U kunt slechts 1 uitvoerformaat per keer specificeren. validating_against_epub_version=Validatie geschiedt op basis van de regels van EPUB versie %1$s - aangepaste validatie. file_not_found=Bestand niet gevonden: '%1$s' +directory_not_found=Directory not found: '%1$s' epubcheck_completed=epubcheck is klaar error_creating_config_file=Foutmelding bij het aanmaken van het configuratiebestand '%1$s'. expected_message_filename=Er werd een bestandsnaam met een aangepaste boodschap verwacht, maar '%1$s' is aangetroffen unrecognized_argument=Dit argument werd niet herkend: '%1$s' +epubcheck_version_text=EPUBCheck v%1$s -help_text = EpubCheck v%1$s \n\n\ +help_text = EPUBCheck v%1$s \n\n\ Bij het starten van dit programma wordt als eerste argument de bestandsnaam (inclusief directorypad) van het te controleren bestand verwacht. \n\n\ Om een validatieprofiel te specificeren (om te checken tegen een specifiek ePub 3 profiel\n\ of extensiespecificatie), gebruikt u de -profile optie:\n\n\ Ondersteunde validatieprofielen:\n\ - --profile default // het standaard validatieprofiel\n\ - --profile dict // valideert tegen de ePub Dictionaries & Glossaries specificatie\n\ - --profile edupub // valideert tegen de EDUPUB specificatie\n\ - --profile idx // valideert tegen de ePub Indexes specificatie\n\ - --profile preview // valideert tegen de ePub Previews specificatie\n\n\ - Als u een bestand wilt controleren dat geen epub is moet de epub-versie worden gespecificeerd met gebruik van -v \n\ + --profile default // het standaard validatieprofiel\n\ + --profile dict // valideert tegen de ePub Dictionaries & Glossaries specificatie\n\ + --profile edupub // valideert tegen de EDUPUB specificatie\n\ + --profile idx // valideert tegen de ePub Indexes specificatie\n\ + --profile preview // valideert tegen de ePub Previews specificatie\n\n\ + Als u een bestand wilt controleren dat geen epub is\n\ + moet de epub-versie worden gespecificeerd met gebruik van -v \n\ en het type bestand met gebruik van -mode. \n\ De standaardversie is 3.0. \n\n\ De ondersteunde modes en versies: \n\ @@ -47,34 +57,34 @@ --mode svg -v 2.0 \n\ --mode svg -v 3.0 \n\ --mode nav -v 3.0 \n\ - --mode mo -v 3.0 // Voor het valideren van Media Overlays \n\ - --mode exp // Voor uitgepakte epub structuren \n\n\ + --mode mo -v 3.0 // Voor het valideren van Media Overlays \n\ + --mode exp // Voor uitgepakte epub structuren \n\n\ Dit programma accepteert ook de volgende optionele instellingen: \n\ - --save ⇥ = slaat een epub op vanuit de uitgepakte epub structuur \n\ - --out = geeft een XML bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ - --xmp = geeft een XMP bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ - --json = geeft een JSON bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ - -m = gelijk aan --mode \n\ - -p = gelijk aan --profile\n\ - -o = gelijk aan --out \n\ - -x = gelijk aan --xmp \n\ - -j = gelijk aan --json \n\ - --failonwarnings[+|-] = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd \n\ - en een waarde van 0 als alles OK is. \n\ - Gebruik --failonwarnings als u wilt dat er een waarde van 1 wordt teruggegeven als er fouten \n\ - OF waarschuwingen worden ontdekt. \n\ - Een waarde van 0 betekent dat er fouten noch waarschuwingen gedetecteerd zijn. \n\ - -q, --quiet = geen berichten in de console, afgezien van eventuele foutmeldingen. In de output vindt u wel alles terug. \n\ - -f, --fatal = meldt alleen fatale fouten in de output \n\ - -e, --error = meldt alleen foutmeldingen en berichten met fatale afloop in de output \n\ - -w, --warn = zowel fatale, foutmeldingen en waarschuwingen in de output \n\ - -u, --usage = vermeldt de instellingen van dit programma in de output \n\ - (standaard staat dit OFF); wanneer dit op ON staat wordt deze \n\ - informatie altijd weergegeven in het outputbestand. \n\ - -l, --listChecks [] = geeft bericht IDs en zwaartegraden weer in het berichtenbestand \n\ - met de naam of het console. \n\ - -c, --customMessages [] = gebruikt de zwaartegraden uit het aparte berichtenbestand \n\ - met de naam \n\ - -h, -? of --help = geeft dit hulpbestand weer\n\ + --save = slaat een epub op vanuit de uitgepakte epub structuur \n\ + --out = geeft een XML bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ + --xmp = geeft een XMP bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ + --json = geeft een JSON bestand met het resultaat van de check (wordt gebruikt om de resultaten in het console weer te geven) \n\ + -m = gelijk aan --mode \n\ + -p = gelijk aan --profile\n\ + -o = gelijk aan --out \n\ + -x = gelijk aan --xmp \n\ + -j = gelijk aan --json \n\ + --failonwarnings[+|-] = standaard geeft het programma een waarde van 1 als er fouten worden gedetecteerd \n\ + \ en een waarde van 0 als alles OK is. \n\ + \ Gebruik --failonwarnings als u wilt dat er een waarde van 1 wordt teruggegeven als er fouten \n\ + \ OF waarschuwingen worden ontdekt. \n\ + \ Een waarde van 0 betekent dat er fouten noch waarschuwingen gedetecteerd zijn. \n\ + -q, --quiet = geen berichten in de console, afgezien van eventuele foutmeldingen. In de output vindt u wel alles terug. \n\ + -f, --fatal = meldt alleen fatale fouten in de output \n\ + -e, --error = meldt alleen foutmeldingen en berichten met fatale afloop in de output \n\ + -w, --warn = zowel fatale, foutmeldingen en waarschuwingen in de output \n\ + -u, --usage = vermeldt de instellingen van dit programma in de output \n\ + \ (standaard staat dit OFF); wanneer dit op ON staat wordt deze \n\ + \ informatie altijd weergegeven in het outputbestand. \n\ + -l, --listChecks [] = geeft bericht IDs en zwaartegraden weer in het berichtenbestand \n\ + \ met de naam of het console. \n\ + -c, --customMessages [] = gebruikt de zwaartegraden uit het aparte berichtenbestand \n\ + \ met de naam \n\ + --version = displays the EPUBCheck version\n\ + -h, -? of --help = geeft dit hulpbestand weer\n\ - diff -Nru epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages.properties epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages.properties --- epubcheck-4.0.2/src/main/resources/com/adobe/epubcheck/util/messages.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/adobe/epubcheck/util/messages.properties 2018-11-26 10:49:29.000000000 +0000 @@ -3,17 +3,24 @@ mode_version_not_supported=The checker doesn't validate type %1$s and version %2$s. no_errors__or_warnings=No errors or warnings detected. -there_were_errors=\nCheck finished with errors\n -there_were_warnings=\nCheck finished with warnings\n +there_were_errors=\nCheck finished with errors +there_were_warnings=\nCheck finished with warnings + +messages=Messages +counter_fatal=%1$d fatal +counter_error=%1$d errors +counter_warn=%1$d warnings +counter_info=%1$d info +counter_usage=%1$d usage error_processing_unexpanded_epub=\nThis check cannot process expanded epubs\n deleting_archive=\nEpub creation cancelled due to detected errors.\n display_help=-help displays help argument_needed=At least one argument expected -version_argument_expected=Version number omitted from the -version argument. +version_argument_expected=Version number omitted from the -v argument. mode_argument_expected=Type omitted from the -mode argument. profile_argument_expected=Profile name omitted after the -profile argument. -profile_unknown=Unknown profile '%1$s', using default validation profile. +profile_unknown=Unknown profile '%1$s', 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. @@ -21,13 +28,16 @@ output_type_conflict=Only one output format can be specified at a time. validating_against_epub_version=Validating against EPUB version %1$s - custom validation file_not_found=File not found: '%1$s' +directory_not_found=Directory not found: '%1$s' epubcheck_completed=epubcheck completed error_creating_config_file=Error creating config file '%1$s'. expected_message_filename=Expected the Custom message file name, but found '%1$s' unrecognized_argument=Unrecognized argument: '%1$s' +epubcheck_version_text=EPUBCheck v%1$s +incorrect_locale=Argument '%1$s' to the --locale option is %2$s. help_text = \ - EpubCheck v%1$s\n\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\ @@ -35,15 +45,15 @@ 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\ + --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\ + be specified using -v and the type of the file using -mode.\n\ + The default version is: 3.0.\n\ \n\ Modes and versions supported: \n\ --mode opf -v 2.0\n\ @@ -53,11 +63,11 @@ --mode svg -v 2.0\n\ --mode svg -v 3.0\n\ --mode nav -v 3.0\n\ - --mode mo -v 3.0 // For Media Overlays validation\n\ - --mode exp // For expanded EPUB archives\n\ + --mode mo -v 3.0 // for Media Overlays validation\n\ + --mode exp // for expanded EPUB archives\n\ \n\ This tool also accepts the following options:\n\ - --save = saves the epub created from the expanded epub\n\ + --save = saves the epub created from the expanded epub\n\ --out = output an assessment XML document file (use - to output to console)\n\ --xmp = output an assessment XMP document file (use - to output to console)\n\ --json = output an assessment JSON document file (use - to output to console)\n\ @@ -74,12 +84,14 @@ -e, --error = include only error and fatal severity messages in ouput\n\ -w, --warn = include fatal, error, and warn severity messages in output\n\ -u, --usage = include ePub feature usage information in output\n\ - \ (default is OFF); if enabled, usage information will\n\ - \ always be included in the output file\n\ + \ (default is OFF); if enabled, usage information will\n\ + \ always be included in the output file\n\ + --locale = output localized messages according to the provided IETF BCP 47 language tag string.\n\ \n\ - -l, --listChecks [] = list message ids and severity levels to the custom message file named \n\ - \ or the console\n\ + -l, --listChecks [] = list message ids and severity levels to the custom message file named \n\ + \ or the console\n\ -c, --customMessages [] = override message severity levels as defined in the custom message file named \n\ \n\ + --version = displays the EPUBCheck version\n\ + \n\ -h, -? or --help = displays this help message\n - diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_de.properties 2018-11-26 10:49:29.000000000 +0000 @@ -29,7 +29,7 @@ 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 +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}) diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_en.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_en.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_fr.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_fr.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_fr.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_fr.properties 2018-11-26 10:49:29.000000000 +0000 @@ -5,32 +5,32 @@ # because otherwise Jing can't parse them. Bad UTF8-support # Properties file specifying messages -enumeration_param=la facette \"enumeration\" n''est pas autoris\u00E9e en tant que param\u00E8tre : utiliser l'\u00E9l\u00E9ment \"value\". -whiteSpace_param=la facette \"whiteSpace\" n''est pas autoris\u00E9e en tant que param\u00E8tre +enumeration_param=la facette \"enumeration\" n''''est pas autoris\u00E9e en tant que param\u00E8tre : utiliser l''\u00E9l\u00E9ment \"value\". +whiteSpace_param=la facette \"whiteSpace\" n''''est pas autoris\u00E9e en tant que param\u00E8tre unrecognized_param=param\u00E8tre \"{0}\" non reconnu invalid_regex=expression r\u00E9guli\u00E8re invalide\u00A0: {0} not_ordered=le param\u00E8tre peut seulement \u00EAtre appliqu\u00E9 \u00E0 un type de donn\u00E9e ordonn\u00E9 -invalid_limit=\"{0}\" n'est pas autoris\u00E9 par le type de base\u00A0: {1} +invalid_limit=\"{0}\" n''est pas autoris\u00E9 par le type de base\u00A0: {1} no_length=le type de base ne d\u00E9finit pas une unit\u00E9 de longueur -scale_not_derived_from_decimal=le param\u00E8tre \"scale\" ne peut \u00EAtre appliqu\u00E9 qu'aux types d\u00E9riv\u00E9s de \"decimal\" +scale_not_derived_from_decimal=le param\u00E8tre \"scale\" ne peut \u00EAtre appliqu\u00E9 qu''aux types d\u00E9riv\u00E9s de \"decimal\" scale_not_non_negative_integer=le param\u00E8tre \"scale\" doit \u00EAtre un entier non n\u00E9gatif length_not_non_negative_integer=le param\u00E8tre \"length\" doit \u00EAtre un entier non n\u00E9gatif -precision_not_derived_from_decimal=le param\u00E8tre \"precision\" ne peut \u00EAtre appliqu\u00E9 qu'aux types d\u00E9riv\u00E9s de \"decimal\" +precision_not_derived_from_decimal=le param\u00E8tre \"precision\" ne peut \u00EAtre appliqu\u00E9 qu''aux types d\u00E9riv\u00E9s de \"decimal\" precision_not_positive_integer=le param\u00E8tre \"precision\" doit \u00EAtre un entier non n\u00E9gatif -regex_impl_not_found=Aucun moteur d'expressions r\u00E9guli\u00E8res n'a pu \u00EAtre trouv\u00E9; utilisez JDK 1.4 ou ajoutez Xerces2 \u00E0 votre classpath -regex_internal_error=erreur interne dans l'expression r\u00E9guli\u00E8re pour le type de donn\u00E9es {0} +regex_impl_not_found=Aucun moteur d''expressions r\u00E9guli\u00E8res n''a pu \u00EAtre trouv\u00E9; utilisez JDK 1.4 ou ajoutez Xerces2 \u00E0 votre classpath +regex_internal_error=erreur interne dans l''expression r\u00E9guli\u00E8re pour le type de donn\u00E9es {0} # validation errors length_violation=doit \u00EAtre {0} avec une longueur \u00E9gale \u00E0 {1} (la longueur trouv\u00E9e est {2}) -max_length_violation=doit \u00EAtre {0} avec une longueur d'au plus {1} (la longueur trouv\u00E9e est {2}) -min_length_violation=doit \u00EAtre {0} avec une longueur d'au moins {1} (la longueur trouv\u00E9e est {2}) +max_length_violation=doit \u00EAtre {0} avec une longueur d''au plus {1} (la longueur trouv\u00E9e est {2}) +min_length_violation=doit \u00EAtre {0} avec une longueur d''au moins {1} (la longueur trouv\u00E9e est {2}) min_inclusive_violation=doit \u00EAtre {0} sup\u00E9rieur ou \u00E9gal \u00E0 {1} min_exclusive_violation=doit \u00EAtre {0} sup\u00E9rieur \u00E0 {1} max_inclusive_violation=doit \u00EAtre {0} inf\u00E9rieur ou \u00E9gal \u00E0 {1} max_exclusive_violation=doit \u00EAtre {0} inf\u00E9rieur \u00E0 {1} -pattern_violation=doit \u00EAtre {0} satisfaisant l'expression r\u00E9guli\u00E8re \"{1}\" -entity_violation=doit \u00EAtre un nom d\u00E9clar\u00E9 dans la DTD en tant qu'entit\u00E9 non-pars\u00E9e -undeclared_prefix=doit un \u00EAtre un QName avec un pr\u00E9fixe, si sp\u00E9cifi\u00E9, d\u00E9clar\u00E9 (le pr\u00E9fixe \"{0}\" n'est pas d\u00E9clar\u00E9) +pattern_violation=doit \u00EAtre {0} satisfaisant l''expression r\u00E9guli\u00E8re \"{1}\" +entity_violation=doit \u00EAtre un nom d\u00E9clar\u00E9 dans la DTD en tant qu''entit\u00E9 non-pars\u00E9e +undeclared_prefix=doit un \u00EAtre un QName avec un pr\u00E9fixe, si sp\u00E9cifi\u00E9, d\u00E9clar\u00E9 (le pr\u00E9fixe \"{0}\" n''est pas d\u00E9clar\u00E9) precision_violation=doit \u00EAtre {0} avec au plus {1} chiffres significatifs ({2} chiffres ont \u00E9t\u00E9 trouv\u00E9s) precision_1_violation=doit \u00EAtre {0} avec exactement un chiffre significatif ({1} chiffres ont \u00E9t\u00E9 trouv\u00E9s) # part of the point is to avoid ugly "digit(s)" in the error message diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/datatype/xsd/resources/Messages_ja.properties 2018-11-26 10:49:29.000000000 +0000 @@ -5,20 +5,20 @@ # 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} +enumeration_param=\"enumeration\" \u30D5\u30A1\u30BB\u30C3\u30C8\u306F\u30D1\u30E9\u30E1\u30BF\u306B\u306F\u8A31\u3055\u308C\u3066\u3044\u307E\u305B\u3093: \u4EE3\u308F\u308A\u306B \"value\" \u8981\u7D20\u3092\u4F7F\u3063\u3066\u304F\u3060\u3055\u3044 +whiteSpace_param=\"whiteSpace\" \u30D5\u30A1\u30BB\u30C3\u30C8\u306F\u30D1\u30E9\u30E1\u30BF\u306B\u306F\u8A31\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +unrecognized_param=\u8A8D\u8B58\u3067\u304D\u306A\u3044\u30D1\u30E9\u30E1\u30BF\u3067\u3059 \"{0}\" +invalid_regex=\u4E0D\u6B63\u306A\u6B63\u898F\u8868\u73FE\u3067\u3059: {0} +not_ordered=\u30D1\u30E9\u30E1\u30BF\u306F\u9806\u5E8F\u3064\u304D\u30C7\u30FC\u30BF\u578B\u306B\u3057\u304B\u9069\u7528\u3067\u304D\u307E\u305B\u3093 +invalid_limit=\"{0}\" \u306F\u30D9\u30FC\u30B9\u306E\u30C7\u30FC\u30BF\u578B {1} \u306B\u3088\u308A\u4F7F\u3048\u307E\u305B\u3093 +no_length=\u30D9\u30FC\u30B9\u306E\u30C7\u30FC\u30BF\u578B\u306F\u9577\u3055\u306E\u5358\u4F4D\u3092\u5B9A\u7FA9\u3057\u3066\u3044\u307E\u305B\u3093 +scale_not_derived_from_decimal=\"scale\" \u30D1\u30E9\u30E1\u30BF\u306F \"decimal\" \u304B\u3089\u6D3E\u751F\u3057\u305F\u30C7\u30FC\u30BF\u578B\u306B\u3057\u304B\u9069\u7528\u3067\u304D\u307E\u305B\u3093 +scale_not_non_negative_integer=\"scale\" \u30D1\u30E9\u30E1\u30BF\u306F\u8CA0\u3067\u306A\u3044\u6574\u6570\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 +length_not_non_negative_integer=\"length\" \u30D1\u30E9\u30E1\u30BF\u306F\u8CA0\u3067\u306A\u3044\u6574\u6570\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 +precision_not_derived_from_decimal=\"precision\" \u30D1\u30E9\u30E1\u30BF\u306F \"decimal\" \u304B\u3089\u6D3E\u751F\u3057\u305F\u30C7\u30FC\u30BF\u578B\u306B\u3057\u304B\u9069\u7528\u3067\u304D\u307E\u305B\u3093 +precision_not_positive_integer=\"precision\" \u30D1\u30E9\u30E1\u30BF\u306F\u6B63\u306E\u6574\u6570\u3067\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 +regex_impl_not_found=\u6B63\u898F\u8868\u73FE\u306E\u5B9F\u88C5\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093; JDK 1.4 \u3092\u4F7F\u3046\u304B\u3001 Xerces2 \u3092\u30AF\u30E9\u30B9\u30D1\u30B9\u306B\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044 +regex_internal_error=\u6B63\u898F\u8868\u73FE\u30C7\u30FC\u30BF\u578B {0} \u306E\u5185\u90E8\u30A8\u30E9\u30FC # validation errors length_violation={0}\u306E\u9577\u3055\u306F {1} \u3067\u306A\u304F\u3066\u306F\u306A\u308A\u307E\u305B\u3093. (\u9577\u3055\u304C {2} \u3067\u3057\u305F) diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_en.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_en.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_fr.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_fr.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_fr.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_fr.properties 2018-11-26 10:49:29.000000000 +0000 @@ -10,27 +10,27 @@ reference_to_undefined=r\u00E9f\u00E9rence \u00E0 un patron ind\u00E9termin\u00E9 \"{0}\" missing_start_element=\u00E9l\u00E9ment \"start\" manquant recursive_reference=mauvais r\u00E9f\u00E9rence r\u00E9cursive au patron \"{0}\" -recursive_include=inclusion r\u00E9cursive de l'URL \"{0}\" +recursive_include=inclusion r\u00E9cursive de l''URL \"{0}\" duplicate_define=plusieurs d\u00E9finitions de \"{0}\" sans attribut \"combine\" duplicate_start=plusieurs d\u00E9finitions de start sans attribut \"combine\" -conflict_combine_define=valeurs conflictuelles de l'attribut \"combine\" pour la d\u00E9finition de \"{0}\" -conflict_combine_start=valeurs conflictuelles de l'attribut \"combine\" pour la d\u00E9finition de start +conflict_combine_define=valeurs conflictuelles de l''attribut \"combine\" pour la d\u00E9finition de \"{0}\" +conflict_combine_start=valeurs conflictuelles de l''attribut \"combine\" pour la d\u00E9finition de start missing_start_replacement=\"start\" dans \"include\" ne remplace rien missing_define_replacement=d\u00E9finition de \"{0}\" dans \"include\" ne remplace rien -interleave_string=entrelacement d'\u00E9l\u00E9ment \"string\" ou \"data\" -group_string=groupe d'\u00E9l\u00E9ment \"string\" ou \"data\" -one_or_more_string=r\u00E9p\u00E9tition d'\u00E9l\u00E9ment \"string\" ou \"data\" +interleave_string=entrelacement d''\u00E9l\u00E9ment \"string\" ou \"data\" +group_string=groupe d''\u00E9l\u00E9ment \"string\" ou \"data\" +one_or_more_string=r\u00E9p\u00E9tition d''\u00E9l\u00E9ment \"string\" ou \"data\" unrecognized_datatype=type de donn\u00E9es \"{1}\" de la librairie \"{0}\" non reconnu unsupported_datatype_detail=type de donn\u00E9es \"{1}\" de la librairie \"{0}\" non support\u00E9 : {2} unrecognized_datatype_library=librairie de type de donn\u00E9es \"{0}\" non reconnue unrecognized_builtin_datatype=aucun type \"{0}\" pr\u00E9d\u00E9fini : doit \u00EAtre \"string\" ou \"token\" -invalid_value=\"{0}\" n'est pas une valeur valide de type de donn\u00E9es +invalid_value=\"{0}\" n''est pas une valeur valide de type de donn\u00E9es parent_ref_outside_grammar=r\u00E9f\u00E9rence \u00E0 une grammaire parent inexistante ref_outside_grammar=r\u00E9f\u00E9rence \u00E0 une grammaire inexistante expected_one_name_class=\u00E9l\u00E9ment \"{0}\" trouv\u00E9 mais aucun autre contenu attendu -builtin_param=les types de donn\u00E9es int\u00E9gr\u00E9s n'ont aucun param\u00E8tres -invalid_param_display=param\u00E8tre invalide :\n{0} -invalid_param_detail_display=param\u00E8tre invalide : {0}\n{1} +builtin_param=les types de donn\u00E9es int\u00E9gr\u00E9s n''ont aucun param\u00E8tres +invalid_param_display=param\u00E8tre invalide:\n{0} +invalid_param_detail_display=param\u00E8tre invalide: {0}:\n{1} display_param={0}>>>>{1} invalid_param_detail=param\u00E8tre invalide : {0} invalid_param=param\u00E8tre invalide @@ -39,23 +39,23 @@ datatype_requires_parameter=le type de donn\u00E9es ne peut pas \u00EAtre utilis\u00E9 sans param\u00E8tre datatype_requires_parameter_detail=le type de donn\u00E9es ne peut pas \u00EAtre utilis\u00E9 sans les param\u00E8tres : {0} -attribute_contains_attribute=un motif d'attribut ne doit pas contenir d'autre motif d'attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin attribute//attribute) -attribute_contains_element=un motif d'attribut ne doit pas contenir de motif d'\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin attribute//ref) -data_except_contains_attribute=un motif de donn\u00E9e ne doit pas exclure de motif d'attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//attribute) -data_except_contains_element=un motif de donn\u00E9e ne doit pas exclure de motif d'\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//ref) +attribute_contains_attribute=un motif d''attribut ne doit pas contenir d''autre motif d''attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin attribute//attribute) +attribute_contains_element=un motif d''attribut ne doit pas contenir de motif d''\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin attribute//ref) +data_except_contains_attribute=un motif de donn\u00E9e ne doit pas exclure de motif d''attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//attribute) +data_except_contains_element=un motif de donn\u00E9e ne doit pas exclure de motif d''\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//ref) data_except_contains_empty=un motif de donn\u00E9e ne doit pas exclure de motif vide (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//empty) data_except_contains_group=un motif de donn\u00E9e ne doit pas exclure un groupe (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//group) data_except_contains_interleave=un motif de donn\u00E9e ne doit pas exclure un groupe entrelac\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//interleave) data_except_contains_list=un motif de donn\u00E9e ne doit pas exclure un motif de liste (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//list) data_except_contains_one_or_more=un motif de donn\u00E9e ne doit pas exclure une r\u00E9p\u00E9tition (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//oneOrMore) data_except_contains_text=un motif de donn\u00E9e ne doit pas exclure un motif de texte (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin data/except//text) -list_contains_attribute=un motif de liste ne doit pas contenir un motif d'attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//attribute) -list_contains_element=un motif de liste ne doit pas contenir un motif d'\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//ref) +list_contains_attribute=un motif de liste ne doit pas contenir un motif d''attribut (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//attribute) +list_contains_element=un motif de liste ne doit pas contenir un motif d''\u00E9l\u00E9ment (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//ref) list_contains_list=un motif de liste ne doit pas contenir un autre motif de liste (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//list) list_contains_text=un motif de liste ne doit pas contenir un motif de texte (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//text) list_contains_interleave=un motif de liste ne doit pas contenir un motif entrelac\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin list//interleave) -one_or_more_contains_group_contains_attribute=un groupe d'attributs ne doit pas \u00EAtre pouvoir \u00EAtre r\u00E9p\u00E9t\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin oneOrMore//group//attribute) -one_or_more_contains_interleave_contains_attribute=un groupe d'attributs entrelac\u00E9s ne doit pas \u00EAtre pouvoir \u00EAtre r\u00E9p\u00E9t\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin oneOrMore//interleave//attribute) +one_or_more_contains_group_contains_attribute=un groupe d''attributs ne doit pas \u00EAtre pouvoir \u00EAtre r\u00E9p\u00E9t\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin oneOrMore//group//attribute) +one_or_more_contains_interleave_contains_attribute=un groupe d''attributs entrelac\u00E9s ne doit pas \u00EAtre pouvoir \u00EAtre r\u00E9p\u00E9t\u00E9 (la section 7.1 de la sp\u00E9cification RELAX NG requiert que la forme XML simplifi\u00E9e du sch\u00E9ma ne contienne aucun \u00E9l\u00E9ment satisfaisant le chemin oneOrMore//interleave//attribute) start_contains_attribute=un \u00E9l\u00E9ment satisfaisant le chemin non-autoris\u00E9 start//attribute a \u00E9t\u00E9 trouv\u00E9 dans la forme XML simplifi\u00E9e du sch\u00E9ma (voir la section 7.1 de la sp\u00E9cification RELAX NG) start_contains_data=un \u00E9l\u00E9ment satisfaisant le chemin non-autoris\u00E9 start//data a \u00E9t\u00E9 trouv\u00E9 dans la forme XML simplifi\u00E9e du sch\u00E9ma (voir la section 7.1 de la sp\u00E9cification RELAX NG) start_contains_empty=un \u00E9l\u00E9ment satisfaisant le chemin non-autoris\u00E9 start//empty a \u00E9t\u00E9 trouv\u00E9 dans la forme XML simplifi\u00E9e du sch\u00E9ma (voir la section 7.1 de la sp\u00E9cification RELAX NG) @@ -67,51 +67,51 @@ start_contains_value=un \u00E9l\u00E9ment satisfaisant le chemin non-autoris\u00E9 start//value a \u00E9t\u00E9 trouv\u00E9 dans la forme XML simplifi\u00E9e du sch\u00E9ma (voir la section 7.1 de la sp\u00E9cification RELAX NG) duplicate_attribute=attribut en double duplicate_attribute_name=attribut {0} en double -duplicate_attribute_ns=attributs de l'espace de noms \"{0}\" peut appara\u00EEtre plus d'une fois -interleave_element_overlap=noms d'\u00E9l\u00E9ments surcharg\u00E9s dans les op\u00E9randes de \"interleave\" -interleave_element_overlap_name=l'\u00E9l\u00E9ment {0} peut se trouver dans plus d'une op\u00E9rande de \"interleave\" -interleave_element_overlap_ns=des \u00E9l\u00E9ments dans le namespace \"{0}\" peuvent se trouver dans plus d'une op\u00E9rande de \"interleave\" +duplicate_attribute_ns=attributs de l''espace de noms \"{0}\" peut appara\u00EEtre plus d''une fois +interleave_element_overlap=noms d''\u00E9l\u00E9ments surcharg\u00E9s dans les op\u00E9randes de \"interleave\" +interleave_element_overlap_name=l''\u00E9l\u00E9ment {0} peut se trouver dans plus d''une op\u00E9rande de \"interleave\" +interleave_element_overlap_ns=des \u00E9l\u00E9ments dans le namespace \"{0}\" peuvent se trouver dans plus d''une op\u00E9rande de \"interleave\" interleave_text_overlap=les deux op\u00E9randes de \"interleave\" contiennent \"text\" open_name_class_not_repeated=un attribut utilisant \"nsName\" ou \"anyName\" doit \u00EAtre dans \"oneOrMore\" xmlns_uri_attribute=un attribut ne doit pas avoir pour namespace \"http://www.w3.org/2000/xmlns\" xmlns_attribute=un attribut ne doit pas \u00EAtre nomm\u00E9 \"xmlns\" # Validation errors -unknown_element=l'\u00E9l\u00E9ment {0} n'est autoris\u00E9 nulle part {1} -unexpected_element_required_element_missing=l'\u00E9l\u00E9ment {0} n'est pas encore autoris\u00E9\u00A0; il manque l'\u00E9l\u00E9ment {1} -unexpected_element_required_elements_missing=l'\u00E9l\u00E9ment {0} n'est pas encore autoris\u00E9\u00A0; il manque les \u00E9l\u00E9ments {1} -element_not_allowed_yet=l'\u00E9l\u00E9ment {0} n'est pas encore autoris\u00E9 {1} -out_of_context_element=l'\u00E9l\u00E9ment {0} n'est pas autoris\u00E9 ici {1} -no_attributes_allowed=l'attribut {0} a \u00E9t\u00E9 trouv\u00E9, mais aucun attribut n'est autoris\u00E9 ici -invalid_attribute_name=l'attribut {0} n'est pas autoris\u00E9 ici {1} -invalid_attribute_value=la valeur de l'attribut {0} n'est pas valide {1} -required_attributes_missing_expected=il manque un ou plusieurs attributs obligatoires {1} \u00E0 l'\u00E9l\u00E9ment {0} -required_attribute_missing=il manque l'attribut obligatoire {1} \u00E0 l'\u00E9l\u00E9ment {0} -required_attributes_missing=il manque les attributs obligatoires {1} \u00E0 l'\u00E9l\u00E9ment {0} -incomplete_element_required_elements_missing_expected=l'\u00E9l\u00E9ment {0} est incomplet {1} -incomplete_element_required_element_missing=l'\u00E9l\u00E9ment {0} est incomplet\u00A0; il manque l'\u00E9l\u00E9ment obligatoire {1} -incomplete_element_required_elements_missing=l'\u00E9l\u00E9ment {0} est incomplet\u00A0; il manque les \u00E9l\u00E9ments obligatoires {1} -text_not_allowed=aucun texte n'est autoris\u00E9 ici {0} -document_incomplete=le document n'est pas enti\u00E8rement satisfait -invalid_element_value=l'\u00E9l\u00E9ment {0} contient des caract\u00E8res non valides {1} -blank_not_allowed=l'\u00E9l\u00E9ment {0} ne doit pas avoir un contenu vide {1} -schema_allows_nothing=le sch\u00E9ma n'autorise aucun contenu\u00A0: il est \u00E9quivalent \u00E0 +unknown_element=l''\u00E9l\u00E9ment {0} n''est autoris\u00E9 nulle part {1} +unexpected_element_required_element_missing=l''\u00E9l\u00E9ment {0} n''est pas encore autoris\u00E9\u00A0; il manque l''\u00E9l\u00E9ment {1} +unexpected_element_required_elements_missing=l''\u00E9l\u00E9ment {0} n''est pas encore autoris\u00E9\u00A0; il manque les \u00E9l\u00E9ments {1} +element_not_allowed_yet=l''\u00E9l\u00E9ment {0} n''est pas encore autoris\u00E9 {1} +out_of_context_element=l''\u00E9l\u00E9ment {0} n''est pas autoris\u00E9 ici {1} +no_attributes_allowed=l''attribut {0} a \u00E9t\u00E9 trouv\u00E9, mais aucun attribut n''est autoris\u00E9 ici +invalid_attribute_name=l''attribut {0} n''est pas autoris\u00E9 ici {1} +invalid_attribute_value=la valeur de l''attribut {0} n''est pas valide {1} +required_attributes_missing_expected=il manque un ou plusieurs attributs obligatoires {1} \u00E0 l''\u00E9l\u00E9ment {0} +required_attribute_missing=il manque l''attribut obligatoire {1} \u00E0 l''\u00E9l\u00E9ment {0} +required_attributes_missing=il manque les attributs obligatoires {1} \u00E0 l''\u00E9l\u00E9ment {0} +incomplete_element_required_elements_missing_expected=l''\u00E9l\u00E9ment {0} est incomplet {1} +incomplete_element_required_element_missing=l''\u00E9l\u00E9ment {0} est incomplet\u00A0; il manque l''\u00E9l\u00E9ment obligatoire {1} +incomplete_element_required_elements_missing=l''\u00E9l\u00E9ment {0} est incomplet\u00A0; il manque les \u00E9l\u00E9ments obligatoires {1} +text_not_allowed=aucun texte n''est autoris\u00E9 ici {0} +document_incomplete=le document n''est pas enti\u00E8rement satisfait +invalid_element_value=l''\u00E9l\u00E9ment {0} contient des caract\u00E8res non valides {1} +blank_not_allowed=l''\u00E9l\u00E9ment {0} ne doit pas avoir un contenu vide {1} +schema_allows_nothing=le sch\u00E9ma n''autorise aucun contenu\u00A0: il est \u00E9quivalent \u00E0 # ID correctness errors -id_element_name_class=un motif \"element\" contenant un motif \"attribut\" avec un type d'identificateur non nul doit avoir une classe de nom contenant seulement des \u00E9l\u00E9ments \"choice\" et \"name\" -id_attribute_name_class=un motif \"attribut\" avec un type d'identificateur non nul doit avoir une classe de nom \u00E9tant un nom unique -id_parent=un motif \"data\" ou \"value\" avec un type d'identificateur non nul doit avoir pour parent un motif \"attribute\" -id_type_conflict=types d'identificateurs conflictuels pour l'attribut {1} de l'\u00E9l\u00E9ment {0} +id_element_name_class=un motif \"element\" contenant un motif \"attribut\" avec un type d''identificateur non nul doit avoir une classe de nom contenant seulement des \u00E9l\u00E9ments \"choice\" et \"name\" +id_attribute_name_class=un motif \"attribut\" avec un type d''identificateur non nul doit avoir une classe de nom \u00E9tant un nom unique +id_parent=un motif \"data\" ou \"value\" avec un type d''identificateur non nul doit avoir pour parent un motif \"attribute\" +id_type_conflict=types d''identificateurs conflictuels pour l''attribut {1} de l''\u00E9l\u00E9ment {0} # ID soundness errors -id_no_tokens=valeur d'un attribut de type ID ne contenant aucun token -id_multiple_tokens=valeur d'un attribut de type ID contenant plusieurs tokens -idref_no_tokens=valeur d'un attribut de type IDREF ne contenant aucun token -idref_multiple_tokens=valeur d'un attribut de type ID ne contenant plusieurs tokens -idrefs_no_tokens=valeur d'un attribut de type IDREFS ne contenant aucun token -missing_id=aucun ID correspondant \u00E0 l'IDREF \"{0}\" -duplicate_id=l'ID \"{0}\" a d\u00E9j\u00E0 \u00E9t\u00E9 d\u00E9fini -first_id=premi\u00E8re occurence de l'ID \"{0}\" +id_no_tokens=valeur d''un attribut de type ID ne contenant aucun token +id_multiple_tokens=valeur d''un attribut de type ID contenant plusieurs tokens +idref_no_tokens=valeur d''un attribut de type IDREF ne contenant aucun token +idref_multiple_tokens=valeur d''un attribut de type ID ne contenant plusieurs tokens +idrefs_no_tokens=valeur d''un attribut de type IDREFS ne contenant aucun token +missing_id=aucun ID correspondant \u00E0 l''IDREF \"{0}\" +duplicate_id=l''ID \"{0}\" a d\u00E9j\u00E0 \u00E9t\u00E9 d\u00E9fini +first_id=premi\u00E8re occurence de l''ID \"{0}\" # Fragments name_absent_namespace=\"{0}\" @@ -128,13 +128,13 @@ and_list_many_last={0} et {1} expected=; {0} est attendu -element_end_tag=la balise fermante de l'\u00E9l\u00E9ment +element_end_tag=la balise fermante de l''\u00E9l\u00E9ment text=du texte data=des donn\u00E9es -element_list=l'\u00E9l\u00E9ment {0} +element_list=l''\u00E9l\u00E9ment {0} element_other_ns=un \u00E9l\u00E9ment dans un autre namespace -expected_attribute=; l'attribut {0} est attendu -expected_attribute_or_other_ns=; l'attribut {0} ou un attrribut dans un autre namespace est attendu +expected_attribute=; l''attribut {0} est attendu +expected_attribute_or_other_ns=; l''attribut {0} ou un attrribut dans un autre namespace est attendu data_failures=; {0} token_failures=; token {0} non valide\u00A0; {1} missing_token=; token manquant\u00A0; {0} diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/relaxng/pattern/resources/Messages_ja.properties 2018-11-26 10:49:29.000000000 +0000 @@ -5,39 +5,39 @@ # 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} +illegal_href_attribute=\u4E0D\u6B63\u306A \"href\" \u5C5E\u6027 +ns_attribute_ignored=\"ns\" \u5C5E\u6027\u306F\u7121\u8996\u3055\u308C\u307E\u3059 +reference_to_undefined=\u672A\u5B9A\u7FA9\u306E\u30D1\u30BF\u30FC\u30F3 \"{0}\" \u3078\u306E\u53C2\u7167 +missing_start_element=\"start\" \u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +recursive_reference=\u30D1\u30BF\u30FC\u30F3 \"{0}\" \u3078\u306E\u9593\u9055\u3063\u305F\u518D\u5E30\u7684\u53C2\u7167\u304C\u3042\u308A\u307E\u3059 +recursive_include=URL \"{0}\"\u304C\u518D\u5E30\u7684\u306B\u30A4\u30F3\u30AF\u30EB\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u3059 +duplicate_define=\"combine\" \u5C5E\u6027\u306A\u3057\u306E \"{0}\" \u304C\u8907\u6570\u56DE\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 +duplicate_start=\u00A0\"combine\" \u5C5E\u6027\u306A\u3057\u3067 start \u304C\u8907\u6570\u56DE\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u3059 +conflict_combine_define=\"{0}\"\u306E\u5B9A\u7FA9\u306B\u5BFE\u3059\u308B \"combine\" \u5C5E\u6027\u306E\u5024\u304C\u885D\u7A81\u3057\u3066\u3044\u307E\u3059 +conflict_combine_start=start\u306E\u5B9A\u7FA9\u306B\u5BFE\u3059\u308B \"combine\" \u5C5E\u6027\u306E\u5024\u304C\u885D\u7A81\u3057\u3066\u3044\u307E\u3059 +missing_start_replacement=\"include\" \u5185\u306E \"start\" \u304C\u4F55\u3082\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u305B\u3093 +missing_define_replacement=\"include\" \u5185\u306E \"{0}\" \u306E\u5B9A\u7FA9\u304C\u4F55\u3082\u4E0A\u66F8\u304D\u3057\u3066\u3044\u307E\u305B\u3093 +interleave_string=\"string\" \u307E\u305F\u306F \"data\" \u8981\u7D20\u306E\u30A4\u30F3\u30BF\u30FC\u30EA\u30FC\u30D6 +group_string= \"string\" \u307E\u305F\u306F \"data\" \u8981\u7D20\u306E\u30B0\u30EB\u30FC\u30D7 +one_or_more_string=\"string\" \u307E\u305F\u306F \"data\" \u8981\u7D20\u306E\u7E70\u308A\u8FD4\u3057 +unrecognized_datatype=\u30E9\u30A4\u30D6\u30E9\u30EA \"{0}\" \u306E\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 \"{1}\" \u304C\u8A8D\u8B58\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +unsupported_datatype_detail=\u30E9\u30A4\u30D6\u30E9\u30EA \"{0}\" \u306E\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 \"{1}\" \u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {2} +unrecognized_datatype_library=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u30E9\u30A4\u30D6\u30E9\u30EA \"{0}\" \u304C\u8A8D\u8B58\u3067\u304D\u307E\u305B\u3093 +unrecognized_builtin_datatype=\u305D\u306E\u3088\u3046\u306A\u30D3\u30EB\u30C8\u30A4\u30F3\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7 \"{0}\" \u306F\u3042\u308A\u307E\u305B\u3093: \"string\" \u304B \"token\" \u3092\u4F7F\u308F\u306A\u3051\u308C\u3070\u306A\u308A\u307E\u305B\u3093 +invalid_value=\"{0}\" \u306F\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u9069\u5207\u306A\u5024\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +parent_ref_outside_grammar=\u5B58\u5728\u3057\u306A\u3044\u89AA\u6587\u6CD5\u3078\u306E\u53C2\u7167 +ref_outside_grammar=\u5B58\u5728\u3057\u306A\u3044\u6587\u6CD5\u3078\u306E\u53C2\u7167 +expected_one_name_class=\u3053\u308C\u4EE5\u4E0A\u306E\u30B3\u30F3\u30C6\u30F3\u30C4\u306F\u5FC5\u8981\u306A\u3044\u3068\u3053\u308D\u3067 \"{0}\" \u8981\u7D20\u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F +builtin_param=\u30D3\u30EB\u30C8\u30A4\u30F3\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306F\u30D1\u30E9\u30E1\u30BF\u3092\u6301\u3063\u3066\u3044\u307E\u305B\u3093 +invalid_param_display=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF:\n{0} +invalid_param_detail_display=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF: {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} +invalid_param_detail=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF: {0} +invalid_param=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF +invalid_params_detail=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF: {0} +invalid_params=\u4E0D\u9069\u5207\u306A\u30D1\u30E9\u30E1\u30BF +datatype_requires_parameter=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306F\u30D1\u30E9\u30E1\u30BF\u306A\u3057\u306B\u4F7F\u3046\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +datatype_requires_parameter_detail=\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306F\u30D1\u30E9\u30E1\u30BF\u306A\u3057\u306B\u4F7F\u3046\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093: {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) @@ -65,16 +65,16 @@ 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=\u91CD\u8907\u3057\u305F\u5C5E\u6027 +duplicate_attribute_name=\u91CD\u8907\u3057\u305F\u5C5E\u6027 {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\" +interleave_text_overlap=\"interleave\" \u306E\u4E21\u65B9\u306E\u30AA\u30DA\u30E9\u30F3\u30C9\u304C \"text\" \u3092\u542B\u3093\u3067\u3044\u307E\u3059 +open_name_class_not_repeated=attribute using \"nsName\" or \"anyName\" must be in \"oneOrMore\"\n\"nsName\" \u3084 \"anyName\" \u3092\u4F7F\u3046\u5C5E\u6027\u306F \"oneOrMore\" \u5185\u306B\u306A\u3051\u308C\u3070\u3044\u3051\u307E\u305B\u3093 +xmlns_uri_attribute=\u5C5E\u6027\u306F\u540D\u524D\u7A7A\u9593URI \"http://www.w3.org/2000/xmlns\" \u3092\u6301\u3066\u307E\u305B\u3093 +xmlns_attribute=\u5C5E\u6027\u306E\u540D\u524D\u306B \"xmlns\" \u306F\u4F7F\u3048\u307E\u305B\u3093 # Validation errors unknown_element=\u8981\u7D20 {0} \u306F\u3069\u3053\u306B\u3082\u66F8\u3051\u307E\u305B\u3093. {1} @@ -101,7 +101,7 @@ 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_type_conflict=\u8981\u7D20 {0} \u306E\u5C5E\u6027 {1}\u00A0\u306EID-types\u304C\u30B3\u30F3\u30D5\u30EA\u30AF\u30C8\u3057\u3066\u3044\u307E\u3059 # ID soundness errors id_no_tokens=ID\u578B\u5C5E\u6027\u306E\u5024\u306B\u30C8\u30FC\u30AF\u30F3\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u305B\u3093. diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_de.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_de.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_de.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_de.properties 2018-11-26 10:49:29.000000000 +0000 @@ -6,6 +6,6 @@ extends_concrete=Kann die Regel \"{0}\" nicht erweitern, da sie nicht abstrakt ist. phase_missing=Das Schematron-Schema besitzt keine Phase \"{0}\" default_phase_missing=Das Schematron-Schema definiert keine Standard-Phase \"{0}\" -diagnostic_missing=Referenz auf 'diagnostic' \"{0}\" existiert nicht. +diagnostic_missing=Referenz auf ''diagnostic'' \"{0}\" existiert nicht. report= failed_assertion= diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_en.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_en.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_fr.properties epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_fr.properties --- epubcheck-4.0.2/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_fr.properties 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/com/thaiopensource/validate/schematron/resources/Messages_fr.properties 2018-11-26 10:49:29.000000000 +0000 @@ -1,11 +1,11 @@ -unexpected_schema_creation_error=la cr\u00E9ation de schema a \u00E9chou\u00E9 (merci d'envoyer un rapport de bug) +unexpected_schema_creation_error=la cr\u00E9ation de schema a \u00E9chou\u00E9 (merci d''envoyer un rapport de bug) # these messages are used in schematron.xsl -extends_cycle=la r\u00E8gle \"{0}\" ne peut pas \u00EAtre \u00E9tendue pour cause de cycle dans l'extension -active_missing=le motif \"{0}\" n'existe pas et ne peut pas \u00EAtre activ\u00E9 -extends_missing=la r\u00E8gle \"{0}\" n'existe pas et ne peut pas \u00EAtre \u00E9tendue -extends_concrete=la r\u00E8gle \"{0}\" n'est pas abstraite donc ne peut pas \u00EAtre \u00E9tendue +extends_cycle=la r\u00E8gle \"{0}\" ne peut pas \u00EAtre \u00E9tendue pour cause de cycle dans l''extension +active_missing=le motif \"{0}\" n''existe pas et ne peut pas \u00EAtre activ\u00E9 +extends_missing=la r\u00E8gle \"{0}\" n''existe pas et ne peut pas \u00EAtre \u00E9tendue +extends_concrete=la r\u00E8gle \"{0}\" n''est pas abstraite donc ne peut pas \u00EAtre \u00E9tendue phase_missing=le sch\u00E9ma ne d\u00E9finit pas la phase \"{0}\" default_phase_missing=le sch\u00E9ma ne d\u00E9finit pas sa phase par d\u00E9faut \"{0}\" -diagnostic_missing=r\u00E9f\u00E9rence au diagnostique \"{0}\" qui n'existe pas +diagnostic_missing=r\u00E9f\u00E9rence au diagnostique \"{0}\" qui n''existe pas report= failed_assertion= diff -Nru epubcheck-4.0.2/src/main/resources/org/idpf/epubcheck/util/css/messages_en.properties epubcheck-4.1.0/src/main/resources/org/idpf/epubcheck/util/css/messages_en.properties --- epubcheck-4.0.2/src/main/resources/org/idpf/epubcheck/util/css/messages_en.properties 1970-01-01 00:00:00.000000000 +0000 +++ epubcheck-4.1.0/src/main/resources/org/idpf/epubcheck/util/css/messages_en.properties 2018-11-26 10:49:29.000000000 +0000 @@ -0,0 +1 @@ +# This file must be kept empty, the default bundle contain the English messages. \ No newline at end of file diff -Nru epubcheck-4.0.2/src/tools/BookReporter.py epubcheck-4.1.0/src/tools/BookReporter.py --- epubcheck-4.0.2/src/tools/BookReporter.py 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/src/tools/BookReporter.py 2018-11-26 10:49:29.000000000 +0000 @@ -11,6 +11,7 @@ import zipfile import shutil import json +import functools import Dictionary import CompareResults @@ -93,7 +94,7 @@ md5 = hashlib.md5() block_size = 128*md5.block_size with open(fileName,'rb') as f: - for chunk in iter(lambda: f.read(block_size), b''): + for chunk in iter(functools.partial(f.read, block_size), b''): md5.update(chunk) return md5.hexdigest() @@ -862,4 +863,4 @@ # elapsedTime = time.time() - startTime if logging: logStats(statsLog, checkerVersion, targetDir, file, ePub, str(elapsedTime), str(checkTime), str(checkResults["publication"]["ePubVersion"]), str(oldPath), str(checkChanges), pubChanged, spineChanged, manifestChanged, str(messagesChanged), str(checkResults["checker"]["nFatal"]), str(checkResults["checker"]["nError"]), str(checkResults["publication"]["isScripted"]), str(checkResults["publication"]["hasFixedFormat"])) - os.remove(tmpOutputFile) \ No newline at end of file + os.remove(tmpOutputFile) diff -Nru epubcheck-4.0.2/.travis.yml epubcheck-4.1.0/.travis.yml --- epubcheck-4.0.2/.travis.yml 2016-11-29 13:08:40.000000000 +0000 +++ epubcheck-4.1.0/.travis.yml 2018-11-26 10:49:29.000000000 +0000 @@ -1,14 +1,17 @@ language: java jdk: + - openjdk11 + - oraclejdk11 + - openjdk10 + - oraclejdk9 - oraclejdk8 - - oraclejdk7 + - openjdk7 before_install: .travis/before_install.sh script: mvn verify after_success: .travis/after_success.sh branches: only: - master - - contrib/nook env: global: - secure: gcpUIktuajGHvn95bzMg9Nqay+kGAdKXWOosA6sQHvaK+KCsiP4nhAMX5rWUYvk3XnEs2WlfZUBO7/aDcpX4fjZozs8fHbVuSfftYP+4MIIhEI2FNEXp823EShSRB32cGmEkdUh7OQdv5zN8SEQNW9MJguLSvTkp2FGYEsV3x1g=