View Single Post
Old 03-04-2013, 08:13 PM   #415
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,636
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by user_none View Post
Kiwidude sent me the two files to look at. Here is what EPUBCheck Says:
  • element "metadata" incomplete; missing required element "dc:identifier"
  • unique-identifier attribute in package element must reference an existing identifier element id

So the Modify Plugin is stripping the dc:identifier which is means the OPF is now invalid. Sigil is detecting this and fixing the OPF. However, it does appear that Sigil's correction needs a bit of work since it should use the spine, manifest and any individual metadata elements when it creates the new (correct) OPF.
My thanks to John and Dave for taking the time to track this down, that date thing appears to be a red herring though there are multiple things going on here.

Firstly, Sigil does need to handle these ePubs better so as to not just silently generate a "random" (alphabetical) opf and muck up the book. The guys are working on that one which is brilliant.

Secondly it seems to be that with the combination of settings Barb B chose, the dc:identifier node is completely missing from the resulting ePub. I need to look into what caused that to happen.

Thirdly, the calibre save to disk logic (which is what update metadata calls) is producing an invalid identifier node. The original book goes from this:
Code:
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="PrimaryID" version="2.0">
...
<dc:identifier id="PrimaryID" opf:scheme="ISBN">978-0-440-42334-8</dc:identifier>
to this:
Code:
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="PrimaryID" version="2.0">
...
<dc:identifier opf:scheme="calibre">7f516111-8b74-4a4a-bf8c-79742d3bec9c</dc:identifier>
And if I understand correctly it is the dc:identifier node not having an id attribute to match the package declaration which is currently causing Sigil to throw a wobbly. This one I believe falls into Kovid's camp to comment on, as to why calibre does not preserve or generate the id attribute on that element...
kiwidude is offline   Reply With Quote