XML technologies / SVG / SVG and XML / Solutions
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
An XML namespace determines which commands and attributes are known and usable. SVG’s namespace supplies SVG tags; the XHTML namespace supplies XHTML tags.
The declaration
xmlns:html="http://www.w3.org/1999/xhtml"defines the XHTML namespace and specifies that its commands in the XML file begin withhtml:.With XHTML’s namespace defined, create a heading with
<foreignObject><html:h1>Überschrift 1</html:h1></foreignObject>.The XML file should look as follows:
<?xml version="1.0" encoding="iso-8859-1"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml">
<circle cx="10" cy="10" r="4" style="fill:red;stroke:black"/>
<text x="10" y="30" style="fill:black;font-size:10px">test</text>
</svg>
Create text with the HTML namespace and the
<foreignObject>tag.
<foreignObject>
<html:p>text</html:p>
</foreignObject>
Position it with the attributes
xandyof the tag<foreignObject>:<foreignObject x="20" y="0">.
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