Skip to content
Commits on Source (3)
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=
......
# EPUBCheck change log
<a name="4.1.0"></a>
## [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))
EpubCheck [![Release](https://img.shields.io/github/release/idpf/epubcheck.svg)](https://github.com/idpf/epubcheck/releases/latest)
=========
[![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/)
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.
EPUBCheck
=========
## Downloads
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.
Check the [releases page](https://github.com/IDPF/epubcheck/releases) to get the latest distribution.
EPUBCheck is open source software, maintained by the [DAISY Consortium](http://www.daisy.org) for the [W3C](https://www.w3.org/publishing/epubcheck_fundraising).
[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.
**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)!
## 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).
## Downloads
Technical discussions are hosted on the [EpubCheck Google Group](https://groups.google.com/forum/#!forum/epubcheck)
Check the [releases page](https://github.com/w3c/epubcheck/releases) to get the latest distribution.
[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.
## Credits
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/).
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):
<p float="left">
<a href="http://daisy.org"><img alt="DAISY" src="https://github.com/w3c/publishing/blob/master/donators_logos/daisy_high.jpg?raw=true" width="100" hspace="20" align="middle"/></a>
<a href="https://pubhub.dk"><img alt="Publizon A/S" src="https://github.com/w3c/publishing/blob/master/donators_logos/publizon-logo.jpg?raw=true" width="100" hspace="20" align="middle"/></a>
<a href="https://www.wiley.com"><img alt="Wiley" src="https://github.com/w3c/publishing/blob/master/donators_logos/Wiley_Wordmark_black.png?raw=true" width="200" hspace="20" align="middle"/></a>
<a href="https://www.hachette.com"><img alt="Hachette Livre" src="https://github.com/w3c/publishing/blob/master/donators_logos/Hachette%20Livre.jpg?raw=true" width="300" hspace="20" align="middle"/></a>
<a href="https://www.learningmate.com"><img alt="LearningMate Solutions Inc" src="https://github.com/w3c/publishing/blob/master/donators_logos/LearningMate%20Logo.png?raw=true" width="100" hspace="20" align="middle"/></a>
<a href="https://www.voyager.co.jp"><img alt="Voyager Japan, Inc." src="https://github.com/w3c/publishing/blob/master/donators_logos/rectangle_VJstar_logo_512.jpg?raw=true" width="100" hspace="20" align="middle"/></a>
<a href="https://wwnorton.com"><img alt="W. W. Norton" src="https://github.com/w3c/publishing/blob/master/donators_logos/NortonLogo_notagline.jpg?raw=true" width="100" hspace="20" align="middle"/></a>
<a href="https://luminadatamatics.com"><img alt="Lumina Datamatics, Inc." src="https://github.com/w3c/publishing/blob/master/donators_logos/Datamatics_logo.jpg?raw=true" width="100" hspace="20" align="middle"/></a>
</p>
## License
EPUBCheck is made available under the terms of the [New BSD License](http://opensource.org/licenses/BSD-3-Clause)
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 <eugene@debian.org> Tue, 27 Nov 2018 10:23:36 +0200
epubcheck (4.0.2-2) unstable; urgency=medium
* Update Saxon-HE version patch
......
......@@ -3,7 +3,7 @@ Section: text
Priority: optional
Maintainer: Debian XML/SGML Group <debian-xml-sgml-pkgs@lists.alioth.debian.org>
Uploaders: Eugene Zhukov <eugene@debian.org>
Build-Depends: debhelper (>= 9), cdbs,
Build-Depends: debhelper (>= 9),
default-jdk,
maven-debian-helper,
libcommons-compress-java,
......@@ -15,9 +15,9 @@ Build-Depends: debhelper (>= 9), cdbs,
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
......
......@@ -6,4 +6,5 @@ org.apache.maven.plugins maven-javadoc-plugin * * * *
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 * * * *
Description: pom.xml changes for Debian
* classpath fixed for Debian
Author: Eugene Zhukov <jevgeni.zh@gmail.com>
Last-Update: 2014-09-16
Description: Set classpath for Debian systems
--- a/pom.xml
+++ b/pom.xml
@@ -405,7 +405,8 @@
--- epubcheck-4.1.0.orig/pom.xml
+++ epubcheck-4.1.0/pom.xml
@@ -422,7 +422,6 @@
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
- <finalName>${project.artifactId}</finalName>
<archive>
<!--TODO Using the Manifest.MF file instead of the tag below is a work around for including two
libraries that are not in the Nexus. Currently they are checked into the lib directory.-->
@@ -431,7 +431,8 @@
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<mainClass>com.adobe.epubcheck.tool.Checker</mainClass>
<addClasspath>true</addClasspath>
......
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 @@
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
- <version>9.5.1-5</version>
+ <version>9.8.0-8</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -372,7 +372,7 @@
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
- <version>9.4</version>
+ <version>9.8.0-8</version>
</dependency>
</dependencies>
</plugin>
--- 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<? extends Item> 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<? extends Item> iterate() throws
+ public SequenceIterator iterate() throws
XPathException
{
return item.iterate();
fixed_classpath.patch
compatibility_with_saxon_9.8.patch
classpath.patch
#!/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
......@@ -11,14 +11,14 @@
<groupId>org.idpf</groupId>
<artifactId>epubcheck</artifactId>
<version>4.0.2</version>
<version>4.1.0</version>
<packaging>jar</packaging>
<name>EpubCheck :: Validation Tool for EPUB</name>
<description>EpubCheck is a tool to validate IDPF EPUB files. It can detect many types of errors in EPUB.
<name>EPUBCheck :: Validation Tool for EPUB</name>
<description>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.</description>
<url>http://code.google.com/p/epubcheck/</url>
<inceptionYear>2007</inceptionYear>
......@@ -129,10 +129,14 @@
</developers>
<mailingLists>
<mailingList>
<name>epubcheck discussion</name>
<subscribe>http://groups.google.com/group/epubcheck/subscribe</subscribe>
<unsubscribe>epubcheck+unsubscribe@googlegroups.com</unsubscribe>
<post>epubcheck@googlegroups.com</post>
<name>EPUBCheck discussion</name>
<subscribe>mailto:public-epubcheck-request@w3.org?subject=subscribe</subscribe>
<unsubscribe>mailto:public-epubcheck-request@w3.org?subject=unsubscribe</unsubscribe>
<post>public-epubcheck@w3.org</post>
<archive>https://lists.w3.org/Archives/Public/public-epubcheck/</archive>
</mailingList>
<mailingList>
<name>ARCHIVE: epubcheck discussion</name>
<archive>https://groups.google.com/forum/#!forum/epubcheck</archive>
</mailingList>
</mailingLists>
......@@ -140,7 +144,7 @@
<connection>scm:git:ssh://git@github.com:IDPF/epubcheck.git</connection>
<developerConnection>scm:git:ssh://git@github.com:IDPF/epubcheckgit</developerConnection>
<url>https://github.com/IDPF/epubcheck</url>
<tag>v4.0.2</tag>
<tag>v4.1.0</tag>
</scm>
<issueManagement>
<system>Github</system>
......@@ -148,23 +152,27 @@
</issueManagement>
<properties>
<java.version>1.6</java.version>
<java.version>1.7</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<tool.build.date>${maven.build.timestamp}</tool.build.date>
</properties>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<dependencies>
<dependency>
<groupId>net.sf.saxon</groupId>
<artifactId>Saxon-HE</artifactId>
<version>9.5.1-5</version>
<version>9.8.0-8</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.5</version>
<version>1.18</version>
<exclusions>
<exclusion>
<groupId>org.tukaani</groupId>
......@@ -197,7 +205,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>14.0.1</version>
<version>24.0-android</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
......@@ -249,7 +257,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.6</version>
<version>3.0.2</version>
<executions>
<execution>
<id>copy</id>
......@@ -268,7 +276,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<version>3.7.0</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
......@@ -277,7 +285,7 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.3.7</version>
<version>2.5.4</version>
<extensions>true</extensions>
<executions>
<execution>
......@@ -297,7 +305,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12.4</version>
<version>2.18.1</version>
<configuration>
<argLine>-Xmx1g -Duser.language=en</argLine>
<workingDirectory>${project.build.directory}/test-classes</workingDirectory>
......@@ -336,10 +344,23 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xml-maven-plugin</artifactId>
<version>1.0</version>
<version>1.0.1</version>
<executions>
<execution>
<goals>
......@@ -379,7 +400,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<version>1.3</version>
<version>1.14</version>
<executions>
<execution>
<id>thirdparty-licenses</id>
......@@ -399,7 +420,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<version>3.0.2</version>
<configuration>
<finalName>${project.artifactId}</finalName>
<archive>
......@@ -433,7 +454,7 @@
<!-- https://jira.codehaus.org/browse/SCM-738 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<version>2.5.3</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
......@@ -448,7 +469,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<version>3.1.0</version>
<executions>
<execution>
<id>dist-assembly</id>
......
#!/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 @@ if [ `which tx >/dev/null ; echo $?` -eq 1 ] ; then
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 @@ if [[ -z ${param1} || ${param1} == "--help" ]] ; then
# 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."
......
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:
To run the tool you need Java Runtime (1.6 or above). Any OS should do. Run
it from the command line:
> java -jar epubcheck.jar file.epub
java -jar epubcheck.jar file.epub
All detected errors are simply printed to the standard error stream.
All detected errors are simply printed to stderr.
Print the commandline help with the --help argument:
> 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
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.
AUTHORS / CONTRIBUTORS
----------------------
This distribution of EPUBCheck was made by the DAISY Consortium, for the W3C.
Previous contributors include:
- 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.
......@@ -10,6 +10,9 @@
<file>
<source>COPYING.txt</source>
</file>
<file>
<source>CHANGELOG.md</source>
</file>
<file>
<source>src/main/assembly/README-dist.txt</source>
<destName>README.txt</destName>
......
......@@ -28,6 +28,8 @@ import java.io.IOException;
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.OCFChecker;
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 @@ public class EpubCheck implements DocumentValidator
}
}
}
/**
* 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 @@ public class EpubCheck implements DocumentValidator
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 @@ public class EpubCheck implements DocumentValidator
.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 @@ public class EpubCheck implements DocumentValidator
return returnValue;
}
void checkExtension(String extension)
void checkExtension(OCFPackage ocf, String extension)
{
if (extension != null)
{
......@@ -257,7 +274,12 @@ public class EpubCheck implements DocumentValidator
}
else
{
report.message(MessageId.PKG_017, EPUBLocation.create(epubFile.getName(), extension));
List<String> 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 @@ public class EpubCheck implements DocumentValidator
{
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"));
}
}
}
......
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();
}
......@@ -7,22 +7,28 @@ import java.util.Set;
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<MessageId> allReportedMessageIds = new HashSet<MessageId>();
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 @@ public abstract class MasterReport implements Report
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
* <code>true</code>.
*
* @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 @@ public abstract class MasterReport implements Report
{
usageCount++;
}
else if (severity.equals(Severity.INFO))
{
infoCount++;
}
this.message(message, location, args);
}
reportMessageId(id);
......@@ -138,6 +191,18 @@ public abstract class MasterReport implements Report
return fatalErrorCount;
}
@Override
public int getInfoCount()
{
return infoCount;
}
@Override
public int getUsageCount()
{
return usageCount;
}
@Override
public void close()
{
......
......@@ -10,7 +10,7 @@ public final class QuietReport extends MasterReport
private QuietReport()
{
super();
super(false);
}
@Override
......
......@@ -70,6 +70,10 @@ public interface Report
public int getFatalErrorCount();
public int getInfoCount();
public int getUsageCount();
/**
* Called to create a report after the checks have been made
*/
......
......@@ -166,16 +166,16 @@ public class CSSChecker implements ContentChecker
{
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);
}
}
......