View Full Version : ePub validation problems


robcub
10-08-2010, 05:40 AM
Hi,

This is an ePub that I'd created in InDesign CS4.

I'm trying to upload it to http://bookworm.oreilly.com/ but I'm getting validation issues:

1. The complete error message is: Could not find file OEBPS/Note%20from%20the%20Editor.xhtml in archive even though it was listed in the OPF file

The file is there!

2. epubcheck agrees that this is not a valid ePub file, so you should check with the publisher or content creator. It returned 1 error(s): temp.epub/META-INF/encryption.xml(1): attribute "compression" from namespace "http://ns.adobe.com/digitaleditions/enc" not allowed at this point; ignored

This is my encryption.xml:

<encryption xmlns="urn:oasis:names:tc:opendocument:xmlns:container" xmlns:enc="http://www.w3.org/2001/04/xmlenc#" xmlns:deenc="http://ns.adobe.com/digitaleditions/enc"><enc:EncryptedData deenc:compression="none"><enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/><enc:CipherData><enc:CipherReference URI="OEBPS/Fonts/Times%20New%20Roman.ttf"/></enc:CipherData></enc:EncryptedData></encryption>

This is my second attempt at making an ePub. I would really appreciate some help with the code.

charleski
10-08-2010, 09:06 AM
1) Does the filename include the %20s instead of spaces? It's probably easiest just to convert spaces in the filename to underscores (in both the name in the archive and the name in the manifest).

2) epubcheck doesn't support any form of encryption. When you embedded Times New Roman InDesign automatically obfuscated it and generated an encryption file. This font will only work on ADE readers, and iBooks doesn't support any form of font embedding (I see you mention sending it to Apple devices in your other post). You also probably don't have a licence to distribute Times New Roman anyway, so it's probably best not to embed it - re-export the epub from InDesign and leave the font-embedding checkbox blank.

If you need to embed a font in an epub it's simplest to use one of the free fonts from SIL, Gnu, or other foundries, which can be embedded without the need for any obfuscation.

robcub
10-08-2010, 03:18 PM
charleski, thank you very much! I went all through the InDesign documents and removed the spaces, replacing them with underscores. And then it had a problem with using inverted commas in titles although it hadn't flagged that up previously! So I got rid of the inverted commas, exported without fonts embedded, and it worked!!!!! :)

Good to see my first ePub in an iPhone.

One thing though, internal and external links in ePubs don't seem to work in the iPhone, although they worked in ADE. Is this usually the case? (Maybe a question for another thread)

troymc
10-08-2010, 03:28 PM
I would also suggest that unless you have a very specific reason you should not embed the font. This will allow your readers to change the font using the capability of their ereaders.

Some specific reasons to embed:

You need specific characters only available in that font.
Stylistic reasons - Titles, quotes, etc.


Times New Roman is such a generic font that it should probably never be embedded. An exception would be if you're using some of the specific unicode ranges in it that are not available in others (eg. arabic or hebrew). TNR is a pretty comprehensive unicode font.


Troy

troymc
10-08-2010, 03:30 PM
Wooops! Too late! :p

Glad to hear you got it working.


Troy

robcub
10-08-2010, 07:25 PM
Haha! Thanks.

I don't know why I had that embed font checkbox checked as it wasn't even embedding the fonts I was using anyway - I was using Zapf Calligraphic and DIN! So, I agree, not much point in embedding fonts in an ePub generally.

Brianigoe
01-27-2011, 08:03 AM
I have problems, not solutions, and I'm so dense I don't know where to post them. New to epub, I find I have dozens of validation issues, at least half "attribute 'clear' is not declared for element 'br'". Can anyone tell me what that means and how to fix it, and also where I should be posting this?

DMSmillie
01-27-2011, 02:17 PM
Hi Brianigoe, and welcome to MobileRead forums. :)

The best thing would be to create a new thread in this (the EPUB) forum. I saw your other post in the Calibre forum:

I'm new to conversion and am trying to convert my books into Epub. Am using Calibre to do the job, thought I was doing fine as the result seemed legible to me, ran a Validation check using the facility in Sigil, and found a host of problems. May of them read "attribute 'clear' is not declared for element 'br'", some read "hspace" instead of "Clear", one reads "value 'Picture 2' is invalid NCName" and one "The <language> element is missing.". I have absolutely no idea what any of that means. Can anyone tell me if it's fixable, or should I give up and pay someone like Lulu to do it?

