PROBLEM:
Currently epubcheck only outputs validation properties (warnings and errors),
but since most of the content is parsed many other important informatio could
be retrieved (epub version, usage of fonts, presence of audio or video files,
...).
Moreover, the output is given in System.out in a unstructured format not easily
reusable.
METHOD:
The attached patch is based on the addition of the following method to the
Report interface:
public void info(String resource, String feature, String value);
This way any checker can inform the report of any interesting feature it
discover.
In order to test the method, I add some features and add the -out argument to
the Checker class in order to output a XML file.
RESULT:
The call of
java -jar epubcheck.jar -out doc.xml moby-dick-20120118.epub
will output a doc.xml file with something like:
<?xml version="1.0" encoding="UTF-8"?>
<doc>
<!-- Inspired from documentMD (http://www.fcla.edu/dls/md/docmd.xsd) and containerMD (http://bibnum.bnf.fr/ns/containerMD-v1.xsd) -->
<document creationDateTime="2012-09-05T14:15:38+02:00">
<documentInformation>
<fileName>moby-dick-20120118.epub</fileName>
<identifier>code.google.com.epub-samples.moby-dick-basic</identifier>
<title>Moby-Dick</title>
<creator>Herman Melville</creator>
</documentInformation>
<formatDesignation>
<formatName>application/epub+zip</formatName>
<formatVersion>3.0</formatVersion>
</formatDesignation>
<assessmentInformation agentName="epubcheck" agentVersion="3.0b5">
<outcome>Valid</outcome>
</assessmentInformation>
<CharacterCount>1225947</CharacterCount>
<Language>en-US</Language>
</document>
</doc>
EXPECTED:
The requested enhancement will be to provide some features of the epub document
as well as XML output.
PLATFORM:
Any
ADDITIONAL INFO:
Original issue reported on code.google.com by tledou...@gmail.com on 5 Sep 2012 at 12:17
Original issue reported on code.google.com by
tledou...@gmail.com
on 5 Sep 2012 at 12:17Attachments: