Copy link to clipboard
Copied
Why are these errors and how do I find the place to amend them (all RSC-005)? I've used ID Styles for both text and objects and am not a coder.
For content.opf error reads:
(line 2, col 105):
Error while parsing file: attribute "xml:lang" not allowed here; expected attribute "id"
Line 2 = <package xmlns="http://www.idpf.org/2007/opf" version="2.0" unique-identifier="bookid" xml:lang="en-GB">
In the cover.xhtml lines 3–11 read
(line 10, col 69):
Error while parsing file: element "figure" not allowed anywhere; expected the element end-tag, text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
(line 11, col 95):
Error while parsing file: element "figure" not allowed anywhere; expected the element end-tag, text or element "a", "abbr", "acronym", "address", "applet", "b", "bdo", "big", "blockquote", "br", "cite", "code", "del", "dfn", "div", "dl", "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "iframe", "img", "ins", "kbd", "map", "noscript", "ns:svg", "object", "ol", "p", "pre", "q", "samp", "script", "small", "span", "strong", "sub", "sup", "table", "tt", "ul" or "var" (with xmlns:ns="http://www.w3.org/2000/svg")
The issue is that you are exporting EPUB 2. If you switch to exporting EPUB 3, these validation errors will disappear.
Are you consciously choosing EPUB 2? If yes, may I ask why? There is no reason at all to stick to this older format.
Copy link to clipboard
Copied
Oh, fer frak's sake — I didn't see that coming. I did write a technical note here in the forum about the change, but in haste, ignorance or blind trust I asumed it was compliant with the implemented standards. We once again have InDesign jumping ahead on export changes and "compliance" that is not in step with the downstream EPUB world.
The short take is that images are now exported in a <figure> element, not a <div>. I have no idea who said what to whom or when about this change being 'compliant' or necessary; all I know is that the 2025 rush to accessiblity (for the EU, mainly) is creating something a lot like <chaos> in the EPUB world.
The only solutions are (1) ignore the errors and assume that any downstream sales portal or reader understands what to do with a <figure> even if EPUBcheck is clueless so far; (2) manually edit all <figure> elements to <div> (which may not work) or just wait until the reality end of EPUB catches up with the navel-gazing end of it.
Copy link to clipboard
Copied
Love it! Thanks James.
1 it is then.
Copy link to clipboard
Copied
I'll just add that part of the reason this went past me is that no EPUB reader so far — including Thorium, Calbre and Kindle Previewer — so much as seems to notice the change. I long ago gave up trying to follow the talmudic twists of the EPUB standard but I assume these tools implemented this detail correctly, and as awkwardly as it does, InDesign is slowly moving towards greater standards compliance. Why EPUBcheck would choke on it is... just evidence of the field's fragmentation.
I just wouldn't worry about it unless an actual distribution portal like KDP, Ingram, Apple etc. rejects it. I think it's a bit more of consequence to CSS stylists who may go bonkers trying to figure out why existing projects now spurn any image adjustments. 🙂
Copy link to clipboard
Copied
So this is what IngramSpark rejected the epub for! I've put in a query quoting you - we'll see. Might have to do option 2!
Copy link to clipboard
Copied
AFAIK, most of these portals use EPUBcheck as their core validation engine. It baffles me how this degree of variance from a well-defined (if antiquated and cluttered) standard can keep recurring.
Copy link to clipboard
Copied
Wrapping images in a more semantic <figure> tag is the correct way to format them. The issue here is not the <figure> tag but that he is using EPUB 2, not EPUB 3.
And, for the record, I am involved in pushing the changes to how InDesign exports EPUB. These changes all make for better EPUB all around, including better accessibility. There is not veering away from standards happening at all but rather the opposite: adhering more closely to standards.
Copy link to clipboard
Copied
Laura, I wholehartedly disagree. The issue is not that someone is using ePUB 2 instead of ePUB 3, the issue is that the ePUB 2.01 export from InDesign is invalid.
Even though ePUB 2.01 may be deemed obsolete, stating that someone is using the wrong export option is missing the point. InDesign still exports ePUB version 2.01 files, so the ePUB 2.01 files that InDesign exports should also comply completely to the ePUB 2.01 standard and not contain newer tags that are not part of the specification. For example, the "xml:lang" attribute in the <package> tag, the <figure> tag and the "role=doc:cover" attribute in the cover.xhtml, and the <meta property"pagebreakSource"> are simply not a part of the ePUB 2.01 specification and should not be exported as such. These ePUB 3 elements are causing validators to fail and causing problems for people trying to upload their books.
In my opinion there are only two options for InDesign:
1. Offer 2.01 and 3.0 ePUB export options, but make sure both options deliver fully valid ePUB files according to the 2.01 of 3.0 specification (so no ePUB 3 tag in ePUB 2.01 files)
2. Remove the ePUB 2.01 export completely.
Why that last option is not a good idea imho: despite the fact that many people are shouting that "one should NEVER use ePUB 2.01 anymore", people stick to that format because some e-readers simply won't render ePUB 3.0 documents correctly, while ePUB 2.01 is widely supported on older e-readers and also on the new ones.
Copy link to clipboard
Copied
I agree, to a point. InDesign has borked the EPUB 2 export, no question about it. And that needs to be fixed. That said, EPUB 3 has an NCX and the architecture to make it backward compatible for reading systems that can't be arsed to update. A well-made EPUB 3 works on an EPUB 2 reader that is stuck in the past.
Happy to hear about specific iterations where this is the case so that I can advocate for fixes, if that helps.
Copy link to clipboard
Copied
Thank you, Laura
Having a correct ePUB 2.01 without having to manually correct the generated ePUB would be really nice.
I can make it very specific for ePUB 2.01:
1. the "xml:lang" attribute in the <package> tag should be removed in content.opf
2. <meta property"pagebreakSource"> should be removed from content.opf, even if a pagebreakSource is defined in the export dialog
3. the <figure> tag should be a <div> in cover.xhtml
4. "role=doc:cover" should be removed from the <image> tag in cover.xhtml
5. in css files: "application/x-font-ttf" should be "font/ttf" (ePUB 2.01 and ePUB 3)
6. in css files: "application/x-font-otf" should be "font/otf" (ePUB 2.01 and ePUB 3)
And a generic improvement for ePUB export:
All fonts are exported with color attributes in the CSS (default black). When a reader then switches to night mode on their e-reader the font is black on a black background and therefore unreadable. It would be nice to have an option to not export font colors to the CSS.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The issue is that you are exporting EPUB 2. If you switch to exporting EPUB 3, these validation errors will disappear.
Are you consciously choosing EPUB 2? If yes, may I ask why? There is no reason at all to stick to this older format.
Copy link to clipboard
Copied
I'm just going with what ID offers, which is reflowable or fixed. Not spotted any number variants
Copy link to clipboard
Copied
Copy link to clipboard
Copied
As LB said, the reflowable export menu gives you a choice of v2.01 or v3; IMHO, the v2 option should just be removed but at least they finally made v3 the default option. (It's the only option for fixed-page, but then, FXL shouldn't be used at all for most projects in InDesign.)
It's possible you were misled by the titantic amount of outdated and simply wrong information the web contains on EPUB. That which isn't outdated because it was written and posted ten years ago is that because someone with outdated notions reprinted or copied it. And, of course, this old information is what comes up high in the search returns, masking all newer and more accurate material. (Then again, the collective expertise over in the three-letter portal insist, to this day and the point of tribal warfare, that EPUB 2 is "better," EPUB 3 is completely obsolete, and that their service "doesn't even accept EPUB 3 files any more." So it's kind of a sisyphean task.) The bottom line is that I don't recommend anyone use any web resource found via search for EPUB information, whether it's a blog or YT video or what, simply because you have to have a high level of expertise to determine if the information is in any way current, valid, useful or even basically right.
But now you know to use EPUB 3, at least. 🙂
Copy link to clipboard
Copied
There you go - thank you. EPUB3 it is from now on - I was mislead by 2 being the default and some vague memory of advice to avoid 3!
Copy link to clipboard
Copied
Wonderful. That's an easy fix and makes a better ebook to boot!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now