XML technologies / SVG / Creating simple SVG graphics / The structure of SVG graphics / The DOCTYPE declaration in detail
(Excerpt from “Das Einsteigerseminar SVG — Webgrafiken mit XML” by Helma Spona)
Next, specify the XML file’s DTD with the <DOCTYPE> declaration. It determines the available XML tags and also:
Which attributes are available,
Which value types attributes accept, and
Which formatting options the
styleattribute provides.
Note:
Different SVG Viewer versions may use different DTDs. For SVG Viewer 1.0, use: <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000303 Stylable//EN" "http://www.w3.org/TR/2000/03/WD-SVG-20000303/DTD/svg-20000303-styleable.dtd">; for SVG Viewer 2.0, <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd"> is more suitable. The current SVG standardization status corresponds to: <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010719//EN" "http://www.w3.org/TR/2001/PR-SVG-20010719/DTD/svg10.dtd">. All three DTDs work in both viewers, but may trigger an unknown-DTD warning. This may or may not cause display errors.
In detail, the <DOCTYPE> declaration begins with <!DOCTYPE, followed for SVG by svg, then PUBLIC specifies the DTD. Finally, the http address defines a unique namespace identifying the DTD. It is not downloaded online but built into SVG Viewer or the browser. The address only uniquely identifies which DTD to use.
Note:
The address contains the date and status of the SVG standard or recommendation. The string PR-SVG-20010719 identifies the W3C documentation dated 19 July 2001; PR means it is currently a Proposed Recommendation. SVG is therefore close to becoming a W3C Recommendation, and another DTD is expected when its language definition is finally adopted. (data2type editorial note: For current SVG DOCTYPE declarations, see W3C: Recommended list of Doctype declarations - Optional doctype declarations.)
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