Compiling to epub fails validation in Sigil

Following AmberV’s advice, I am experimenting with compiling to epub format, then using Sigil to clean up the *.epub file. When I do so Sigil gives me the following error:

So far I have solved this by adding the “vnd.” to the media-type attribute, and the file then validates no problem.

Is this the best solution, or should I rather be be altering any of the media types to delete the “vnd.” and leaving the value declaration alone?

Changing the type in the OPF file is the right way to solve this. I’m checking into whether we should do this by default. It could be we were using an out of date spec that older validator’s let slide.

Update: Okay, yes indeed this has either changed in recent history, or the original documentation that was used to come up with this was incorrect. At any rate, the next release will apply the proper type in the OPF file, so fixing that by hand is only a temporary workaround.


In passing, I notice that Sigil is only geared to epub2, and epub3 is now out (or just about to be finalized). This means more changes, of course. I hope Sigil updates to epub3 with the next version.

That would be nice, but it’s probably a ways off. Whatever the case, readers will be supporting ePub 2 for a long time to come, so unless you need fancy layouts the current spec is just fine.

When I export Epub, the toc.ncx file is not being fully created. It looks like it truncates after a few chapter points are written. This fails at different points (for example creating the first four chapter markers, or first five, or six…). There is no error messages on this, and it will clear validation, but the epub cannot be opened on ibooks (transferring it to my ipad is fine, but it won’t open on the ipad). Cleaning up the file manually fixes this problem, but there is something wrong with the toc.ncx creation.

Could you please send us an example project showing this problem? I’ve never seen anything like that before.

I would suspect a Unicode control character slipped into one of the titles. I worked with someone a while back that had this problem in the OPF file, and it turned out they had a NULL in one of the meta-data fields. Retyping them out in the compile pane cleared it up. If the file halts output at a certain point each time, that should let you know which binder item has the bad character. You can just tap Esc to edit it in the binder, and retype it completely (you probably won’t be able to find the character and delete it by hand, selecting all of the text and retyping it is the best way to clear it).

That fixed it. I didn’t have anything in the description field of metadata. I added a description and everything works fine now. Note that page-template.xpgt is still being created but that needs to be manually deleted in order to pass ibooks validation. Is there a beta version with new functionality? I don’t mind compiling from SVN or GIT.

There is a beta version, but nothing specifically that pertains to this. That’s strange that a description cleared it up. That’s an optional field that shouldn’t impact the validity of the ePub.