Module rsvg::href

source ·
Expand description

Handling of xlink:href and href attributes

In SVG1.1, links to elements are done with the xlink:href attribute. However, SVG2 reduced this to just plain href with no namespace:

If an element has both xlink:href and href attributes, the href overrides the other. We implement that logic in this module.


  • Returns whether the attribute is either of xlink:href or href.
  • Sets an href attribute in preference over an xlink:href one.