Why validate opf instead of epub?

8 posts / 0 new
Last post

If I'm supposed to be validating my epub, why do I validate the opf file instead of the epub file? That's what I understand from epubzone.org/news/epub-3-validation, and indeed, my opf file validates, while the epub does not. Thanks!

The short answer is that there is no good reason to do so.  Sometimes, one might want to do so as a sort of debugging step, but normally one only runs epubcheck against the EPUB itself and that implicitly checks the OPF as well as verifying the manifest against the contents of the EPUB container, etc.  Myself, I never check the components of my EPUBs separately - I don't find any need to do so.

BTW, I see that that article is pretty out of date.  Nothing really in error I can see, but we need to update it.

Ah so. Thanks much. Then it doesn't matter that my opf valiadated--I'm still hosed because my EPUB did not. Stink. Any suggestions on parsing unintelligible error messages? Perhaps there is more in that article that I didn't get to yet. Thanks again.

All the error messages I've ever seen working with epubcheck are only about HTML and CSS. As far as I'm able to tell, you simply need a working knowledge of those 2 development languages to understand the epubcheck error messages. Generally as things go, if you have a series of error messages that are all the same or similar to one another but in different files, then those are usually a copy error that has been copied into each file. A large series of similar error messages is usually easy to fix since those errors are closely related. A simple non-closing tag in HTML can create a series of errors. Other than that, something is usually not referencing another file properly or a file is missing from the opf.

But validating the entire epub at once has always been what I've done and I've never needed to do differently.

Can youi post the error messages and/or the EPUB itself?  I would be willing to take a look.

Thank you rkwright, that is really generous of you.

I am reasonably intelligent, with a working knowledge of html but have no training in this and tend to figure things out by trial & error & logic. Not working this time.

I'll post the errors--happy to post the epub if that makes a difference. The errors start with line 10. I've "viewed source" to see line 10 in the html. No clues there. I cleared all formatting in the word doc before saving as filtered web before converting to epub. No change in the validation errors. I have pages of errors, which are all on lines 10, 12, & 15. Am I incorrect by what "line 10" refers to?

Here's a sample:
Type File Line Position Message
ERROR NoTurningBack12_split_000.htm 10 66 Error while parsing file 'attribute "vlink" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.
ERROR NoTurningBack12_split_000.htm 10 66 Error while parsing file 'attribute "link" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.
ERROR NoTurningBack12_split_001.htm 10 66 Error while parsing file 'attribute "vlink" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.
ERROR NoTurningBack12_split_001.htm 10 66 Error while parsing file 'attribute "link" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.
ERROR NoTurningBack12_split_001.htm 12 76 Error while parsing file 'attribute "clear" not allowed here; expected attribute "class", "id", "style" or "title"'.
ERROR NoTurningBack12_split_002.htm 10 66 Error while parsing file 'attribute "vlink" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.
ERROR NoTurningBack12_split_002.htm 10 66 Error while parsing file 'attribute "link" not allowed here; expected attribute "class", "dir", "id", "lang", "style", "title" or "xml:lang"'.

Thanks again

I pasted it into notepad, then back into word, then html, then epub, which validated. So I have to add back all the formatting, hoping not to reintroduce the error.
Thanks

This program is fantastic for viewing, editing and managing an epub. This will really help out, I don't know what I would do without it:

https://calibre-ebook.com/download

Calibre has a "library" book manager (the main program) then it has an eBook viewer program and an eBook editor program. It allows you to open and view an epub all at once and helps you spot errors or missing files and the like. The eBook editor and viewer are really all you need.

As a side note you can always change the ".epub" file extension to ".zip" and unzip the files and you can access what is in the epub with a text editor all the same. This is good to know if you import files into your epub or need to move files around inside the epub. You can then zip the folder back up, change the ".zip" to ".epub" and you'll be right back to an eBook readable file. Just make sure that the zipping mechanism doesn't add in an extra folder on top of the root/main folder you started with or the epub won't open. As long as you zip the root folder then it can open up as an epub.

Secondary menu