![]() |
#1 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
Errors while validating EPUB
I have a fun project where I'm making EPUBs for to see how it's made. I'm using the validator at http://validator.idpf.org/ and am getting some errors which I don't know how to handle.
ERROR 1. "Mimetype file entry is missing or is not the first file in the archive." The mimetype file is actually in the EPUB. Here's my EPUB listing from 7zip. Code:
Date Time Attr Size Compressed Name ------------------- ----- ------------ ------------ ------------------------ 2015-12-04 09:47:54 ....A 260 177 META-INF\container.xml 2015-12-04 09:24:16 ....A 20 20 mimetype 2015-12-04 09:47:54 ....A 1130 512 OEBPS\content.opf 2015-10-30 18:33:34 D.... 0 0 OEBPS\images 2015-10-30 18:33:34 D.... 0 0 OEBPS\styles 2015-12-04 09:32:10 ....A 943 522 OEBPS\styles\style01.css 2015-11-04 09:19:14 D.... 0 0 OEBPS\Text 2015-12-04 09:47:54 ....A 1381 777 OEBPS\Text\00cover.xhtml 2015-12-04 09:47:54 ....A 9334 3678 OEBPS\Text\31book.xhtml 2015-10-30 18:33:34 D.... 0 0 OEBPS\themes 2015-12-04 09:47:54 ....A 1675 611 OEBPS\toc.ncx ------------------- ----- ------------ ------------ ------------------------ 21449 7839 9 files, 4 folders I have several more errors in OEBPS/content.opf ERROR 2 on line 12 of content.opf: "Error while parsing file 'value of attribute "id" is invalid; must be an XML name without colons'." Here's my whole content.opf file: Code:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookId" version="2.0">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>Book of the Farm, 1844, Vol 2</dc:title>
<dc:creator opf:role="aut">Henry Stephens, FRSE</dc:creator>
<dc:language>en</dc:language>
<dc:date opf:event="modification">2015-12-04</dc:date>
<dc:identifier id="bookid" opf:scheme="ISBN">bookofthefarm-vol1-1847</dc:identifier> </metadata>
<manifest>
<item href="toc.ncx" id="ncx" media-type="application/x-dtbncx+xml" />
<item href="Text/00cover.xhtml" id="00cover.xhtml" media-type="application/xhtml+xml" /> # THIS IS LINE 12
<item href="Text/31book.xhtml" id="31book.xhtml" media-type="application/xhtml+xml" />
<item href="styles/style01.css" id="style01.css" media-type="text/css" />
</manifest>
<spine toc="ncx">
<itemref idref="00cover.xhtml" /> # LINE 18
<itemref idref="31book.xhtml" /> # ERROR ON LINE 19
</spine>
<guide>
<reference href="Text/00cover.xhtml" title="Cover" type="cover" />
</guide>
</package>
|
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,293
Karma: 78876004
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
The mimetype HAS to be the first file and HAS to be stored uncompressed.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
How are you zipping up the book?
You have to do mumb-jumbo with the info-zip command-line tools (the spell is documented in various places on the web), or alternatively use special tools designed specifically to pack up an EPUB (heavily advised). ![]() The other error is, I believe, because an id cannot start with a number. As you can tell, EpubCheck doesn't have good error messages. ![]() |
![]() |
![]() |
![]() |
#4 | ||
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
Quote:
Why would the creators of EPUB even ask for something bizarre like that? There should be a mimetype file in there, and the EPUB validator should find it regardless of what physical order it has in the zip/epub file. Can someone help me understand? Quote:
|
||
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Flightcrew is a free program, part of Sigil. Also try "BookId" with caps in the place. Dale |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Code:
<item href="Text/31book.xhtml" id="31book.xhtml" media-type="application/xhtml+xml" /> |
|
![]() |
![]() |
![]() |
#7 | |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,620
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
Quote:
If you have access to a command-line zip, the commands (with the unzipped ePub directory as current directory) zip -X0 <quoted form of ePubFilePath> mimetype zip -rDX9 <quoted form of ePubFilePath> * -x mimetype |
|
![]() |
![]() |
![]() |
#9 | |||
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
It is not enough to simply create a zipped folder with 7-Zip. ... Didn't you mention somewhere you were using perl? Why not use the perl module for creating EPUB automatically as part of the scripting? http://search.cpan.org/~oty/EBook-EPUB-0.6/ Quote:
Quote:
https://github.com/Sigil-Ebook/flightcrew Binary releases as a Sigil plugin are available, but you should also be able to build it as a standalone gui or cli tool. |
|||
![]() |
![]() |
![]() |
#10 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
It appears my root problem might be that 7-zip 15.16 cannot control compression, so the mimetype file gets compressed. Let me fix that first, I'm download info-zip right now and will try that.
|
![]() |
![]() |
![]() |
#11 |
Hmm.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
|
![]() |
![]() |
![]() |
#12 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
![]() |
![]() |
![]() |
#13 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
If ids that start with numbers are important to you, you'll have to generate an ePub3 book.
![]() (Since ePub3 (mostly) supports HTML5 files, you can use ids that start with a number in HTML5 files, but nowhere else.) |
![]() |
![]() |
![]() |
#14 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
![]() |
![]() |
![]() |
#15 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Another very simple tool to work with ePub files is Tweak EPUB described in our wiki. This is a free program that will allow taking a ePub apart to edit the pieces. It will allow you to view the resultant ePub from inside the tool to view any changes you make prior to rebuilding the file.
Dale |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Validating Epub | Thom* | Editor | 6 | 07-08-2015 04:17 AM |
validating epub fails - how do I correct? | BeccaPrice | ePub | 14 | 06-12-2013 02:01 PM |
Validating epub returns warning | writerkit | Conversion | 2 | 03-30-2013 02:35 AM |
Issues validating EPUB for iPad | godsmac | Calibre | 13 | 06-26-2011 09:02 PM |