XML technologies / SVG / Creating simple SVG graphics / SVG tag syntax / Syntax differences from HTML
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
If you know HTML, bear several points in mind when writing XML or SVG code. Otherwise, unpleasant surprises and repeated errors may follow.
SVG is case-sensitive. All tags, attributes and their values are written entirely in lowercase.
Tag names you assign may contain uppercase letters, but access must use exactly the same capitalization. Use lowercase throughout or adopt consistent naming rules.
All tags must be closed. A tag such as
<text>, containing text between its opening and closing tags, must end with</text>. Tags consisting only of attributes are closed with/>, for example<rect ... />.As in HTML, comments are enclosed between
<!--and-->.The positioning attributes
topandleftdo not exist. Instead, useyandx.All attribute values are enclosed in quotation marks.
Attribute-value combinations of the form
Attributname="Wert"must be separated by spaces.
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