EPUBCheck HTM_062: deprecated SVG xlink:href
Updated:
EPUBCheck HTM_062 is a usage message: “SVG "xlink:href" attribute is deprecated; an "href" attribute should be used instead.” An SVG element uses xlink:href, which is deprecated in favour of plain href. EPUBCheck reports two usage notes about it. HTM_062 means xlink:href is used. HTM_063 means an element has both xlink:href and href with different values, so different apps may load different targets.
The official message
SVG "xlink:href" attribute is deprecated; an "href" attribute should be used instead.
- 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
EPUBCheck prints this ID with an underscore instead of a hyphen; this page uses the ID exactly as EPUBCheck reports it.
Typical causes
- SVG produced by older editors, which write xlink:href on image, use and a elements (HTM_062).
- One of the two attributes updated and the other forgotten, for example after replacing an image (HTM_063).
How to fix it
- Open the file EPUBCheck names (the message gives the path, line and column) in a text or EPUB editor such as Sigil, or unzip the EPUB and open it there.
- Replace xlink:href with href on the elements EPUBCheck lists.
- If you keep both for older reading apps, give them exactly the same value.
- Remove the xmlns:xlink declaration once no xlink attribute remains.
- Rebuild the EPUB and run EPUBCheck again to confirm the message is gone.
When it's not this
If the link target itself is missing from the EPUB, the message is RSC-007, whichever attribute points to it.
Also reported as
HTM_063(usage): SVG "xlink:href" attribute value ("%1$s") should be equal to the "href" attribute value ("%2$s").
Terms used here
Other HTM messages
HTM_061"…" is not a valid custom data attribute (it must have at least one character after the hyphen, be XML-compatible, and not contain ASCII uppercase letters).HTM_060bEPUB reading systems must ignore viewport meta elements in reflowable documents; viewport declaration "…" will be ignored.HTM_059Viewport "…" property must not be defined more than once, but found values […].HTM_058HTML documents must be encoded in UTF-8, but UTF-16 was detected.HTM_057Viewport "…" value must be a positive number or the keyword "device-…"HTM_056Viewport metadata has no "…" dimension (both "width" and "height" properties are required)
Sources
Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.