Skip to content
EPUBCheck · Resources and references

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

  1. Open the SVG file and find the id of the element to reuse.
  2. Add that id at the end of the reference, after a #.
  3. 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-014 Fragment identifier defines an incompatible resource type.
  • RSC-016 Fatal Error while parsing file: …
  • RSC-013 Fragment identifier is used in a reference to a stylesheet resource.
  • RSC-017 Warning while parsing file: …
  • RSC-012 Fragment identifier is not defined.
  • RSC-011 Found 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.

FAQ

What does EPUBCheck RSC-015 mean?

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.

Is RSC-015 an error?

RSC-015 is reported as usage by default. Informative only and hidden by default: it appears when EPUBCheck runs with -u (--usage). It does not make the EPUB invalid.