ERROR: [top level]: OPF file OEBPS/content.opf is missing

7 posts / 0 new
Last post

Hello,

Epub check has given me the error for epub file ERROR: [top level]: OPF file OEBPS/content.opf is missing.

I have checked several times to make sure that OEBPS folder has the file content.opf , still it is giving the same error.

and also I have checked the META-INF/container.xml file which is pointing correctly the opf file

<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OEBPS/content.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>

and one surprising thing that when I checked samplebook.zip , with the epub check there are no errors, when I renamed the file to samlebook.epub and then epub check is giving the error OPF file OEBPS/content.opf is missing.

Please help me

vishwa

That error occurs if epubcheck calls ZipFile.getEntry on the supplied relative path and a true response is not returned. I've never actually seen it occur before myself, so I can't give you any definitive advice on what's gone wrong.

It's also kind of hard to debug without seeing the file, but the first thing I'd do is remove the packaging as a potential problem. See if letting epubcheck zip the content up solves the problem:

java -jar epubcheck-3.0b5.jar /path/to/unzipped/files -mode exp -save

If it works, at least you can begin to narrow down what the underlying issue is, whether it was the program that zipped the content or whether there is something that epubcheck needs to handle better.

Hope this helps.

Hello,

epubcheck-3.0.1 is giving me the same version not found error along with an exception error:

EXCEPTION: my.epub/OEBPS/package.opf: The value following "encoding" in the XML declaration must be a quoted string.
ERROR: my.epub/OEBPS/package.opf: Version not found

_____

Here is my META-INF/container.xml code:

<?xml version="1.0" encoding="utf-8"?>

<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="OEBPS/package.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>

I've tried renaming the OPF to content.opf, along with the filename in the container.xml, but the same errors.

I am using the MAC terminal to zip in 2 steps:
1. zip -0Xq my.epub mimetype
2. zip -Xr9Dq my.epub * -x *.DS_Store

Could the terminal zip path cause problems?

Please help.

Wendy

The error is coming from the package file, not the container.xml file.

Open package.opf and you'll find your xml declaration looks like this:

<?xml version="1.0" encoding=utf-8?>

Add quotes to the value and it should fix both errors:

<?xml version="1.0" encoding="utf-8"?>

 

Hi there, I wish this fixed it. Here is the declaration from the package.opf file (it has the quotes):

<?xml version="1.0" encoding=“utf-8”?>

I've been looking at this package.opf all day, trying to see what could possibly be wrong...

Wendy

Look at the quotes around utf-8 again... those are stylized quotes. Those aren't legal quote characters in XML.

Fix them to straight quotes and I guarantee you it will work... :)

You are the best! Thank you kindly.

Secondary menu