ePub 2.0.1 export creates invalid ePub files
InDesign creates incorrect ePub in latest version (19.5) when exporting reflowable ePub 2.0.1.
This is the result of any ePub generated with InDesign from the Draft2Digital Epub validator:
- ERROR(RSC-005): /OEBPS/content.opf(2,105): Error while parsing file: attribute "xml:lang" not allowed here; expected attribute "id"
The "xml-lang=" attribute should not be removed from the "package" tag, as it is not in the ePub 2.0.1 standard.
- ERROR(RSC-005): /OEBPS/cover.xhtml(8,38): Error while parsing file: element "figure" not allowed anywhere; expected element "address", "blockquote", "del", "div", "dl", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins", "noscript", "ns:svg", "ol", "p", "pre", "script", "table" or "ul" (with xmlns:ns="http://www.w3.org/2000/svg")
In previous versions of InDesign this was a "<div>". "<figure" is not part of the ePub 2.0.1. standard. This should be reverted to a "<div>"
- ERROR(RSC-005): /OEBPS/cover.xhtml(9,110): Error while parsing file: attribute "role" not allowed here; expected attribute "class", "dir", "height", "id", "ismap", "lang", "longdesc", "title", "usemap", "width" or "xml:lang"
In previous versions of InDesign the "role=" tag was not present. It is also not part of the ePub 2.0.1. standard, so it should be removed.
These bugs prevent upload of ePubs to all major platforms (CB in The Netherlands, Draft2Digital, IngramSpark, etc).
-
Arjen Broeze commented
I made an error in my original post. The "xml-lang=" attribute should not be *present* in the "package" tag
The errors can be fixed by opening the exported ePub file in Sigil and manually correcting the following:
1. cover.xhtml - change <figure style="..."> to <div style="..."> and </figure> to </div>
2. cover.xhtml - remove the "role=..." attribute from the <img ...> tag
3. content.opf - remove the "xml-lang="..." attribute from the <package ...> tag -
Lebanon Raingam commented
September 09, 2024, I still have this problem "ERROR(RSC-005): /OEBPS/content.opf: Error while parsing file: attribute "xml:lang" not allowed here; expected attribute "id"". Cannot upload ePub 2.0.1 files exported from InDesign to Draft2Digital and IngramSpark. The same error shows up in "Pagina EPUB-checking 2.0.10