EPUBCheck RSC-015: SVG use without a fragment
Updated:
EPUBCheck RSC-015 is a usage message: “A fragment identifier is required for svg use tag references.” An SVG use element references a file without a fragment identifier; it must point to a specific element with #id. Without the fragment, the reading app does not know which shape to reuse.
The official message
A fragment identifier is required for svg use tag references.
- Default severity
- Usage. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.
- EPUBCheck version
- 5.4.0
Typical causes
- A use element written as
<use href="icons.svg"/>instead of<use href="icons.svg#star"/>. - Symbol sprites whose ids were removed when the SVG was optimised.
How to fix it
- Open the SVG file and find the id of the element to reuse.
- Add that id at the end of the reference, after a #.
- If the element has no id, give it one, then validate again.
When it's not this
If the fragment is present but the id does not exist, the message is RSC-012.
Terms used here
Other RSC messages
RSC-014Fragment identifier defines an incompatible resource type.RSC-016Fatal Error while parsing file: …RSC-013Fragment identifier is used in a reference to a stylesheet resource.RSC-017Warning while parsing file: …RSC-012Fragment identifier is not defined.RSC-011Found a reference to a resource that is not a spine item.
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.