- and it looks like you have a range of problems with the HTML code in your EPUB file. The answer to "how to fix them" depends on what method you're using to create the EPUB file and to create the HTML code in the first place, and how much you understand about HTML code.

The error you refer to here:

"attribute 'clear' is not declared for element 'br'"

indicates that you've got one or more <br /> elements in your HTML code which contain the "clear" attribute, e.g.:

<br clear="all" />

However as far as I know, the "clear" attribute isn't valid for <br /> elements in XHTML Strict (it's valid for HTML 4.01, but EPUBs use XHTML 1.0 or XHTML 1.1).

Similarly, from your other post, you refer to a validation error referring to "hspace" - again, that's an HTML attribute which isn't valid in XHTML Strict.

I'm not entirely sure about the "Picture 2" reference - I'd need to see the exact error message, but I suspect it might be that you're using "Picture 2" as the value for an 'id' attribute - you can only use letters, numbers and the underscore character - no spaces.

Finally, the reference to "the <language> element is missing"... again, it's not clear without seeing the full error message exactly as it was displayed, but I suspect it might refer to the .opf file (an XML file that forms part of an EPUB book) - there should be a metadata element in that file defining the main language used in the book, and it could be that it's missing from your EPUB.

I know this doesn't help directly with the question of how to fix these errors, but hopefully it provides some useful background on what the errors mean. If you post more details about how you're creating the EPUB, and how much or little you know about (X)HTML and CSS, someone might be able to help advise on the best way to sort out these errors.

Toxaris
01-27-2011, 02:19 PM
A search or new thread would have been better, but the forum section is correct.

Your problem is quite easy. In xhtml you need closing tags. Since <br> has none, it is not valid. However, if you add ' /' to it, it will work. So, <br> will be <br />. This will be the case for all tags without closing tags, like <br>, <hr> and <img>.

Brianigoe
01-28-2011, 03:25 AM
Thank you VERY much. I'm gradually getting a better understanding of this system, and I am really grateful for your help which must take some time to give. I started using a text originally generated in WORD and saving it in varying formats and converting from them, and I'm now cutting out all pictures, quotations, complex formats and so on and saving it as the most basic possible text, and adding the cosmetic stuff using Sigil after. That seems to work. Thanks again, Brian

Toxaris
01-28-2011, 08:30 AM
If you use styles in Word, it makes your life simpler to recreate them in Sigil. Just export to filtered HTML and into Sigil.

Read the book from Liz Castro, it will help you get not only more info about epub in general, but also more about conversion via Word. It is aimed towards iBook, but the most is general usable.

Brianigoe
02-04-2011, 05:09 AM
Hi Brianigoe, and welcome to MobileRead forums. :)

The best thing would be to create a new thread in this (the EPUB) forum. I saw your other post in the Calibre forum:



- and it looks like you have a range of problems with the HTML code in your EPUB file. The answer to "how to fix them" depends on what method you're using to create the EPUB file and to create the HTML code in the first place, and how much you understand about HTML code.

The error you refer to here:



indicates that you've got one or more <br /> elements in your HTML code which contain the "clear" attribute, e.g.:

<br clear="all" />

However as far as I know, the "clear" attribute isn't valid for <br /> elements in XHTML Strict (it's valid for HTML 4.01, but EPUBs use XHTML 1.0 or XHTML 1.1).

Similarly, from your other post, you refer to a validation error referring to "hspace" - again, that's an HTML attribute which isn't valid in XHTML Strict.

I'm not entirely sure about the "Picture 2" reference - I'd need to see the exact error message, but I suspect it might be that you're using "Picture 2" as the value for an 'id' attribute - you can only use letters, numbers and the underscore character - no spaces.

Finally, the reference to "the <language> element is missing"... again, it's not clear without seeing the full error message exactly as it was displayed, but I suspect it might refer to the .opf file (an XML file that forms part of an EPUB book) - there should be a metadata element in that file defining the main language used in the book, and it could be that it's missing from your EPUB.

I know this doesn't help directly with the question of how to fix these errors, but hopefully it provides some useful background on what the errors mean. If you post more details about how you're creating the EPUB, and how much or little you know about (X)HTML and CSS, someone might be able to help advise on the best way to sort out these errors.
Thank you very much for that comprehensive response which must have taken you some time to write. Problem now solved and book published!

DMSmillie
02-04-2011, 06:04 AM
Excellent! You're very welcome, and thanks for reporting back, brianigoe. Congratulations on getting the book published! :)