A user agent (UA) might not have the ability to process and view SVG documents. The following list outlines two of the backwards compatibility scenarios associated with SVG documents:
This <switch> element and feature-availability test facility (or their equivalents) are the recommended way for XML authors to provide an alternate representation to an SVG document, such as an image or a text string. The following example shows how to embed an SVG drawing within a SMIL 1.0 document such that an alternate image will display in the event the UA doesn't support SVG. (In this example, the SVG document is included via a URL reference. With some parent XML grammars it will also be possible to include an SVG document inline within the same file as its parent grammar.)
<?xml version="1.0" standalone="yes"?> <smil> <body> <!-- The SMIL <switch> element will process the first child element which tests true and skip past all others. --> <switch> <!-- The system-required attribute tests to see if the user agent supports SVG. If true, then render the file drawing.svg. --> <ref system-required="http://www.w3.org/Graphics/SVG/SVG-19990812.dtd" type="image/svg" src="drawing.svg" /> <!-- Else, render the alternate image. --> <img src="alternate_image.jpg" /> </switch> </body> </smil>
For HTML 4.0, SVG drawings should be embedded using the <object> element. The alternate representation should be included as the content of the <object> element. In this case, the SVG document usually will be included via a URL reference. The following example shows how to use the <object> element to include an SVG drawing via a URL reference with an image serving as the alternate representation in the absence of an SVG user agent:
<html> <body> <object type="image/svg" data="drawing.svg"> <!-- The contents of the <object> element (i.e., an alternate image) are drawn in the event the user agent cannot process the SVG drawing. --> <img src="alternate_image.jpg" alt="short description" /> </object> </body> </html>