@writingboy: Do the following:
1) Open your book in the calibre editor. Run Tools->Beautify all files
2) Click the Check Book icon (the one with the bug symbol on it)
3) Click try to fix all errors automatically in the resulting report
4) Install the epubcheck plugin for the editor from
https://www.mobileread.com/forums/sh...d.php?t=282067 Plugins can be installed in the main calibre program via Preferences->Plugins->Get new plugins
5) Fix whatever remaining errors it reports. They will almost all be of the form
'attribute "XXX" not allowed here Just locate the file and line number in the error message and delete the attribute it mentions.
At the end of that you should have a book Apple will accept.