XML technologies / SVG / Adding hyperlinks and external files / Solutions
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
The empty SVG file could look as follows:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg>
<desc>Diese Datei enthält Symbole</desc>
</svg>
The text containing the © character could be defined as follows:
<g>
<text x="0" y="12">© 2001 by Helma Spona</text>
</g>
Create the hyperlink with the
<a>tag, which must enclose the<text>tag.
<g>
<a xlink:href="http://www.helma-spona.de">
<text x="0" y="12" style="font-size:10px;fill:red;stroke:none">© 2001 by Helma Spona</text>
</a>
</g>
Assuming you name the group in the file vorlagen.svg “cr”, the second file’s code could look as follows:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg>
<use transform="translate(10,30)" xlink:href="vorlagen.svg#cr"/>
</svg>
To start Batik, extract the ZIP file into a directory of your choice if you have not already done so. Then double-click the file batik.jar. The window may take a few seconds to appear, so be patient. Then select File / Open File to open the file.
The
<image>tag for the graphic could look as follows:
<image width="64" height="49" xlink:href="mk.gif" /> Again, define the hyperlink with the
<a>tag, which encloses the<image>tag:
<a xlink:href="http://www.helma-spona.de">
<image width="64" height="49" xlink:href="mk.gif" />
</a>
Copyright © verlag moderne industrie GmbH 2001
You may print the online version for your private use.
Otherwise, this chapter from “Das Einsteigerseminar SVG — Webgrafiken mit XML” is subject to the same conditions as the bound edition. The work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
verlag moderne industrie GmbH, Justus-von-Liebig-Straße 1, D-86899 Landsberg/Lech, fon ++49 (0) 81 91 / 125 – 0, leserservice(at)mi-verlag.de
back to top