I just tried to validate an epub (3) and received a notice that in file OEBPS/toc.ncx:

External identifiers must not appear in the document type declaration.

So I used oxygen to delete the line as recommended.

This created more problems:

FATAL OEBPS/toc.ncx 2 2 Fatal Error while parsing file: Content is not allowed in prolog. ERROR OEBPS/toc.ncx - - Error while parsing file: Content is not allowed in prolog.

How do I fix the External identifier issue?

  • What line was it that you deleted? Feb 24 '20 at 20:22

I finally got the epub file to pass validation with the idpf. I learned a lot about programs I have been using that were messing with me. It turns out that when I viewed an epub before uploading to smashwords, that calibre was without my knowledge adding files that would prevent acceptance. I had to totally delete the program to get it to stop. I had similar issues with sigil which was deleting something I needed. What really saved my bacon was a neat little app that allowed me to successfully delete the bad lines as shows above from Mr. Duggan. The app is called ecancrush. It unpacks the epub, allows one to edit using notepad, then it repacks it. In the future I will start doing it with oxygen. I still have one issue with the file, but that's for another question. In the end, I just got an email from smashwords saying that my latest novel was incluced in their premiun catalog.

  • You seem to be way more into epub than me, so I hope this isn't totally off, but I was surprised that you use an app to access the contents of the epub file. Are you aware that an epub file is just a zip file with another file extension? AFAIK you can just change the file extension to "zip" and then you can access the contents. After editing you can change the extension back to "epub". (I just tried it and it seems to work)
    – Wolff
    Feb 28 '20 at 17:30
  • Don't forget to mark acceptance of your answer, if you feel that it adequately answers your question (ideally, if someone else encounters this, they can follow the steps of your answer to solve it). Mar 4 '20 at 2:46

Not knowing which line you deleted, or what the recommendation was exactly, could it be that you have the issue mentioned here?

Make sure that you're only using the HTML5 doctype in your content documents:

<!DOCTYPE html>

If you've used an XHTML 1.1 doctype, it will contain an external reference to the DTD hosted on w3.org:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

Since external DTD references are no longer needed in HTML5, they were banned from EPUB 3.

Also, if you have an NCX file, make sure that there's no doctype declared in it. It's not necessary, and can also trigger the error.

  • Thanks so much for your answer. I tried to write what I deleted, but the site removed it. Yes, there is an NCX file with I think a doctype. Oh, well. I will try to figure it out when I'm sober. It's Lundi Gras. So, I am already celebrating for Mardi Gras tomorrow and my brain is operating at 50% or less. Happy Mardi Gras. Go Tigers.
    – Suzanne
    Feb 24 '20 at 23:29
  • Heh... pre-gaming before Lent? You may be able to post the line with the instruction with four spaces, or a greater-than symbol and a space, to quote it as code. Feb 25 '20 at 1:12
  • This is the warning I got.Type File Line Position Message ERROR OEBPS/toc.ncx 2 100 External identifiers must not appear in the document type declaration.
    – Suzanne
    Feb 25 '20 at 15:17
  • So you deleted the <!DOCTYPE line in the NCX file? What "more problems" did that create? Feb 25 '20 at 15:30
  • I also deleted the external link, thinking that was the external identifier that they wanted gone. I then got a bunch of parcing errors. Can't remember exatly.
    – Suzanne
    Feb 25 '20 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.