ePub with Hype .oam upload error on Apple Books

Trying to upload an ePub created with InDesign that includes a Hype .oam to Apple Books and get the following error. Any suggestions?

1 asset was not validated successfully because it had problems:
KnowYourLimits-10.epub
ERROR ITMS-9000: KnowYourLimits-10.epub: Wrong namespace in KnowYourLimits-10.epub:/OEBPS/html/knowYourLimits2/knowYourLimits/Assets/index.html : null - expecting http://www.w3.org/1999/xhtml

Request ID: 9a6249d3-5e17-4476-844d-cda33413b451

I just responded to this exact question over email so I'm including my response here. Please let me know your results. In the other person's case, an OAM which had previously passed their validation is now showing errors, so it appears there's a change in Apple's validation.

This error indicates that they are receiving and parsing an html file, but it does not indicate that it is an xhtml file. Requiring this strict check on page content is one thing, but requiring the XHTML standard on interior .html / oam content (which is sandboxed / iframed) is new and strict. What it's looking for is an html file which has the property on the html part:

<html xmlns="http://www.w3.org/1999/xhtml">

I haven't seen this required by Epubs, since OAMs don't typically fall under that strict rule as long as they enumerate their images + content. To try to fool iBooks's validator into seeing this html file as an xhtml-complaint file, here's what to change:

Open the indicated .html documents and change the first two lines from

<!DOCTYPE html>
<html>

to this:

(UPDATE: PLEASE SEE RESPONSE BELOW) and don't use the below code :stop_sign:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">

To do this, you can either edit the content within the OAM files first, or once they are inside of the epub. If you want to edit the OAM directly, you'll rename them as .zip files, unzip them, and find the HTML files indicated in the error response. Next, edit them in a text editor like Whisk or Visual Studio Code. To get this all back together as an OAM you'll compress the folder you unzipped and change the name from .zip to .oam. You likely know this step but thought I would list it out in case you didn't.

Daniel, unfortunately the code update did not resolve the error. Here's the OAM file with the updated code applied to the Assets/index.html file. KnowYourLimits

PS: The email you're referencing was from my colleague.

When resubmitting you get the same error on the same HTML page even if it contains the two updated lines above?

Correct.

I wish I had a quick answer for this, but if their validator isn't correctly reading the headers in your .html file, then I think you should contact Apple support. Sharing with them the EPUB file which passed without validation errors may help them discover issues in the strictness of their validator.

1 Like

Will do. I'll report back. Thank you for your help.

1 Like

After so much back and forth with Apple's validator the following adjustment made it work. Apple's validator didn't like the additional code in your !DOCTYPE from your previous post.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">

Thank you for your help!

2 Likes

Thanks for sharing your solution!