Skip to content
EPUBCheck · Images, audio and media overlays

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

  1. Give the phrase an element with an id in the chapter, for example <span id="s12">.
  2. Point the text src to it, as chapter1.xhtml#s12.
  3. 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_016 Media Overlays total duration should be the sum of the durations of all Media Overlays documents.
  • MED_018 URL fragment should be an SVG fragment identifier, but found '#…'.
  • MED_015 Media overlay text references must be in reading order. Text target "…" is before the previous link target in … order.
  • MED_014 Media overlay audio file URLs must not have a fragment, but found '#…'.
  • MED_013 Media Overlay Document referenced from the "media-overlay" attribute does not contain a reference to this Content Document.
  • MED_012 The "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.

FAQ

What does EPUBCheck MED_017 mean?

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.

Is MED_017 an error?

MED_017 is reported as warning by default. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.