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:

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.)

   

 

 

 

back to top