View Full Version : epubcheck bugs?

06-12-2010, 08:52 AM
I've written a script that generates epubs from hand-coded html.

I keep getting the following error when validating with epubcheck:

ERROR: ./PrisonersBase.epub/content.opf: unique-identifier attribute in package element must reference an existing identifier element id

Here's the package line from the OPF file:

<package version="2.0" xmlns="" unique-identifier="BookID">

And here's the only identifier line:

<dc:identifier opf:scheme="Book" id="BookID">Book_00000031</dc:identifier>

And, if it's relevant, the related line from the NCX:

<meta name="dtb:uid" content="Book_00000031" />

What am I doing wrong?

I've tried making everything lower case, removing the opf:scheme line, retyping the text and saving... Hair is being plucked in fistfuls.


06-12-2010, 09:53 AM
Is the <dc:identifier> inside a <metadata> block? Can we see the full OPF file?

06-13-2010, 07:38 AM
I figured it out -- I think. At least they're validating now.

I'm working in a Windows virtual machine, and the text editor was producing CP1252 encoding. I had to find a utility (iconv for Windows) to convert all the files after they were created, but before they were zipped into an ePub.

There were also issues with capitalization. Also found and fixed.

Yup, the <dc:identifier> was inside a <metadata> block.

I spent most of the day on this, but now I've got a script that parses the xhtml, and produces a nicely formatted ePub, including TOC. The only thing left to do is program it to split the files at chapter-breaks. (Not req'd by the spec, but apparently it's necessary for current hardware limitations.)

Thanks for helping,