Web-based ePub validator adds Preflight and API
by Liza Daly

Our web tool for using the open-source epubcheck validator got a quick refresh:
Now includes epubpreflight results
EpubCheck’s lesser-known companion checks for additional issues like content documents that exceed 300K, which can’t be loaded on the Sony Reader. The complete (short!) list:
- Content files that are empty or are >300k
- Image files that are empty or are >10MB
Simple API service
This has been part of Bookworm for some time but I’m finally documenting it: there’s also a machine-readable API for the validator. It’s very simple — you get back an XML document indicating whether the file was valid, and if invalid, the list of errors.
Just POST an epub file as a series of bytes to http://threepress.org/epubcheck-service/ and look at the response. Here’s a sample interaction using curl, but you could use your favorite HTTP client.
Successful validation
$ curl --data-binary @pg345.epub http://threepress.org/epubcheck-service/
<?xml version="1.0" encoding="utf-8" ?> <rsp stat="ok"> <is-valid>True</is-valid> </rsp>
Invalid ePub
$ curl --data-binary @invalid.epub http://threepress.org/epubcheck-service/
<?xml version="1.0" encoding="utf-8" ?>
<rsp stat="ok">
<is-valid>False</is-valid>
<errors>
<error>ERROR: temp.epub/metadata.opf(6): attribute "files-as" from namespace "http://www.idpf.org/2007/opf" not allowed at this point; ignored</error>
<error>ERROR: temp.epub/metadata.opf(9): unknown element "series_index" from namespace "http://www.idpf.org/2007/opf"</error>
</errors>
</rsp>
Comments
Thanks, Liza. A great tool just got better.
Every week, someone on the Net complains about how confusing it is to make an EPUB ebook. Using this tool, it’s not very difficult to fix your EPUBs, whether they are first made by InDesign, by less-expensive software programs, or by hand coding.
Michael Pastore
50 Benefits of Ebooks
I don’t actually believe epub is easy to create at all without a background in XML and HTML/CSS, and I wish it were simpler to do by hand. But that’s a post for later this month…
Liza, you are right about this. I spoke too quickly (I’m accustomed to my own blogs, where I can edit and update my words.) I should have said: EPUB-making is not easy, but your tool makes it easier to work with EPUB.
I *wish* that EPUB making was simpler: then more publishers would embrace it.
Michael Pastore
50 Benefits of Ebooks
[...] do the same thing even if you encounter errors running epubcheck locally, using the newly-available ePub validation API. Published: November 6, 2009 Filed Under: ebooks, tools Leave a Comment Name: [...]
[...] teleread.org & blog.threepress.org> Share and [...]