W3C home > Mailing lists > Public > www-svg@w3.org > September 1999

example on including SVG in SMIL

From: Philipp Hoschka <ph@w3.org>
Date: Mon, 06 Sep 1999 10:47:49 +0200
Message-ID: <37D37FB5.D242D20@w3.org>
To: www-svg@w3.org
comment on:


> For XML grammars with the ability to embed SVG documents, it is assumed that some sort of alternate representation
>     capability such as the <switch> element and some sort of feature-availability test facility (such as what is described in the
>     SMIL 1.0 specification (??? add links)) will be available. 
>     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-19990726.dtd" 
>                type="image/svg" src="drawing.svg" />

in this case, you actually do not need a system-required attribute - if
playback environment does not support SVG, the element is not
(see Section 4.3. in SMIL spec:

"An element is acceptable if ... the media-type can be decoded ..."

if the SVG media type cannot be decoded, the element will not be chosen,
the second image will be chosen instead

>           <!-- Else, render the alternate image. -->
>           <img src="alternate_image.jpg" />
>         </switch>
>       </body>
>     </smil>
Received on Monday, 6 September 1999 04:51:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:46 UTC