EPUBCheck MED_017: overlay fragment not an id
Updated:
EPUBCheck MED_017 is a warning message: “URL fragment should indicate an element ID, but found '#…'.” A media overlay text reference uses a fragment that is not an element id. For XHTML chapters, EPUB recommends pointing to an element by its id; other fragment schemes may not be supported by reading apps. EPUBCheck warns and shows the fragment.
The official message
URL fragment should indicate an element ID, but found '#%1$s'.
- Default severity
- Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
- EPUBCheck version
- 5.4.0
EPUBCheck prints this ID with an underscore instead of a hyphen; this page uses the ID exactly as EPUBCheck reports it.
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Text fragment or character-offset schemes written by an alignment tool.
- A fragment with a typo or a leading character that is not part of the id.
How to fix it
- Give the phrase an element with an id in the chapter, for example
<span id="s12">. - Point the text src to it, as
chapter1.xhtml#s12. - Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the target is an SVG document, the fragment should be an SVG fragment identifier (MED_018).
Terms used here
Other MED messages
MED_016Media Overlays total duration should be the sum of the durations of all Media Overlays documents.MED_018URL fragment should be an SVG fragment identifier, but found '#…'.MED_015Media overlay text references must be in reading order. Text target "…" is before the previous link target in … order.MED_014Media overlay audio file URLs must not have a fragment, but found '#…'.MED_013Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document.MED_012The "media-overlay" attribute does not match the ID of the Media Overlay that refers to this document.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.