06-19-2016, 02:44 PM | #1 |
Hmm.
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
ERROR in EPUB content.opf
I'm getting an error in my epub2 content.opf. It's a simple EPUB I'm using to test validation. Here's the error:
Code:
Error while parsing file 'element "metadata" incomplete; missing required elements "ns:identifier", "ns:language" and "ns:title" (with xmlns:ns="http://purl.org/dc/elements/1.1/")'. 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>My test title</dc:title> <dc:language>en</dc:language> <dc:identifier id="BookId" opf:scheme="ISBN">mytesttitle-20160601</dc:identifier> <dc:creator opf:role="aut">John Smith</dc:creator> <dc:creator opf:role="aut">Sally Jones</dc:creator> <dc:subject>test subject</dc:subject> <dc:subject>boats</dc:subject> <dc:subject>travel</dc:subject> <dc:date opf:event="modification">20160619</dc:date> </metadata> <manifest> <item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml" /> <item href="Text/ch1.xhtml" id="ch1.xhtml" media-type="application/xhtml+xml" /> <item href="Text/ch2.xhtml" id="ch2.xhtml" media-type="application/xhtml+xml" /> <item id="main-css" href="OEBPS/Style/note.css" media-type="text/css"/> </manifest> <spine toc="ncx"> <itemref idref="ch1.xhtml" /> <itemref idref="ch2.xhtml" /> </spine> <guide> <reference href="Text/ch1.xhtml" title="Cover" type="cover" /> </guide> </package> There's also another error in content.opf which is possibly related: Code:
The unique-identifier 'BookId' was not found. |
06-19-2016, 03:53 PM | #2 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Your signature indicates that you use Sigil. Open the ePUB with Sigil and save it. That should fix this. It seems allright. What is reporting the error?
|
Advert | |
|
06-20-2016, 01:21 AM | #3 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
It might be dropping the identifier because the contents aren't valid, i.e. "mytesttitle-20160601" is not an ISBN.
|
06-20-2016, 08:48 AM | #4 |
Hmm.
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
|
06-20-2016, 09:01 AM | #5 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Another possibility to check ... the unique-identifier in the OPF is also supposed to match one of the <meta> items in the NCX file e.g.
Code:
<meta content="your_unique_identifier_here" name="dtb:uid"/> |
Advert | |
|
06-20-2016, 09:19 AM | #6 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
@crankypants:
Your dc namespace attribute is missing the final slash: Code:
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
Code:
<dc:date opf:event="modification">20160619</dc:date> Code:
<dc:date opf:event="modification">2016-06-19</dc:date> |
06-21-2016, 07:34 AM | #7 |
Hmm.
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
That was it Doitsu! Thank you!
That's one of those weird things that is hard to see. |
06-23-2016, 01:22 AM | #8 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
Wow, that was subtle. Nice catch.
|
Tags |
content.opf, epub2 |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
2 content.opf, one throws error, other doesn't | mrmikel | ePub | 2 | 09-29-2014 04:47 PM |
Change opf filename from content.opf to title.opf | northstar7 | Sigil | 3 | 09-23-2013 12:44 PM |
epub check tells me "Version not found" in my content.opf | NASCARaddicted | ePub | 4 | 01-26-2013 08:10 AM |
ePub OPF file error | soulartist | ePub | 4 | 10-03-2011 05:09 PM |
Can I cut and paste the Calibre opf into the ePub opf? | wannabee | ePub | 0 | 07-12-2011 02:09 AM |