HTML5: DTD module for video/audio

The following listings shows a first draft of the DTD module for the new video/audio elements. There are some challenges in the spec:

1. The <video> element has a content model that depends on the presence of the src attribute. The src attribute contains an URI for the video ressource. Alternatively an author can use the <source> child element. Do we need two options to express the ressource URI? I don’t think so. Therefore I dropped the src attribute, and solving the DTD problem.

2. The <video> element’s content model has a transparent part. This could be a nice extension of XML/SGML!? As long as XML can’t express this, I have to find another solution for the DTD. Since simplicity wins, I propose the following solution: The <video> element is a block element (it’s content will be displayed as a block), it may therefore not be placed inside blocks like <p> — and the “transparent” part will be a <div>. The audio element is similar but may occur as an inline element; it’s “transparent” part is a <span>.

Take a look at the listing and leave a comment!

<!-- ========= audio/video elements ========= -->

<!ELEMENT video (source+, track*, div?)>
<!ATTLIST video
 poster    CDATA    #IMPLIED
 preload    (none, metadata, auto) "metadata"
 autoplay    (autoplay) #IMPLIED
 mediagroup  CDATA       #IMPLIED
 loop    (loop)       #IMPLIED
 muted    (muted)       #IMPLIED
 controls    (controls) #IMPLIED
 width    CDATA       #IMPLIED
 height    CDATA       #IMPLIED
>

<!ELEMENT audio (source+, track*, span?)>
<!ATTLIST audio
 preload    (none, metadata, auto) "metadata"
 autoplay    (autoplay) #IMPLIED
 mediagroup  CDATA       #IMPLIED
 loop    (loop)       #IMPLIED
 muted    (muted)       #IMPLIED
 controls    (controls) #IMPLIED
>

<!ELEMENT source    EMPTY>
<!ATTLIST source
 src        CDATA    #REQUIRED
 type    CDATA    #IMPLIED
 media    CDATA    #IMPLIED
>

<!ELEMENT track        EMPTY>
<!ATTLIST track
 src        CDATA        #REQUIRED
 kind    (subtitles | captions | descriptions | chapters | metadata)    #REQUIRED
 srclang    CDATA             #IMPLIED
 label    CDATA        #REQUIRED
 default    (default)    #IMPLIED
>

<!-- $Id: html5-audio-video.mod 8273 2011-06-07 14:56:36Z sm $ -->

 

 

This entry was posted on 07/06/2011 in DTD, proposal. Bookmark the permalink. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.

 
Creative Commons License
HTML5 DTD by Stefan Mintert/Linkwerk GmbH is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.