Process SMIL directives in XML data: Difference between revisions

From Rosetta Code
Content added Content deleted
m (inverted the task instruction and documentation links)
(two examples of output provided)
Line 5: Line 5:
* [[wp:Synchronized_Multimedia_Integration_Language|SMIL on Wikipedia]] and [http://www.w3.org/TR/SMIL/smil-animation.html#q35 at W3]
* [[wp:Synchronized_Multimedia_Integration_Language|SMIL on Wikipedia]] and [http://www.w3.org/TR/SMIL/smil-animation.html#q35 at W3]


The task is to create an utility that given the first Smiled XML file, would return the second one
The task is to create an utility that given the first Smiled XML file, would return the following ones:


<lang xml><?xml version="1.0" ?>
<lang xml><?xml version="1.0" ?>

Revision as of 14:35, 25 May 2014

Process SMIL directives in XML data is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

In order to represent evolutions of contents over time, the SMIL standard provides a solution to record the animation of data. Smil animations can be added to any kind of contents formated in XML.

The task is to create an utility that given the first Smiled XML file, would return the following ones:

<lang xml><?xml version="1.0" ?> <smil> <X3D>

 <Scene>
   <Viewpoint position="0 0 8" orientation="0 0 1 0"/>
   <PointLight color='1 1 1' location='0 2 0'/>
   <Transform translation='0.0 0.0 0.0' scale='1 1 1'>
     <Shape>
       <Box size='2 1 2'>
         <animate attributeName="size" from="2 1 2"
                                         to="1 2 1" begin="0s" dur="10s"/>
       </Box>
       <Appearance>
         <Material diffuseColor='0.0 0.6 1.0'>
           <animate attributeName="diffuseColor" from="0.0 0.6 1.0"
                                                   to="1.0 0.4 0.0" begin="0s" dur="10s"/>
         </Material>
       </Appearance>
     </Shape>
   </Transform>
 </Scene>

</X3D></smil></lang>

At t = 0 second here is the expected output:

<lang xml><?xml version="1.0" ?> <X3D>

 <Scene>
   <Viewpoint position="0 0 8" orientation="0 0 1 0"/>
   <PointLight color='1 1 1' location='0 2 0'/>
   <Transform translation='0.0 0.0 0.0' scale='1 1 1'>
     <Shape>
       <Box size='2 1 2'/>
       <Appearance>
         <Material diffuseColor='0.0 0.6 1.0'/>
       </Appearance>
     </Shape>
   </Transform>
 </Scene>

</X3D></lang>

At t = 2 second here is the expected output:

<lang xml><?xml version="1.0" ?> <X3D>

 <Scene>
   <Viewpoint position="0 0 8" orientation="0 0 1 0"/>
   <PointLight color='1 1 1' location='0 2 0'/>
   <Transform translation='0.0 0.0 0.0' scale='1 1 1'>
     <Shape>
       <Box size='1.8 1.2 1.8'/>
       <Appearance>
         <Material diffuseColor='0.2 0.56 0.8'/>
       </Appearance>
     </Shape>
   </Transform>
 </Scene>

</X3D></lang>