Friday, May 23, 2008

XML Timing Language

Introduction to XML Timing Language - XTL

The XML Timing Language (Timesheets) is at present submitted to the W3C org for discussion by the Helsenki University of Technology. This XML Timing Language is used for introducing the timings to the XML document elements.

Hence XML Timing Language is a separate part of the XML document that specifies the timings for the different elements in the document. The XML Timing Language uses a subset of the Timing and Synchronization module of SMIL 2.0.

To explain further about the XML Timing Language, think of a webpage that uses Cascading Style Sheets to present the content of a web page. In this way all the contents of the pages are presented all the time. Suppose you want to present only part of the page at an instant and then after a few seconds the other part should be presented, then you can use XML Timing Language to achieve this.

Just like a slide show you can present contents of the page in different times using the XML Timing Language and the style of presentation is taken care of by the CSS. Hence you should be clear that the XML Timing Language (Timesheets) specify the visibility of the given elements in a document at a moment.

Timesheets are separate sections of the XML documents. An XML document can have any number of Timesheet elements. It is the container which has other item element which may refer to the media elements. The media elements are divided into static and dynamic elements.

The static elements are those that contain static images and text and the dynamic media elements are those that contain video and audio. When a static media element is included in the document you have to specify the duration of the element otherwise the element would be displayed indefinitely. In the case of dynamic media elements you need not specify the duration since it will automatically stop when the content of the video or audio is over.
The timing language elements have attributes like begin and dur. The begin attribute gives the relative starting time of the element with respect to its activation. If you do not specify any attribute value for the begin attribute, it defaults to “0s” which means 0 seconds. The dur attribute gives the duration of the element relative to the start time of the element. For static elements the duration will be indefinite unless the parent element deactivates it.
The dynamic elements will have the duration as that of the content itself. There is another attribute called the repeat attribute. This gives the repeat count for the element. If the repeat count is positive the element is activated again. You should note that the repeat attribute has some meaning only when it is related to the dynamic content. There is no meaning in repeating the static content. “Indefinite” is also a value for the repeat attribute. This value indicates that the element will be repeated until it is stopped by the parent element.

The following code gives an example of how the XML Timing Language (Timesheet) is used in a web page.


<html xmlns="http://www.w3.org/1999/xhtml" xmlns:time="http://www.your-domain.org/2005/timesheet">
<head><style type="text/css">...</style>
<time:timesheet><time:par><time:item select="#img1" begin="2s"/><time:item select="#img2" begin="7s"/><time:item select="#img3" begin="12s"/><time:item select="#img4" begin="17s"/></time:par></time:timesheet></head>
<body><div id="content"><p id="title">My Album</p><p id="img1"><img src="image1.jpg" id="image1"/></p><p id="img2"><img src="image2.jpg" id="image2"/></p><p id="img3<img src="image3.jpg" id="image3"/></p><p id="img4"><img src="image4.jpg" id="image4"/></p></div></body></html>

The above code displays the first image and each successive image is displayed for 5 seconds.

The tag’s id is chosen to set the duration for the images. The begin attribute is set for 7 seconds, 12 seconds and 17 seconds for the successive images so that the images are displayed for 5 seconds each one by one automatically. With this simple example one can easily understand the power of the Timesheet in a web page. For other elements and attributes and for some simple examples please refer to the XML Timing Language documentation available at “http://www.w3.org/Submission/xml-timing/”


0 comments:

 

Site Info

Text

Java 2 Enterprise Edition Copyright © 2009 Community is Designed by Bie