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:

http://www.w3.org/Graphics/SVG/Group/1999/07/26/backward.html

> 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
the 
playback environment does not support SVG, the element is not
"acceptable"
(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,
and
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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:17 GMT