O'Reilly logo

Designing SVG Web Graphics by Andrew H. Watt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The <tref> Element

The use of the <tref> element has many similarities to the way the <use> element works. The text to be inserted is created in a <text> element nested within the <defs> element toward the beginning of an SVG document. The referenced <text> element has an ID attribute that the referencing <tref> element makes use of by means of the xlink:href attribute.

In this simple example, copyright information is defined in a <text> element whose ID is CopyrightInfo. That element is then referenced by the <tref> element later in the SVG document.

Listing 4.14. (tref01.svg)
 <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/ DTD/svg10.dtd"> <svg width="600" height="300"> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required