[xiph-commits] r3551 - in libcmml/branches: . cmml4 cmml4/Win32 cmml4/doc cmml4/examples cmml4/src cmml4/tests cmml4/tools

silvia at svn.annodex.net silvia at svn.annodex.net
Sat Apr 12 23:22:17 PDT 2008


Author: silvia
Date: 2008-04-12 23:22:17 -0700 (Sat, 12 Apr 2008)
New Revision: 3551

Added:
   libcmml/branches/cmml4/
   libcmml/branches/cmml4/doc/cmml_4_0.xsd
Removed:
   libcmml/branches/cmml4/doc/cmml.dtd
   libcmml/branches/cmml4/doc/cmml_2_0.dtd
   libcmml/branches/cmml4/doc/cmml_2_1.dtd
   libcmml/branches/cmml4/examples/cmml-seek-utc.c
Modified:
   libcmml/branches/cmml4/ChangeLog
   libcmml/branches/cmml4/Win32/libcmml.def
   libcmml/branches/cmml4/configure.ac
   libcmml/branches/cmml4/doc/cmml-fix.1.sgml.in
   libcmml/branches/cmml4/doc/cmml-validate.1.sgml.in
   libcmml/branches/cmml4/doc/cmml_dox.h
   libcmml/branches/cmml4/examples/Makefile.am
   libcmml/branches/cmml4/examples/cmml-uri-file-open.c
   libcmml/branches/cmml4/examples/cmml-uri-file.c
   libcmml/branches/cmml4/src/Makefile.am
   libcmml/branches/cmml4/src/Version_script.in
   libcmml/branches/cmml4/src/cmml.c
   libcmml/branches/cmml4/src/cmml.h
   libcmml/branches/cmml4/src/cmml_element.c
   libcmml/branches/cmml4/src/cmml_private.c
   libcmml/branches/cmml4/src/cmml_private.h
   libcmml/branches/cmml4/src/cmml_snprint.h
   libcmml/branches/cmml4/src/cmml_time.c
   libcmml/branches/cmml4/tests/Makefile.am
   libcmml/branches/cmml4/tests/error1.cmml
   libcmml/branches/cmml4/tests/error1.cmml.correct
   libcmml/branches/cmml4/tests/error10.cmml
   libcmml/branches/cmml4/tests/error10.cmml.correct
   libcmml/branches/cmml4/tests/error11.cmml
   libcmml/branches/cmml4/tests/error12.cmml
   libcmml/branches/cmml4/tests/error13.cmml
   libcmml/branches/cmml4/tests/error14.cmml
   libcmml/branches/cmml4/tests/error15.cmml
   libcmml/branches/cmml4/tests/error15.cmml.correct
   libcmml/branches/cmml4/tests/error2.cmml
   libcmml/branches/cmml4/tests/error2.cmml.correct
   libcmml/branches/cmml4/tests/error3.cmml
   libcmml/branches/cmml4/tests/error3.cmml.correct
   libcmml/branches/cmml4/tests/error4.cmml
   libcmml/branches/cmml4/tests/error4.cmml.correct
   libcmml/branches/cmml4/tests/error5.cmml
   libcmml/branches/cmml4/tests/error6.cmml
   libcmml/branches/cmml4/tests/error6.cmml.correct
   libcmml/branches/cmml4/tests/error7.cmml
   libcmml/branches/cmml4/tests/error9.cmml
   libcmml/branches/cmml4/tests/error9.cmml.correct
   libcmml/branches/cmml4/tests/i18n.cmml
   libcmml/branches/cmml4/tests/i18n.cmml.correct
   libcmml/branches/cmml4/tests/simple.cmml
   libcmml/branches/cmml4/tests/simple.cmml.correct
   libcmml/branches/cmml4/tests/special1.cmml
   libcmml/branches/cmml4/tests/special2.cmml
   libcmml/branches/cmml4/tools/Makefile.am
   libcmml/branches/cmml4/tools/cmml-fix.c
   libcmml/branches/cmml4/tools/cmml-fortune.c
   libcmml/branches/cmml4/tools/cmml-timeshift.c
   libcmml/branches/cmml4/tools/cmml-validate.c
Log:
started a branch to develop libcmml-0.11.0 using CMML4.0; it's broken - don't expect it to compile

Copied: libcmml/branches/cmml4 (from rev 3547, libcmml/trunk)

Modified: libcmml/branches/cmml4/ChangeLog
===================================================================
--- libcmml/trunk/ChangeLog	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/ChangeLog	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,3 +1,13 @@
+2008-04-13  Silvia Pfeiffer <silvia at silvia-pfeiffer dot de>
+	* Started on supporting CMML4
+	* removed import, stream and param tags
+	* removed utc time since it doesn't make much sense without relating to a media file
+
+2008-04-06  Silvia Pfeiffer <silvia at silvia-pfeiffer dot de>
+	* Version 0.9.3
+	* Maintenance release to finish off the support of CMML 2.1
+	* typos and comments fixes
+	
 2006-03-10  Silvia Pfeiffer <silvia at silvia-pfeiffer dot de>
 	* Version 0.9.2
 	* changed "class" struct member names to make libcmml compatible with C++

Modified: libcmml/branches/cmml4/Win32/libcmml.def
===================================================================
--- libcmml/trunk/Win32/libcmml.def	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/Win32/libcmml.def	2008-04-13 06:22:17 UTC (rev 3551)
@@ -21,7 +21,6 @@
 ; parsing results
 ;
 cmml_get_preamble		@10
-cmml_get_last_stream		@11
 cmml_get_last_head		@12
 cmml_get_last_clip		@13
 cmml_get_previous_clip		@14
@@ -37,7 +36,6 @@
 ;
 cmml_set_window			@20
 cmml_skip_to_secs		@21
-cmml_skip_to_utc		@22
 cmml_skip_to_id			@23
 cmml_skip_to_offset		@24
 
@@ -46,20 +44,17 @@
 ;
 cmml_preamble_new		@25
 cmml_element_new		@26
-cmml_stream_new			@27
 cmml_head_new			@28
 cmml_clip_new			@29
 cmml_error_new			@30
 
 cmml_preamble_clone		@31
 cmml_element_clone		@32
-cmml_stream_clone		@33
 cmml_head_clone			@34
 cmml_clip_clone			@35
 
 cmml_preamble_destroy		@36
 cmml_element_destroy		@37
-cmml_stream_destroy		@38
 cmml_head_destroy		@39
 cmml_clip_destroy		@40
 cmml_error_destroy		@41
@@ -69,8 +64,6 @@
 ;
 cmml_preamble_snprint		@42
 cmml_element_snprint		@43
-cmml_stream_snprint		@44
-cmml_stream_pretty_snprint	@45
 cmml_head_snprint		@46
 cmml_head_pretty_snprint	@47
 cmml_clip_snprint		@48
@@ -102,16 +95,9 @@
 cmml_time_new			@70
 cmml_time_new_secs		@71
 cmml_sec_new			@72
-cmml_utc_new			@73
 cmml_time_interval_new		@74
 cmml_time_new_in_sec		@75
-cmml_time_utc_to_sec		@76
 cmml_time_free			@77
 cmml_time_clone			@78
 cmml_sec_parse			@79
-cmml_utc_parse			@80
-cmml_utc_clone			@81
-cmml_utc_diff			@82
 cmml_npt_snprint		@83
-cmml_utc_snprint		@84
-cmml_utc_pretty_snprint		@85

Modified: libcmml/branches/cmml4/configure.ac
===================================================================
--- libcmml/trunk/configure.ac	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/configure.ac	2008-04-13 06:22:17 UTC (rev 3551)
@@ -5,7 +5,7 @@
 AC_PREREQ(2.53)
 AC_CANONICAL_TARGET
 
-AM_INIT_AUTOMAKE(libcmml,0.9.3)
+AM_INIT_AUTOMAKE(libcmml,0.11.0)
 AM_CONFIG_HEADER(config.h)
 
 #------------------------------------------------------------------------------------
@@ -24,7 +24,7 @@
 #  6. If any interfaces have been removed since the last public release, then set age
 #     to 0.
 
-SHARED_VERSION_INFO="1:0:0"
+SHARED_VERSION_INFO="2:0:0"
 SHLIB_VERSION_ARG=""
 
 # Checks for programs.

Modified: libcmml/branches/cmml4/doc/cmml-fix.1.sgml.in
===================================================================
--- libcmml/trunk/doc/cmml-fix.1.sgml.in	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml-fix.1.sgml.in	2008-04-13 06:22:17 UTC (rev 3551)
@@ -79,11 +79,6 @@
       </group>
 
       <group>
-	<arg choice="opt">-u <parameter>utc</parameter></arg>
-	<arg choice="opt">--utc <parameter>utc</parameter></arg>
-      </group>
-
-      <group>
 	<arg choice="opt">-h</arg><arg choice="opt">--help</arg>
       </group>
 
@@ -135,13 +130,6 @@
     </varlistentry>
 
     <varlistentry>
-      <term>-u <parameter>utc</parameter>, --utc <parameter>utc</parameter></term>
-      <listitem><para>Seek utc time offset. Starts writing clip tags
-      from the given time offset in <parameter>utc</parameter>
-      time, e.g. 200301031T160000.000Z.</para></listitem>
-    </varlistentry>
-
-    <varlistentry>
       <term>-h, --help</term>
       <listitem><para>Print usage message.</para></listitem>
     </varlistentry>

Modified: libcmml/branches/cmml4/doc/cmml-validate.1.sgml.in
===================================================================
--- libcmml/trunk/doc/cmml-validate.1.sgml.in	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml-validate.1.sgml.in	2008-04-13 06:22:17 UTC (rev 3551)
@@ -74,11 +74,6 @@
       </group>
       
       <group>
-	<arg choice="opt">-u <parameter>utc</parameter></arg>
-	<arg choice="opt">--utc <parameter>utc</parameter></arg>
-      </group>
-      
-      <group>
 	<arg choice="opt">-b</arg><arg choice="opt">--verbose</arg>
       </group>
       
@@ -128,13 +123,6 @@
       </varlistentry>
       
       <varlistentry>
-	<term>-u <parameter>utc</parameter>, --utc <parameter>utc</parameter></term>
-	<listitem><para>Seek utc time offset. Starts printing clip
-	tags from the given time offset in <parameter>utc</parameter>
-	time, e.g. 200301031T160000.000Z.</para></listitem>
-      </varlistentry>
-      
-      <varlistentry>
 	<term>-b, --verbose</term>
 	<listitem><para>Verbose mode. Writes parsed CMML document to
 	stdout.</para></listitem>

Deleted: libcmml/branches/cmml4/doc/cmml.dtd
===================================================================
--- libcmml/trunk/doc/cmml.dtd	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml.dtd	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,350 +0,0 @@
-<!--
-
-  Continuous Media Markup Language CMML version 2.1 DTD
-  Authoring language for ANNODEX(TM) media.
-
-  Namespace = http://www.annodex.net/cmml
-
-  Copyright (c) 2001- 
-  Commonwealth Scientific and Industrial Research Organisation
-  (CSIRO), Australia.
-  All Rights Reserved. 
-
-  This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
-  PUBLIC "-//CSIRO//DTD CMML 2.1//EN"
-  SYSTEM "http://www.annodex.net/DTD/cmml_2_1.dtd"
-
-  $Revision: 2.1 $
-  $Date: 2006/03/04 24:00:00 $
--->
-
-<!-- **************************** -->
-<!-- Definition of Imported Names -->
-<!-- **************************** -->
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType "CDATA">
- 
-<!-- space-separated list of link types -->
-<!ENTITY % LinkTypes "CDATA">
-
-<!-- single or comma-separated list of media descriptors -->
-<!ENTITY % MediaDesc "CDATA">
-
-<!-- used for titles etc. -->
-<!ENTITY % Text "CDATA">
-
-<!-- a Uniform Resource Identifier, see [RFC2396] -->
-<!ENTITY % URI "CDATA">
-
-<!-- a language code, as per [RFC1766] -->
-<!ENTITY % LanguageCode "NMTOKEN">
-
-<!-- timestamps similar to [RFC2326] 
- "smpte-24:" SMPTE time with a 24 fps basis
- "smpte-24-drop:" SMPTE time with a 24/1.001 fps basis
- "smpte-25:" SMPTE time with a 25 fps basis
- "smpte-30:" SMPTE time with a 30 fps basis
- "smpte-30-drop:" SMPTE time with a 30/1.001 fps basis
- "smpte-50:" SMPTE time with a 50 fps basis
- "smpte-60:" SMPTE time with a 60 fps basis
- "smpte-60-drop:" SMPTE time with a 60/1.001 fps basis
- "npt:" npt-time
- "clock:" utc-time
-
- Playbacktime is specified as a smpte-time 
- or npt-time only.
-
- UTCtime is specified as in [RFC2326], but
- without the "clock" identifier
--->
-<!ENTITY % Timestamp    "CDATA">
-<!ENTITY % Playbacktime "CDATA">
-<!ENTITY % UTCtime      "CDATA">
-
-
-<!-- ******************************** -->
-<!-- Definition of Generic Attributes -->
-<!-- ******************************** -->
-
-<!-- core attributes common to most displayable elements
-  id       document-wide unique id
-  class    space separated list of classes
-  title    advisory title/amplification
--->
-<!ENTITY % coreattrs
- "id          ID                #IMPLIED
-  class       CDATA             #IMPLIED
-  title       %Text;            #IMPLIED"
-  >
-
-<!-- internationalization attributes
-  xml:lang    language code (as per XML 1.0 spec)
-  dir         direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang        %LanguageCode; #IMPLIED
-  dir         (ltr|rtl)      #IMPLIED"
-  >
-
-<!ENTITY % attrs "%coreattrs; %i18n;">
-
-
-<!-- **************************** -->
-<!-- Document Structure           -->
-<!-- **************************** -->
-
-<!-- ROOT ELEMENT: -->
-<!-- cmml tag containing sequence of head and a tags -->
-<!-- =============================================== -->
-<!-- i18n  = the default language for the whole document including
-             the id tag of the cmml element -->
-<!-- xmlns = namespace of the cmml tags -->
-<!-- granulerate = the base temporal resolution to be used for the
-                   cmml bitstream -->
-<!ELEMENT cmml (stream?, head, clip*)>
-<!ATTLIST cmml
-  %i18n;
-  id          ID             #IMPLIED
-  xmlns       %URI;          #FIXED 'http://www.annodex.net/cmml'
-  granulerate CDATA          #IMPLIED
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of stream element -->
-<!-- **************************** -->
-
-<!-- STREAM tag providing timing information for the ANNODEX file -->
-<!-- (will be stored in the binary headers of the ANX bitstreams) -->
-<!-- ============================================================ -->
-<!-- (has no text attributes and thus no i18n; id tag follows default 
-      language specified in cmml tag) -->
-<!-- basetime  = base time associated with the first frame of the
-                 media document from which subsequent time references
-                 (such as in clip tags) will be taken relative to -->
-<!-- timebase  = same as basetime; kept for backwards compatibility;
-                 deprecated and will not be used in versions>=3.0 -->
-<!-- utc       = a mapping of the first frame to clock time; 
-                 specifications of utc time offsets into the document
-                 as in a URI will be taken relative to this -->
-<!ELEMENT stream (import*)>
-<!ATTLIST stream
-  id          ID             #IMPLIED
-  basetime    %Playbacktime; "0"
-  timebase    %Playbacktime; "0"
-  utc         %UTCtime;      #IMPLIED
-  >
-
-<!-- IMPORT tag giving descriptions on an input bitstream
-     (empty content)                                              -->
-<!-- ============================================================ -->
-<!-- i18n        = the language of the import tag's and the contained
-                   param tags' attribute values -->
-<!-- title       = human readable comment on the import bitstream -->
-<!-- granulerate = the base temporal resolution of the bitstream
-                   (e.g. its framerate for video or samplerate for
-                   audio) -->
-<!-- contenttype = encoding format of the input document (a MIME type
-                   and a character encoding separated by semicolon)
-                   -->
-<!-- src         = URI to the media document -->
-<!-- start       = the start time of the media bitstream specified
-                   in src -->
-<!-- end         = the end time of the media bitstream specified
-                   in src -->
-<!ELEMENT import (param*)>
-<!ATTLIST import 
-  %i18n;
-  id          ID             #IMPLIED
-  title       %Text;         #IMPLIED
-  granulerate CDATA          #IMPLIED
-  contenttype %ContentType;  #IMPLIED
-  src         %URI;          #REQUIRED
-  start       %Timestamp;    "0"
-  end         %Timestamp;    #IMPLIED
-  >
-
-<!-- PARAM description tags of an input bitstream (empty content) -->
-<!-- (name-value pairs e.g. comments on recording quality or so)  -->
-<!-- ============================================================ -->
-<!-- (internationalisation inherited from the parent import tag)  -->
-<!-- name  = identifies a property name; does not list legal values
-             for this attribute --> 
-<!-- value = specifies a property's value; does not list legal values
-             for this attribute -->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  id          ID             #IMPLIED
-  name        CDATA          #REQUIRED
-  value       CDATA          #REQUIRED
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of document head  -->
-<!-- **************************** -->
-
-<!-- head tag containing description of a specific media stream -->
-<!-- ========================================================== -->
-<!-- i18n    = the base language of the head's attribute values
-               and text content -->
-<!-- profile = space-separated list of URIs to locate meta tag
-               schemes -->
-
-<!-- content model is %head.misc; combined with a single
-     title and an optional base element in any order -->
-<!ENTITY % head.misc "(meta|link)*">
-<!ELEMENT head (%head.misc;,
-                ((title, %head.misc;, (base, %head.misc;)?) |
-                 (base, %head.misc;, (title, %head.misc;))))>
-<!ATTLIST head
-  %i18n;
-  id          ID             #IMPLIED
-  profile     %URI;          #IMPLIED
-  >
-
-<!-- TITLE tag giving descriptive title of the media document  -->
-<!-- ========================================================= -->
-<!-- i18n  = the language of the title text -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title 
-  %i18n;
-  id          ID             #IMPLIED
-  >
-
-
-<!-- BASE URI of the document (empty content) --> 
-<!-- ======================================== -->
-<!-- (internationalisation inherited from the parent head tag) -->
-<!-- href = URI associated with the document; all relative URI
-            references get interpreted relative to this base -->
-<!ELEMENT base EMPTY>
-<!ATTLIST base
-  id          ID             #IMPLIED
-  href        %URI;          #REQUIRED
-  >
-
-<!-- META description tags of the document (empty content) -->
-<!-- ===================================================== -->
-<!-- i18n    = the language of the meta attributes -->
-<!-- name    = identifies a property name; does not list legal
-               values for this attribute --> 
-<!-- content = specifies a property's value; does not list legal
-               values for this attribute -->
-<!-- scheme  = names a scheme to be used to interpret the property's
-               value (see the profiles tag in the head element for
-               locating these) -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
-  %i18n;
-  id          ID             #IMPLIED
-  name        NMTOKEN        #IMPLIED
-  content     CDATA          #REQUIRED
-  scheme      CDATA          #IMPLIED
-  >
-
-<!-- LINK tag to specify relationship values (empty content) --> 
-<!-- ======================================================= -->
-<!-- Relationship values can be used in principle:
-     a) for document specific toolbars/menus when used
-        with the link element in document head e.g.
-        start, contents, previous, next, index, end, help
-     b) to link to a separate style sheet (rel="stylesheet")
-     As charsets are given in the xml directive of cmml documents,
-     this attribute of html is not required for cmml.
-  -->
-<!-- attrs = the language of the title text; a short description of
-             the relationship through title, and the stylesheet class
-             -->
-<!-- href  = reference to a related document -->
-<!-- type  = type of the document referenced, e.g. "text/css" -->
-<!-- rel   = type of relationship to forward linked document -->
-<!-- rev   = type of relationship to reverse linked document -->
-<!-- media = type or medium/media to be rendered on, default "screen"
-             -->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
-  %attrs;
-  href        %URI;          #IMPLIED
-  type        %ContentType;  #IMPLIED
-  rel         %LinkTypes;    #IMPLIED
-  rev         %LinkTypes;    #IMPLIED
-  media       %MediaDesc;    #IMPLIED
-  >
-
-
-<!-- ************************** -->
-<!-- Definition of clip tags    -->
-<!-- ************************** -->
-
-<!-- Clip tag containing information for a specific fragment -->
-<!-- ======================================================= -->
-<!-- through meta, a, img and desc are given in specific order
-     here, their order is acutally random -->
-<!-- attrs    = the base language of the clip's attribute values and 
-                of its content elements; a short title representing
-                the anchor (e.g. in tooltips) -->
-<!-- track    = defines different sets of clip tags; clip tags of
-                same type cannot overlap temporally -->
-<!-- start    = specifies the start time of the clip; specified in 
-               time relative to the basetime of the header 
-                [NOT INCLUDED IN ANNODEXED DOCUMENT] -->
-<!-- end      = specifies the end time of the clip; specified in 
-                time relative to the basetime of the header 
-                [NOT INCLUDED IN ANNODEXED DOCUMENT] -->
-
-<!ELEMENT clip (meta*, a?, img?, desc?)>
-<!ATTLIST clip
-  %attrs;
-  track       CDATA          "default"
-  start       %Timestamp;    #REQUIRED
-  end         %Timestamp;    #IMPLIED
-  >
-
-<!-- A tag containing information for a specific clip -->
-<!-- ================================================ -->
-<!-- a tag contains anchor text being a textual description of the
-     link between the current element (the source anchor) and the
-     destination anchor given by the href attribute -->
-<!-- attrs    = the base language of the clip's attribute values
-                and of its content elements; the stylesheet class
-                attribute; a short title representing the anchor
-                (e.g. in tooltips) -->
-<!-- href     = specifies the location of a Web resource, thus
-                defining a link between the current element (the
-                source anchor) and the destination anchor given by
-                this attribute -->
-<!ELEMENT a (#PCDATA)>
-<!ATTLIST a
-  %attrs;
-  href        %URI;          #REQUIRED
-  >
-
-<!-- IMG tag to include a representative image for the clip -->
-<!-- ====================================================== -->
-<!-- attrs = the language of the image's attribute values;
-             the stylesheet class attribute; a short title
-             representing the image (e.g. in tooltips) -->
-<!-- src   = reference to the image                          -->
-<!-- alt   = alternative text for the image (accessibility)  -->
-<!ELEMENT img EMPTY>
-<!ATTLIST img
-  %attrs;
-  src         %URI;          #REQUIRED
-  alt         CDATA          #IMPLIED
-  >
-
-<!-- DESC human-readable, textual description of the clip
-     (annotation)                                            -->
-<!-- ======================================================= -->
-<!-- attrs    = the base language of the data in the
-                description; the class & style attributes;
-                a short title representing the desc (e.g. in
-                tooltips) -->
-<!ELEMENT desc (#PCDATA)>
-<!ATTLIST desc
-  %attrs;
-  >

Deleted: libcmml/branches/cmml4/doc/cmml_2_0.dtd
===================================================================
--- libcmml/trunk/doc/cmml_2_0.dtd	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml_2_0.dtd	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,271 +0,0 @@
-<!--
-
-   Continuous Media Markup Language CMML version 2.0 DTD
-   Authoring language for ANNODEX(TM) media.
-
-   Namespace = http://www.annodex.net/cmml
-
-   Copyright (c) 2001 
-   Commonwealth Scientific and Industrial Research Organisation
-   (CSIRO), Australia.
-   All Rights Reserved. 
-
-   This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
-   PUBLIC "-//CSIRO//DTD CMML 2.0//EN"
-   SYSTEM "http://www.annodex.net/DTD/cmml_2_0.dtd"
-
-   $Revision: 1.2 $
-   $Date: 2004/01/01 05:25:33 $
--->
-
-<!-- **************************** -->
-<!-- Definition of Imported Names -->
-<!-- **************************** -->
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType "CDATA">
- 
-<!-- a Uniform Resource Identifier, see [RFC2396] -->
-<!ENTITY % URI "CDATA">
-
-<!-- a language code, as per [RFC1766] -->
-<!ENTITY % LanguageCode "NMTOKEN">
-
-<!-- internationalization attributes
-  xml:lang    language code (as per XML 1.0 spec)
-  dir          direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang        %LanguageCode; #IMPLIED
-  dir         (ltr|rtl)      #IMPLIED"
-  >
-
-<!-- timestamps similar to [RFC2326] 
- "smpte-24:" SMPTE time with a 24 fps basis
- "smpte-24-drop:" SMPTE time with a 24/1.001 fps basis
- "smpte-25:" SMPTE time with a 25 fps basis
- "smpte-30:" SMPTE time with a 30 fps basis
- "smpte-30-drop:" SMPTE time with a 30/1.001 fps basis
- "smpte-50:" SMPTE time with a 50 fps basis
- "smpte-60:" SMPTE time with a 60 fps basis
- "smpte-60-drop:" SMPTE time with a 60/1.001 fps basis
- "npt:" npt-time
- "clock:" utc-time
-
- Playbacktime is specified as a smpte-time 
- or npt-time only.
-
- UTCtime is specified as in [RFC2326], but
- without the "clock" identifier
--->
-<!ENTITY % Timestamp    "CDATA">
-<!ENTITY % Playbacktime "CDATA">
-<!ENTITY % UTCtime      "CDATA">
-
-
-<!-- **************************** -->
-<!-- Document Structure           -->
-<!-- **************************** -->
-
-<!-- ROOT ELEMENT: -->
-<!-- cmml tag containing sequence of head and a tags -->
-<!-- =============================================== -->
-<!-- i18n  = the default language for the whole document including
-             the id tag of the cmml element -->
-<!-- xmlns = namespace of the cmml tags -->
-<!ELEMENT cmml (stream?, head, clip*)>
-<!ATTLIST cmml
-  %i18n;
-  id          ID             #IMPLIED
-  xmlns       %URI;          #FIXED 'http://www.annodex.net/cmml'
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of stream element -->
-<!-- **************************** -->
-
-<!-- STREAM tag providing timing information for the ANNODEX file -->
-<!-- (will be stored in the binary headers of the ANX bitstreams) -->
-<!-- ============================================================ -->
-<!-- (has no text attributes and thus no i18n; id tag follows default 
-      language specified in cmml tag) -->
-<!-- timebase   = base time associated with the first frame of the media 
-                  document from which subsequent time references (such as 
-                  in clip tags) will be taken relative to -->
-<!-- utc        = a mapping of the first frame to clock time; 
-                  specifications of utc time offsets into the document as
-                  in a URI will be taken relative to this -->
-<!ELEMENT stream (import*)>
-<!ATTLIST stream
-  id          ID             #IMPLIED
-  timebase    %Playbacktime; "0"
-  utc         %UTCtime;      #IMPLIED
-  >
-
-<!-- IMPORT tag giving descriptions on an input bitstream (empty content) -->
-<!-- ==================================================================== -->
-<!-- i18n        = the language of the import tag's and the contained param
-                   tags' attribute values -->
-<!-- granulerate = the base temporal resolution of the bitstream (e.g.
-                   its framerate for video or samplerate for audio) -->
-<!-- contenttype = encoding format of the input document (a MIME type and
-                   a character encoding separated by semicolon) -->
-<!-- src         = URI to the media document -->
-<!-- start       = the start time of the media bitstream specified
-                   in src -->
-<!-- end         = the end time of the media bitstream specified
-                   in src -->
-<!-- title       = human readable comment on the import bitstream -->
-<!ELEMENT import (param*)>
-<!ATTLIST import 
-  %i18n;
-  id          ID             #IMPLIED
-  granulerate CDATA          #IMPLIED
-  contenttype %ContentType;  #IMPLIED
-  src         %URI;          #REQUIRED
-  start       %Timestamp;    "0"
-  end         %Timestamp;    #IMPLIED
-  title       CDATA          #IMPLIED
-  >
-
-<!-- PARAM description tags of an input bitstream (empty content)   -->
-<!-- (name-value pairs e.g. comments on recording quality or so)    -->
-<!-- ============================================================== -->
-<!-- (internationalisation inherited from the parent import tag)    -->
-<!-- name  = identifies a property name; does not list legal values for this 
-             attribute --> 
-<!-- value = specifies a property's value; does not list legal values for 
-               this attribute -->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  id          ID             #IMPLIED
-  name        CDATA          #REQUIRED
-  value       CDATA          #REQUIRED
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of document head  -->
-<!-- **************************** -->
-
-<!-- head tag containing description of a specific media document -->
-<!-- ============================================================ -->
-<!-- i18n    = the base language of the head's attribute values and text 
-               content -->
-<!-- profile = space-separated list of URIs to locate meta tag schemes -->
-<!ELEMENT head (meta*,
-                ((title, meta*, (base, meta*)?) |
-		 (base, meta*, (title, meta*)?)))>
-<!ATTLIST head
-  %i18n;
-  id          ID             #IMPLIED
-  profile     %URI;          #IMPLIED
-  >
-
-<!-- TITLE tag giving descriptive title of the media document  -->
-<!-- ========================================================= -->
-<!-- i18n  = the language of the title text -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title 
-  %i18n;
-  id          ID             #IMPLIED
-  >
-
-<!-- BASE URI of the document (empty content) --> 
-<!-- ======================================== -->
-<!-- (internationalisation inherited from the parent head tag) -->
-<!-- href = URI associated with the document; all relative URI references
-            get interpreted relative to this base -->
-<!ELEMENT base EMPTY>
-<!ATTLIST base
-  id          ID             #IMPLIED
-  href        %URI;          #REQUIRED
-  >
-
-<!-- META description tags of the document (empty content) -->
-<!-- ===================================================== -->
-<!-- i18n    = the language of the meta attributes -->
-<!-- name    = identifies a property name; does not list legal values for this 
-               attribute --> 
-<!-- content = specifies a property's value; does not list legal values for 
-               this attribute -->
-<!-- scheme  = names a scheme to be used to interpret the property's value 
-               (see the profiles tag in the head element for locating these) -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
-  %i18n;
-  id          ID             #IMPLIED
-  name        NMTOKEN        #IMPLIED
-  content     CDATA          #REQUIRED
-  scheme      CDATA          #IMPLIED
-  >
-
-<!-- ************************** -->
-<!-- Definition of clip tags    -->
-<!-- ************************** -->
-
-<!-- Clip tag containing information for a specific fragment -->
-<!-- ======================================================= -->
-<!-- though meta, a, img and desc are given in specific order
-     here, their order is acutally random -->
-<!-- i18n     = the base language of the clip's attribute values and 
-                of its content elements -->
-<!-- id       = name of the clip used in URI clip references -->
-<!-- track    = defines different sets of clip tags; clip tags of same 
-                type cannot overlap temporally -->
-<!-- start    = specifies the start time of the clip; specified in 
-                time relative to the timebase of the header 
-                [NOT INCLUDED IN ANNODEX DOCUMENT] -->
-<!-- end      = specifies the end time of the clip; specified in 
-                time relative to the timebase of the header 
-                [NOT INCLUDED IN ANNODEX DOCUMENT] -->
-<!ELEMENT clip (meta*, a?, img?, desc?)>
-<!ATTLIST clip
-  %i18n;
-  id          ID             #IMPLIED
-  track       CDATA          "default"
-  start       %Timestamp;    #REQUIRED
-  end         %Timestamp;    #IMPLIED
-  >
-
-<!-- A tag containing information for a specific clip -->
-<!-- ================================================ -->
-<!-- a tag contains anchor text being a textual description of the link 
-     between the current element (the source anchor) and the destination
-     anchor given by the href attribute -->
-<!-- i18n     = language of the anchor's attribute values and anchor text -->
-<!-- class    = overriding style sheet defaults for this instance -->
-<!-- href     = specifies the location of a Web resource, thus defining a 
-                link between the current element (the source anchor) and the 
-                destination anchor given by this attribute -->
-<!ELEMENT a (#PCDATA)>
-<!ATTLIST a
-  %i18n;
-  id          ID             #IMPLIED
-  class       CDATA          #IMPLIED
-  href        %URI;          #REQUIRED
-  >
-
-<!-- IMG tag to include a representative image for the clip -->
-<!-- ====================================================== -->
-<!-- i18n = language of the image's attribute values        -->
-<!-- src  = reference to the image                          -->
-<!-- alt  = alternative text for the image (accessibility)  -->
-<!ELEMENT img EMPTY>
-<!ATTLIST img
-  %i18n;
-  id          ID             #IMPLIED
-  src         %URI;          #REQUIRED
-  alt         CDATA          #IMPLIED
-  >
-
-<!-- DESC human-readable, textual description of the clip (annotation) -->
-<!-- ================================================================= -->
-<!-- i18n = language of the data in the description -->
-<!ELEMENT desc (#PCDATA)>
-<!ATTLIST desc
-  %i18n;
-  id          ID             #IMPLIED
-  >

Deleted: libcmml/branches/cmml4/doc/cmml_2_1.dtd
===================================================================
--- libcmml/trunk/doc/cmml_2_1.dtd	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml_2_1.dtd	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,350 +0,0 @@
-<!--
-
-  Continuous Media Markup Language CMML version 2.1 DTD
-  Authoring language for ANNODEX(TM) media.
-
-  Namespace = http://www.annodex.net/cmml
-
-  Copyright (c) 2001- 
-  Commonwealth Scientific and Industrial Research Organisation
-  (CSIRO), Australia.
-  All Rights Reserved. 
-
-  This DTD module is identified by the PUBLIC and SYSTEM identifiers:
-
-  PUBLIC "-//CSIRO//DTD CMML 2.1//EN"
-  SYSTEM "http://www.annodex.net/DTD/cmml_2_1.dtd"
-
-  $Revision: 2.1 $
-  $Date: 2006/03/04 24:00:00 $
--->
-
-<!-- **************************** -->
-<!-- Definition of Imported Names -->
-<!-- **************************** -->
-
-<!-- media type, as per [RFC2045] -->
-<!ENTITY % ContentType "CDATA">
- 
-<!-- space-separated list of link types -->
-<!ENTITY % LinkTypes "CDATA">
-
-<!-- single or comma-separated list of media descriptors -->
-<!ENTITY % MediaDesc "CDATA">
-
-<!-- used for titles etc. -->
-<!ENTITY % Text "CDATA">
-
-<!-- a Uniform Resource Identifier, see [RFC2396] -->
-<!ENTITY % URI "CDATA">
-
-<!-- a language code, as per [RFC1766] -->
-<!ENTITY % LanguageCode "NMTOKEN">
-
-<!-- timestamps similar to [RFC2326] 
- "smpte-24:" SMPTE time with a 24 fps basis
- "smpte-24-drop:" SMPTE time with a 24/1.001 fps basis
- "smpte-25:" SMPTE time with a 25 fps basis
- "smpte-30:" SMPTE time with a 30 fps basis
- "smpte-30-drop:" SMPTE time with a 30/1.001 fps basis
- "smpte-50:" SMPTE time with a 50 fps basis
- "smpte-60:" SMPTE time with a 60 fps basis
- "smpte-60-drop:" SMPTE time with a 60/1.001 fps basis
- "npt:" npt-time
- "clock:" utc-time
-
- Playbacktime is specified as a smpte-time 
- or npt-time only.
-
- UTCtime is specified as in [RFC2326], but
- without the "clock" identifier
--->
-<!ENTITY % Timestamp    "CDATA">
-<!ENTITY % Playbacktime "CDATA">
-<!ENTITY % UTCtime      "CDATA">
-
-
-<!-- ******************************** -->
-<!-- Definition of Generic Attributes -->
-<!-- ******************************** -->
-
-<!-- core attributes common to most displayable elements
-  id       document-wide unique id
-  class    space separated list of classes
-  title    advisory title/amplification
--->
-<!ENTITY % coreattrs
- "id          ID                #IMPLIED
-  class       CDATA             #IMPLIED
-  title       %Text;            #IMPLIED"
-  >
-
-<!-- internationalization attributes
-  xml:lang    language code (as per XML 1.0 spec)
-  dir         direction for weak/neutral text
--->
-<!ENTITY % i18n
- "lang        %LanguageCode; #IMPLIED
-  dir         (ltr|rtl)      #IMPLIED"
-  >
-
-<!ENTITY % attrs "%coreattrs; %i18n;">
-
-
-<!-- **************************** -->
-<!-- Document Structure           -->
-<!-- **************************** -->
-
-<!-- ROOT ELEMENT: -->
-<!-- cmml tag containing sequence of head and a tags -->
-<!-- =============================================== -->
-<!-- i18n  = the default language for the whole document including
-             the id tag of the cmml element -->
-<!-- xmlns = namespace of the cmml tags -->
-<!-- granulerate = the base temporal resolution to be used for the
-                   cmml bitstream -->
-<!ELEMENT cmml (stream?, head, clip*)>
-<!ATTLIST cmml
-  %i18n;
-  id          ID             #IMPLIED
-  xmlns       %URI;          #FIXED 'http://www.annodex.net/cmml'
-  granulerate CDATA          #IMPLIED
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of stream element -->
-<!-- **************************** -->
-
-<!-- STREAM tag providing timing information for the ANNODEX file -->
-<!-- (will be stored in the binary headers of the ANX bitstreams) -->
-<!-- ============================================================ -->
-<!-- (has no text attributes and thus no i18n; id tag follows default 
-      language specified in cmml tag) -->
-<!-- basetime  = base time associated with the first frame of the
-                 media document from which subsequent time references
-                 (such as in clip tags) will be taken relative to -->
-<!-- timebase  = same as basetime; kept for backwards compatibility;
-                 deprecated and will not be used in versions>=3.0 -->
-<!-- utc       = a mapping of the first frame to clock time; 
-                 specifications of utc time offsets into the document
-                 as in a URI will be taken relative to this -->
-<!ELEMENT stream (import*)>
-<!ATTLIST stream
-  id          ID             #IMPLIED
-  basetime    %Playbacktime; "0"
-  timebase    %Playbacktime; "0"
-  utc         %UTCtime;      #IMPLIED
-  >
-
-<!-- IMPORT tag giving descriptions on an input bitstream
-     (empty content)                                              -->
-<!-- ============================================================ -->
-<!-- i18n        = the language of the import tag's and the contained
-                   param tags' attribute values -->
-<!-- title       = human readable comment on the import bitstream -->
-<!-- granulerate = the base temporal resolution of the bitstream
-                   (e.g. its framerate for video or samplerate for
-                   audio) -->
-<!-- contenttype = encoding format of the input document (a MIME type
-                   and a character encoding separated by semicolon)
-                   -->
-<!-- src         = URI to the media document -->
-<!-- start       = the start time of the media bitstream specified
-                   in src -->
-<!-- end         = the end time of the media bitstream specified
-                   in src -->
-<!ELEMENT import (param*)>
-<!ATTLIST import 
-  %i18n;
-  id          ID             #IMPLIED
-  title       %Text;         #IMPLIED
-  granulerate CDATA          #IMPLIED
-  contenttype %ContentType;  #IMPLIED
-  src         %URI;          #REQUIRED
-  start       %Timestamp;    "0"
-  end         %Timestamp;    #IMPLIED
-  >
-
-<!-- PARAM description tags of an input bitstream (empty content) -->
-<!-- (name-value pairs e.g. comments on recording quality or so)  -->
-<!-- ============================================================ -->
-<!-- (internationalisation inherited from the parent import tag)  -->
-<!-- name  = identifies a property name; does not list legal values
-             for this attribute --> 
-<!-- value = specifies a property's value; does not list legal values
-             for this attribute -->
-<!ELEMENT param EMPTY>
-<!ATTLIST param
-  id          ID             #IMPLIED
-  name        CDATA          #REQUIRED
-  value       CDATA          #REQUIRED
-  >
-
-
-<!-- **************************** -->
-<!-- Definition of document head  -->
-<!-- **************************** -->
-
-<!-- head tag containing description of a specific media stream -->
-<!-- ========================================================== -->
-<!-- i18n    = the base language of the head's attribute values
-               and text content -->
-<!-- profile = space-separated list of URIs to locate meta tag
-               schemes -->
-
-<!-- content model is %head.misc; combined with a single
-     title and an optional base element in any order -->
-<!ENTITY % head.misc "(meta|link)*">
-<!ELEMENT head (%head.misc;,
-                ((title, %head.misc;, (base, %head.misc;)?) |
-                 (base, %head.misc;, (title, %head.misc;))))>
-<!ATTLIST head
-  %i18n;
-  id          ID             #IMPLIED
-  profile     %URI;          #IMPLIED
-  >
-
-<!-- TITLE tag giving descriptive title of the media document  -->
-<!-- ========================================================= -->
-<!-- i18n  = the language of the title text -->
-<!ELEMENT title (#PCDATA)>
-<!ATTLIST title 
-  %i18n;
-  id          ID             #IMPLIED
-  >
-
-
-<!-- BASE URI of the document (empty content) --> 
-<!-- ======================================== -->
-<!-- (internationalisation inherited from the parent head tag) -->
-<!-- href = URI associated with the document; all relative URI
-            references get interpreted relative to this base -->
-<!ELEMENT base EMPTY>
-<!ATTLIST base
-  id          ID             #IMPLIED
-  href        %URI;          #REQUIRED
-  >
-
-<!-- META description tags of the document (empty content) -->
-<!-- ===================================================== -->
-<!-- i18n    = the language of the meta attributes -->
-<!-- name    = identifies a property name; does not list legal
-               values for this attribute --> 
-<!-- content = specifies a property's value; does not list legal
-               values for this attribute -->
-<!-- scheme  = names a scheme to be used to interpret the property's
-               value (see the profiles tag in the head element for
-               locating these) -->
-<!ELEMENT meta EMPTY>
-<!ATTLIST meta
-  %i18n;
-  id          ID             #IMPLIED
-  name        NMTOKEN        #IMPLIED
-  content     CDATA          #REQUIRED
-  scheme      CDATA          #IMPLIED
-  >
-
-<!-- LINK tag to specify relationship values (empty content) --> 
-<!-- ======================================================= -->
-<!-- Relationship values can be used in principle:
-     a) for document specific toolbars/menus when used
-        with the link element in document head e.g.
-        start, contents, previous, next, index, end, help
-     b) to link to a separate style sheet (rel="stylesheet")
-     As charsets are given in the xml directive of cmml documents,
-     this attribute of html is not required for cmml.
-  -->
-<!-- attrs = the language of the title text; a short description of
-             the relationship through title, and the stylesheet class
-             -->
-<!-- href  = reference to a related document -->
-<!-- type  = type of the document referenced, e.g. "text/css" -->
-<!-- rel   = type of relationship to forward linked document -->
-<!-- rev   = type of relationship to reverse linked document -->
-<!-- media = type or medium/media to be rendered on, default "screen"
-             -->
-
-<!ELEMENT link EMPTY>
-<!ATTLIST link
-  %attrs;
-  href        %URI;          #IMPLIED
-  type        %ContentType;  #IMPLIED
-  rel         %LinkTypes;    #IMPLIED
-  rev         %LinkTypes;    #IMPLIED
-  media       %MediaDesc;    #IMPLIED
-  >
-
-
-<!-- ************************** -->
-<!-- Definition of clip tags    -->
-<!-- ************************** -->
-
-<!-- Clip tag containing information for a specific fragment -->
-<!-- ======================================================= -->
-<!-- through meta, a, img and desc are given in specific order
-     here, their order is acutally random -->
-<!-- attrs    = the base language of the clip's attribute values and 
-                of its content elements; a short title representing
-                the anchor (e.g. in tooltips) -->
-<!-- track    = defines different sets of clip tags; clip tags of
-                same type cannot overlap temporally -->
-<!-- start    = specifies the start time of the clip; specified in 
-               time relative to the basetime of the header 
-                [NOT INCLUDED IN ANNODEXED DOCUMENT] -->
-<!-- end      = specifies the end time of the clip; specified in 
-                time relative to the basetime of the header 
-                [NOT INCLUDED IN ANNODEXED DOCUMENT] -->
-
-<!ELEMENT clip (meta*, a?, img?, desc?)>
-<!ATTLIST clip
-  %attrs;
-  track       CDATA          "default"
-  start       %Timestamp;    #REQUIRED
-  end         %Timestamp;    #IMPLIED
-  >
-
-<!-- A tag containing information for a specific clip -->
-<!-- ================================================ -->
-<!-- a tag contains anchor text being a textual description of the
-     link between the current element (the source anchor) and the
-     destination anchor given by the href attribute -->
-<!-- attrs    = the base language of the clip's attribute values
-                and of its content elements; the stylesheet class
-                attribute; a short title representing the anchor
-                (e.g. in tooltips) -->
-<!-- href     = specifies the location of a Web resource, thus
-                defining a link between the current element (the
-                source anchor) and the destination anchor given by
-                this attribute -->
-<!ELEMENT a (#PCDATA)>
-<!ATTLIST a
-  %attrs;
-  href        %URI;          #REQUIRED
-  >
-
-<!-- IMG tag to include a representative image for the clip -->
-<!-- ====================================================== -->
-<!-- attrs = the language of the image's attribute values;
-             the stylesheet class attribute; a short title
-             representing the image (e.g. in tooltips) -->
-<!-- src   = reference to the image                          -->
-<!-- alt   = alternative text for the image (accessibility)  -->
-<!ELEMENT img EMPTY>
-<!ATTLIST img
-  %attrs;
-  src         %URI;          #REQUIRED
-  alt         CDATA          #IMPLIED
-  >
-
-<!-- DESC human-readable, textual description of the clip
-     (annotation)                                            -->
-<!-- ======================================================= -->
-<!-- attrs    = the base language of the data in the
-                description; the class & style attributes;
-                a short title representing the desc (e.g. in
-                tooltips) -->
-<!ELEMENT desc (#PCDATA)>
-<!ATTLIST desc
-  %attrs;
-  >

Added: libcmml/branches/cmml4/doc/cmml_4_0.xsd
===================================================================
--- libcmml/branches/cmml4/doc/cmml_4_0.xsd	                        (rev 0)
+++ libcmml/branches/cmml4/doc/cmml_4_0.xsd	2008-04-13 06:22:17 UTC (rev 3551)
@@ -0,0 +1,412 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<xs:schema version="1.0" xml:lang="en" 
+           xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://www.annodex.org/cmml4.0"
+           xmlns="http://www.annodex.org/cmml4.0"
+           xmlns:html="http://www.w3.org/1999/xhtml"
+           elementFormDefault="qualified">
+
+  <xs:annotation>
+    <xs:documentation>
+      Continuous Media Markup Language CMML version 4.0 in XML Schema
+ 
+      CMML is a language to describe a timed text track, i.e. a timed text codec.
+
+      Namespace = http://www.annodex.org/cmml4.0
+      XHTML1 can be found here: http://www.w3.org/TR/xhtml1-schema/
+
+      For further information, see: http://www.annodex.net/
+
+      Copyright (c) 2008- Annodex Association, Xiph.Org.
+      All Rights Reserved. 
+
+      $Revision: 4.0 $
+      $Date$
+      $Id: cmml_4_0.xsd 2008/02/01 13:00:00 ginger $
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:import namespace="http://www.w3.org/1999/xhtml"
+      schemaLocation="http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd"/>
+
+  <xs:annotation>
+    <xs:documentation>
+      ================== Simple Types ====================================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    Simple Types in use in this XML schema and inherited from xhtml:
+    html:ContentType
+    html:LinkTypes
+    html:MediaDesc
+    html:Text
+    html:URI
+    html:LanguageCode
+    html:FrameTarget
+    html:Length
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="TTextType">
+    <xs:annotation>
+      <xs:documentation>
+      timed text types, e.g. closed-caption, annotation, subtitle, transcript, ticker
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:simpleType name="Timestamp">
+    <xs:annotation>
+      <xs:documentation>
+      timestamps similar to [RFC2326]
+       "smpte-24:" SMPTE time with a 24 fps basis
+       "smpte-24-drop:" SMPTE time with a 24/1.001 fps basis
+       "smpte-25:" SMPTE time with a 25 fps basis
+       "smpte-30:" SMPTE time with a 30 fps basis
+       "smpte-30-drop:" SMPTE time with a 30/1.001 fps basis
+       "smpte-50:" SMPTE time with a 50 fps basis
+       "smpte-60:" SMPTE time with a 60 fps basis
+       "smpte-60-drop:" SMPTE time with a 60/1.001 fps basis
+       "npt:" npt-time
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string" />
+  </xs:simpleType>
+
+  <xs:simpleType name="Playbacktime">
+    <xs:annotation>
+      <xs:documentation>
+      timestamps similar to [RFC2326] 
+      "smpte-24:" SMPTE time with a 24 fps basis
+      "smpte-24-drop:" SMPTE time with a 24/1.001 fps basis
+      "smpte-25:" SMPTE time with a 25 fps basis
+      "smpte-30:" SMPTE time with a 30 fps basis
+      "smpte-30-drop:" SMPTE time with a 30/1.001 fps basis
+      "smpte-50:" SMPTE time with a 50 fps basis
+      "smpte-60:" SMPTE time with a 60 fps basis
+      "smpte-60-drop:" SMPTE time with a 60/1.001 fps basis
+      "npt:" npt-time
+      no clock time
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string" />
+  </xs:simpleType>
+
+  <xs:simpleType name="UTCtime">
+    <xs:annotation>
+      <xs:documentation>
+      UTCtime is specified as in [RFC2326], but without the "clock" identifier
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string"/>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Generic Attributes ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    attribute groups in use in this XML schema and inherited from xhtml:
+    html:coreattrs
+    html:i18n
+    html:attrs
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Structure ===============================
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Root Element ===============================
+    cmml tag containing sequence of one head and n clip tags
+    i18n        = the default language for the whole document including
+                  the id tag of the cmml element
+    xmlns       = namespace of the cmml tags
+    role        = describes what type of text track this CMML file represents,
+                  such as e.g. closed-caption, annotation, subtitle, transcript,
+                  ticker
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="cmml">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="head"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="clip"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="html:i18n"/>
+      <xs:attribute name="role" type="TTextType"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Document Head ===============================
+    head tag containing description of a specific timed text track
+    i18n    = the base language of the head's attribute values and text 
+               content
+    profile = space-separated list of URIs to locate meta tag schemes
+    </xs:documentation>
+  </xs:annotation>
+
+  <!-- content model is not quite right yet -->
+  <xs:element name="head">
+    <xs:annotation>
+      <xs:documentation>
+      Title is the title of the media file
+      Img is an optional representative image for the full media file
+      Base is an optional base URL for the full media file
+      Style is style sheet for the document
+      Meta is a collection of meta tags for the document
+      Link points to related documents
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:all minOccurs="0">
+        <xs:element ref="title" />
+        <xs:element ref="img" />
+        <xs:element ref="base" />          
+      </xs:all>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="style"/>
+        <xs:element ref="meta"/>
+        <xs:element ref="link"/>
+      </xs:choice>
+      <xs:attributeGroup ref="html:i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="profile" type="html:URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Title ===============================
+    title tag giving descriptive title of the media document
+    i18n    = the language of the title text
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="title">
+    <xs:annotation>
+      <xs:documentation>
+      The title element is not considered part of the presentation.
+      It should be displayed, for example as the page header or
+      window title. Exactly one title is required per document.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="html:i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Img ===========================================
+    To avoid accessibility problems for people who aren't
+    able to see the image, you should provide a text
+    description using the alt and longdesc attributes.
+    attrs = the language of the image's attribute values;
+            the stylesheet class attribute; a short title
+            representing the image (e.g. in tooltips)
+    src   = reference to the image
+    alt   = alternative text for the image (accessibility)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="src" use="required" type="URI"/>
+      <xs:attribute name="alt" use="required" type="Text"/>
+      <xs:attribute name="longdesc" type="html:URI"/>
+      <xs:attribute name="height" type="html:Length"/>
+      <xs:attribute name="width" type="html:Length"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Base URI ===============================
+    base URI of the document (empty content)
+    i18n    = the language of the title text
+    href    = URI associated with the document; all relative URI references
+              get interpreted relative to this base -->
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="base">
+    <xs:annotation>
+      <xs:documentation>
+      (internationalisation inherited from the parent head tag)
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="href" type="html:URI"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Meta ===============================
+    description tags of the document (empty content)
+    i18n    = the language of the meta attributes
+    name    = identifies a property name; does not list legal values for this 
+	          attribute
+    content = specifies a property's value; does not list legal values for 
+	          this attribute
+    scheme  = names a scheme to be used to interpret the property's value 
+	          (see the profiles tag in the head element for locating these)
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="meta">
+    <xs:complexType>
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="http-equiv"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="content" use="required"/>
+      <xs:attribute name="scheme"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Link ===============================
+    LINK tag to specify relationship values (empty content)
+    attrs = the language of the title text; a short description of the
+            relationship through title, and the stylesheet class
+    href  = reference to a related document
+    type  = type of the document referenced, e.g. "text/css"
+    rel   = type of relationship to forward linked document
+    rev   = type of relationship to reverse linked document
+    media = type or medium/media to be rendered on, default "screen"
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="link">
+    <xs:complexType>
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="href" type="URI"/>
+      <xs:attribute name="type" type="html:ContentType"/>
+      <xs:attribute name="rel" type="html:LinkTypes"/>
+      <xs:attribute name="rev" type="html:LinkTypes"/>
+      <xs:attribute name="media" type="html:MediaDesc"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Style ===============================
+    STYLE tag to specify presentation styles
+    i18n  = the language of the style's title attribute
+    title = short description of the style
+    type  = type of the document referenced, e.g. "text/css"
+    media = type or medium/media to be rendered on, default "screen"
+    xml:space = fixed to preserve whitespace characters in content
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="style">
+    <xs:annotation>
+      <xs:documentation>
+      The content of the "style" element is a style sheet.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="i18n"/>
+      <xs:attribute name="id" type="xs:ID"/>
+      <xs:attribute name="title" type="html:Text"/>
+      <xs:attribute name="type" use="required" type="html:ContentType"/>
+      <xs:attribute name="media" type="html:MediaDesc"/>
+      <xs:attribute ref="xml:space" fixed="preserve"/>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:annotation>
+    <xs:documentation>
+    =================== Clip Elements ===============================
+    Clip tag containing information for a specific fragment
+    attrs    = the base language of the clip's attribute values and 
+               of its content elements; the stylesheet class attribute;
+               a short title representing the clip (e.g. in tooltips)
+    track    = defines different sets of clip tags; clip tags of same 
+               type cannot overlap temporally
+    start    = specifies the start time of the clip; specified in 
+               time relative to the basetime of the header 
+               [NOT INCLUDED IN OGG DOCUMENT]
+    end      = specifies the end time of the clip; specified in 
+               time relative to the basetime of the header 
+               [NOT INCLUDED IN OGG DOCUMENT]
+    </xs:documentation>
+  </xs:annotation>
+
+  <!-- content model is not quite right yet -->
+  <xs:element name="clip">
+    <xs:complexType>
+      <xs:all>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="meta"/>
+          <xs:element ref="style"/>
+        </xs:choice>          
+        <xs:element ref="a" minOccurs="0" maxOccurs="1"/>
+        <xs:element ref="img" minOccurs="0" maxOccurs="1"/>
+        <xs:element ref="html:body" minOccurs="0" maxOccurs="1"/>
+      </xs:all>
+      <xs:attributeGroup ref="html:attrs"/>
+      <xs:attribute name="start" type="Timestamp"/>
+      <xs:attribute name="end" type="Timestamp"/>
+    </xs:complexType>
+  </xs:element>
+
+
+  <xs:annotation>
+    <xs:documentation>
+    ================== The Anchor Element ================================
+    A tag containing information for a specific clip 
+    attrs    = the base language of the clip's attribute values and 
+               of its content elements; the stylesheet class attribute;
+               a short title representing the anchor (e.g. in tooltips)
+    href     = specifies the location of a Web resource, thus defining a 
+               link between the current element (the source anchor) and the 
+               destination anchor given by this attribute
+    rel      = Specifies the relationship between the current document and
+               the target URL
+    rev      = Specifies the relationship between the target URL and the
+               current document
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="a">
+    <xs:annotation>
+      <xs:documentation>
+      a tag contains anchor text being a textual description of the link
+      between the current element (the source anchor) and the destination
+      anchor given by the href attribute
+      </xs:documentation>
+    </xs:annotation>
+    <xs:complexType mixed="true">
+      <xs:attributeGroup ref="attrs"/>
+      <xs:attribute name="href" type="html:URI"/>
+      <xs:attribute name="hreflang" type="html:LanguageCode"/>
+      <xs:attribute name="rel" type="html:LinkTypes"/>
+      <xs:attribute name="rev" type="html:LinkTypes"/>
+      <xs:attribute name="target" type="html:FrameTarget"/> 
+      <xs:attribute name="type" type="html:ContentType"/>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>

Modified: libcmml/branches/cmml4/doc/cmml_dox.h
===================================================================
--- libcmml/trunk/doc/cmml_dox.h	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/doc/cmml_dox.h	2008-04-13 06:22:17 UTC (rev 3551)
@@ -110,7 +110,7 @@
  * The libcmml <b>API documentation</b> can be found <a
  * href="globals_func.html">here</a>. The API of libcmml is based on a
  * convenient callback based framework for parsing CMML files. This
- * enables activation of actions for the stream, head and clip tags
+ * enables activation of actions for the head and clip tags
  * while reading a CMML file. After opening a CMML file for reading,
  * you attach callbacks to each of these types of tags. Then, as bytes
  * are read, libcmml will call your callbacks as appropriate. Check
@@ -159,7 +159,7 @@
  * libcmml provides a convenient callback based framework for reading
  * CMML files. After opening a CMML file for reading, you can attach
  * various callbacks relevant to the parts of the file you are
- * interested in, including the stream element, head element, and clip
+ * interested in, including the head element, and clip
  * elements. Then, as bytes are read, libcmml will call your callbacks
  * as appropriate.
  *
@@ -227,8 +227,7 @@
  * <b>Seeking to a temporal offset into a CMML file</b>
  *
  * Sometimes you'll need to seek to a temporal offset in seconds into
- * a CMML file. Note: The seconds offset is calculated with respect to
- * the basetime attribute of the stream tag. libcmml provides an API
+ * a CMML file. libcmml provides an API
  * for this functionality through the cmml_skip_to_secs() function.
  *
  * The procedure is illustrated in cmml-seek-offset.c, which seeks to
@@ -238,22 +237,6 @@
  */
 
 /**
- * \example cmml-seek-utc.c 
- * <b>Seeking to a utc time offset into a CMML file</b>
- *
- * Sometimes you'll need to seek to a temporal offset in utc into a
- * CMML file. Note: The utc offset is calculated with respect to the
- * utc and basetime attributes of the stream tag. libcmml provides an
- * API for this functionality through the cmml_skip_to_utc()
- * function.
- *
- * The procedure is illustrated in cmml-seek-utc.c, which seeks to an
- * offset given in utc and prints out the descriptions of all the
- * following clips:
- *
- */
-
-/**
  * \example cmml-uri-file.c 
  * <b>Parse a CMML file given through a file uri (optionally with a
  * fragment offset)</b>
@@ -294,17 +277,9 @@
  * \section preamble The preamble
  *
  * After the usual preamble including the xml processing instruction
- * and the doctype declaration, the root <b>cmml tag</b> houses the
- * markup.
+ * (but excluding the doctype declaration), the root <b>cmml tag</b> houses
+ * the markup.
  *
- * \section streamintro The stream tag
- *
- * The first markup will usually be a <b>stream</b> tag which names
- * the source media file(s) that the markup of the CMML file relates
- * to. The stream tag is optional as you may want to prepare a CMML
- * file for a not yet existing media file, for a live media stream, or
- * just as a template.
- *
  * \section headintro The head tag
  *
  * The <b>head</b> tag is mandatory as with html. It will at least
@@ -339,17 +314,9 @@
  *
  * Using time specifications in CMML is powerful but somewhat
  * confusing. So, we describe it here in more detail. CMML has
- * specifications of time in the stream and the clip tag.  There are
- * two different concepts of time specifications possible in CMML: utc
- * time and playback time.
+ * specifications of time in the clip tag. The time concept
+ * is based on playback time.
  *
- * \section stream The stream tag
- *
- * The stream tag contains specifications of the INPUT media
- * document(s) in the media tags. Conversely, the attributes of the
- * stream tag refer to the OUTPUT annodex media document for which
- * this CMML file provides the markup.
- *
  * \subsection tb Basetime attribute 
  *
  * The basetime attribute maps the first frame of the OUTPUT annodex
@@ -357,11 +324,6 @@
  * frame. This playback time can be given as npt or some smpte
  * specification given as a name-value pair, and it defaults to 0.
  *
- * \subsection utc Utc attribute
- *
- * The optional utc attribute maps the basetime to a real-world clock
- * time. It is given as a utc value.
- *
  * \subsection start Start attribute of source tags 
  *
  * The start attribute specifies the insertion time of the specified
@@ -369,14 +331,10 @@
  * at which this media document (offset by seekoffset time) will start
  * within the OUTPUT Annodexed file. It will usually be given as a npt
  * or smpte time, which has to be greater than the basetime given in
- * the stream tag (or just greater than 0 if there is not basetime
+ * the stream tag (or just greater than 0 if there is no basetime
  * given).  The value is given as a name-value pair separated by a
- * colon ":" though the name can be omitted if using npt. The start
- * attribute can also be given as a plain utc time, which has to be
- * some time after the utc time given in the stream tag. utc
- * specification is not possible when the utc attribute in the stream
- * tag is not given. The default value for the start attribute is
- * "npt:0".
+ * colon ":" though the name can be omitted if using npt. The default
+ * value for the start attribute is "npt:0".
  *
  * \subsection end End attribute of source tags
  *
@@ -455,27 +413,6 @@
  */
 
 /** 
- * \defgroup multitracks Multitrack input media in CMML
- *
- * With CMML it is possible to create markup for several, potentially
- * interleaved, media files. This is specified in the <b>stream</b>
- * tag by giving several <b>source</b> tags which each point to a
- * media file. The "start" tag specifies at what time the media file
- * should be inserted. In case of temporally overlapping media files
- * they are regarded as interleaved files.
- *
- * This is an example of such a specification:
-\verbatim
-<stream basetime="npt:0">
-  <import contenttype="video/x-theora" src="fish.ogg" start="npt:0"/>
-  <import contenttype="audio/x-vorbis" src="fishsound.ogg" start="npt:0"/>
-  <import contenttype="audio/x-speex" src="comments.spx" start="npt:7"/>
-</stream>
-\endverbatim
- *
- */
-
-/** 
  * \defgroup multicliptrack Multitrack annotations in CMML
  *
  * The default case for CMML is to have one annotation track with

Modified: libcmml/branches/cmml4/examples/Makefile.am
===================================================================
--- libcmml/trunk/examples/Makefile.am	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/examples/Makefile.am	2008-04-13 06:22:17 UTC (rev 3551)
@@ -32,7 +32,7 @@
 AM_CFLAGS = -Wall -pedantic
 
 noinst_PROGRAMS = cmml-parse cmml-write \
-		  cmml-seek-clip cmml-seek-offset cmml-seek-utc \
+		  cmml-seek-clip cmml-seek-offset \
 		  cmml-uri-file
 CMMLDIR = src
 INCLUDES = -I${top_srcdir}/$(CMMLDIR)
@@ -55,10 +55,6 @@
 cmml_seek_offset_SOURCES = cmml-seek-offset.c
 cmml_seek_offset_LDADD = ${CMML_LIBS}
 
-# cmml-seek-utc:
-cmml_seek_utc_SOURCES = cmml-seek-utc.c
-cmml_seek_utc_LDADD = ${CMML_LIBS}
-
 # cmml-uri-file:
 cmml_uri_file_SOURCES = cmml-uri-file.c
 cmml_uri_file_LDADD = ${CMML_LIBS}

Deleted: libcmml/branches/cmml4/examples/cmml-seek-utc.c
===================================================================
--- libcmml/trunk/examples/cmml-seek-utc.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/examples/cmml-seek-utc.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,95 +0,0 @@
-/** Copyright (C) 2003 CSIRO Australia
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   
-   - Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-   
-   - Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in the
-   documentation and/or other materials provided with the distribution.
-   
-   - Neither the name of the CSIRO nor the names of its
-   contributors may be used to endorse or promote products derived from
-   this software without specific prior written permission.
-   
-   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-   PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ORGANISATION OR
-   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include <stdio.h>
-
-#include <cmml.h>
-
-/**
- * \file
- * cmml-seek-utc:
- *
- * A simple example program to show how to seek to a temporal offset
- * given as a utc time in a CMML instance document and print out the
- * descriptions of all clips from there. Error handling is ignored.
- */
-
-/** the reading buffer's size */
-#define BUFSIZE 100000
-
-/**
- * read_clip: the callback for a clip element
- *
- * \param cmml the CMML* handle in use
- * \param clip the clip element's content represented in a
- *        CMML_Clip*
- * \param user_data user defined data
- *
- * \returns 0 on success, 1 on error
- */
-static int
-read_clip (CMML * cmml, const CMML_Clip * clip, void * user_data) {
-  puts(clip->desc_text);
-  return 0;
-}
-
-/**
- * main function of cmml-seek-clip, which opens the CMML file, seeks
- * to the clip_id, registers the callbacks, and then steps through
- * the file in chunks of BUFSIZE size, during which the callbacks get
- * activated as the relevant elements get parsed.
- */
-int main(int argc, char *argv[])
-{
-  char *filename = NULL;
-  CMML * doc;
-  char *utc = NULL;
-  long n = 0;
-
-  if (argc < 2) {
-    fprintf (stderr, "Usage: %s <CMMLfile> <utc>\n", argv[0]);
-    exit (1);
-  }
-  filename = argv[1];
-  utc = argv[2];
-
-  doc = cmml_open(filename);
- 
-  /* seek to time offset; if not found, to file end */
-  cmml_skip_to_utc (doc, utc);
-
-  cmml_set_read_callbacks (doc, NULL, NULL, read_clip, NULL);
- 
-  while (((n = cmml_read (doc, BUFSIZE)) > 0));
-   
-  cmml_close(doc);
-
-  return 0;
-}

Modified: libcmml/branches/cmml4/examples/cmml-uri-file-open.c
===================================================================
--- libcmml/trunk/examples/cmml-uri-file-open.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/examples/cmml-uri-file-open.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -120,7 +120,6 @@
  *
  * Fragments may be given to the uri in one of two forms:
  * - #name - name is the value of an clip's id tag
- * - #clock:YYYYMMDDThhmmss.ffZ - this is a utc time; npt or smpte also possible
  */
 int main(int argc, char *argv[])
 {

Modified: libcmml/branches/cmml4/examples/cmml-uri-file.c
===================================================================
--- libcmml/trunk/examples/cmml-uri-file.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/examples/cmml-uri-file.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -120,7 +120,6 @@
  *
  * Fragments may be given to the uri in one of two forms:
  * - #name - name is the value of an clip's id tag
- * - #clock:YYYYMMDDThhmmss.ffZ - this is a utc time; npt or smpte also possible
  */
 int main(int argc, char *argv[])
 {

Modified: libcmml/branches/cmml4/src/Makefile.am
===================================================================
--- libcmml/trunk/src/Makefile.am	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/Makefile.am	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003 CSIRO Australia
+# Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 #
 #  Redistribution and use in source and binary forms, with or without
 #  modification, are permitted provided that the following conditions

Modified: libcmml/branches/cmml4/src/Version_script.in
===================================================================
--- libcmml/trunk/src/Version_script.in	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/Version_script.in	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,3 +1,4 @@
+# Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 #
 # Export file for libcmml
 #
@@ -19,7 +20,6 @@
 cmml_set_sloppy;
 
 cmml_get_preamble;
-cmml_get_last_stream;
 cmml_get_last_head;
 cmml_get_last_clip;
 cmml_get_previous_clip;
@@ -29,34 +29,28 @@
 
 cmml_set_window;
 cmml_skip_to_secs;
-cmml_skip_to_utc;
 cmml_skip_to_id;
 cmml_skip_to_offset;
 
 cmml_preamble_new;
 cmml_element_new;
-cmml_stream_new;
 cmml_head_new;
 cmml_clip_new;
 cmml_error_new;
 
 cmml_preamble_clone;
 cmml_element_clone;
-cmml_stream_clone;
 cmml_head_clone;
 cmml_clip_clone;
 
 cmml_preamble_destroy;
 cmml_element_destroy;
-cmml_stream_destroy;
 cmml_head_destroy;
 cmml_clip_destroy;
 cmml_error_destroy;
 
 cmml_preamble_snprint;
 cmml_element_snprint;
-cmml_stream_snprint;
-cmml_stream_pretty_snprint;
 cmml_head_snprint;
 cmml_head_pretty_snprint;
 cmml_clip_snprint;
@@ -81,20 +75,13 @@
 
 cmml_time_new;
 cmml_sec_new;
-cmml_utc_new;
 cmml_time_interval_new;
 cmml_time_new_in_sec;
 cmml_time_new_secs;
-cmml_time_utc_to_sec;
 cmml_time_free;
 cmml_time_clone;
 cmml_sec_parse;
-cmml_utc_parse;
-cmml_utc_clone;
-cmml_utc_diff;
 cmml_npt_snprint;
-cmml_utc_snprint;
-cmml_utc_pretty_snprint;
 
         local:
                 *;

Modified: libcmml/branches/cmml4/src/cmml.c
===================================================================
--- libcmml/trunk/src/cmml.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -160,15 +160,13 @@
  * cmml_set_read_callbacks: registration function for callbacks.
  */
 int cmml_set_read_callbacks (CMML *cmml,
-			     CMMLReadStream read_stream,
 			     CMMLReadHead   read_head,
-			     CMMLReadClip read_clip,
+			     CMMLReadClip   read_clip,
 			     void * user_data)
 {
   CMML_Context * context = (CMML_Context *) cmml;
-  context->read_stream = read_stream;
   context->read_head   = read_head;
-  context->read_clip = read_clip;
+  context->read_clip   = read_clip;
   context->user_data   = user_data;
   return 0;
 }
@@ -176,7 +174,7 @@
 
 /*
  * cmml_read: read n bytes from a file and parse them.
- * Activates registered callbacks when reaching stream, head or clip
+ * Activates registered callbacks when reaching head or clip
  * end tags and blocks until they have completed. Stores parsed info
  * in status. If an error or EOF occurs, returns -1 in which case you
  * can check the error code with cmml_last_error().
@@ -201,7 +199,7 @@
     
     /* XML_Parse activates registered expat callbacks, which in turn
        activate the registered libcmml user callbacks when the end
-       of a stream,head or clip tag are reached */
+       of a head or clip tag are reached */
     if (XML_Parse(ctxt->parser, buf, bytes, bytes == 0) == XML_STATUS_ERROR) {
       if (cmml_get_last_error(cmml) != NULL) return -1;
       cmml_set_error(cmml, CMML_EXPAT_ERROR);
@@ -232,7 +230,7 @@
 
 /*
  * cmml_get_preamble: returns a structure containing some of the
- * parsing information received out of a stream.
+ * parsing information received out of a cmml preamble.
  */
 CMML_Preamble * 
 cmml_get_preamble (CMML *cmml)
@@ -251,30 +249,16 @@
   i = cmml_preamble_new(context->status->info->xml_encoding,
 	  context->status->info->cmml_id,
 	  context->status->info->cmml_lang,
+	  context->status->info->cmml_xml_lang,
 	  context->status->info->cmml_dir,
-	  context->status->info->cmml_granulerate);
+	  context->status->info->cmml_role);
   if (context->status->info->xml_version != NULL) {
 	  i->xml_version    = context->status->info->xml_version;
   }
   i->xml_standalone = context->status->info->xml_standalone;
-  i->doctype_declared = context->status->info->doctype_declared;
   return i;
 }
 
-/*
- * cmml_get_last_{stream,head,clip}: Return a copy of the current
- * stream, head, last a element.
- */
-CMML_Stream * 
-cmml_get_last_stream (CMML *cmml)
-{
-  CMML_Context * context = (CMML_Context *) cmml;
-  CMML_Stream * m;
-
-  m = cmml_stream_clone (context->status->stream);
-  return m;
-}
-
 CMML_Head * cmml_get_last_head (CMML *cmml)
 {
   CMML_Context * context = (CMML_Context *) cmml;
@@ -371,7 +355,7 @@
     return -1.0;
   }
 
-  /* make sure to have the stream tag parsed to check about position */
+  /* make sure to be at the head tag to check about position */
   if (cmml_parse_to_head (ctxt)!=0) {
     return -1.0;
   }
@@ -441,61 +425,6 @@
   return -1;
 }
 
-/*
- * cmml_skip_to_utc: seek for a utc time offset
- * return clip time found or -1 on error
- */
-double cmml_skip_to_utc (CMML *cmml, const char *utcstr)
-{
-  CMML_Context * ctxt = (CMML_Context*) cmml;
-  CMML_UTC * utc;
-  double difference;
-#ifdef DEBUG
-  char bufutc[100];
-#endif
-
-  utc = cmml_utc_parse(utcstr);
-  if (utc == NULL) {
-    fprintf(stderr, "Error parsing utc attribute.\n");
-    cmml_set_error(cmml, CMML_TIME_ERROR);
-    return -1.0;
-  }
-#ifdef DEBUG
-  cmml_utc_pretty_snprint (bufutc, 100, utc);
-  fprintf(stderr, "Seeking %s\n", bufutc);
-#endif
-
-  /* if necessary, parse stream tag to get utc basetime */
-  if (cmml_parse_to_head(ctxt)!=0) {
-    return -1;
-  }
-
-  /* if utc does not exist in stream, seeking not possible */
-  if (ctxt->status->stream->utc == NULL) {
-    fprintf(stderr, "No utc attribute in stream tag -> seeking by utc not possible.\n");
-    cmml_set_error(cmml, CMML_TIME_ERROR);
-    return -1.0;
-  }
-
-  difference = cmml_utc_diff(utc, ctxt->status->stream->utc->t.utc);
-#ifdef DEBUG
-  fprintf(stderr, "difference between: %s and %s\n", utcstr, ctxt->status->stream->utc->tstr);
-  fprintf(stderr, "time difference seeking: %f and offset %f\n", difference,
-	  ctxt->status->stream->basetime->t.sec);
-#endif
-  if (difference < 0) {
-    /* utc time is before start of file's utc time */
-    return -1.0;
-  }
-  /* calculate corresponding offset in seconds into the file */
-  difference += ctxt->status->stream->basetime->t.sec;
-#ifdef DEBUG
-  fprintf(stderr, "time difference seeking: %f\n", difference);
-#endif
-
-  return cmml_skip_to_secs (cmml, difference);
-}
-
 /* 
  * cmml_skip_to_id: seek forward thru clip tags to
  * required id offset (no backwards seeking: streaming!).
@@ -566,9 +495,6 @@
   if ((retval = strstr(offset,":")) == NULL) {
     /* no colon found -> is an clip id name */
     return cmml_skip_to_id (cmml, offset);
-  } else if ((strncmp(offset,"clock",5))==0) {
-    /* clock keyword found -> is a utc time */
-    return cmml_skip_to_utc(cmml, offset+6);
   } else {
     /* some other time specification */
     secspec = cmml_time_new(offset);

Modified: libcmml/branches/cmml4/src/cmml.h
===================================================================
--- libcmml/trunk/src/cmml.h	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml.h	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -54,42 +54,13 @@
 /* CMML_Time and CMML_List are kept here and not in cmml_private.h   */
 /* because the library user may need detailed access to these fields */
 
-/** 
- * CMML_UTC: utc time specification struct similar to the one defined
- * in time.h
- */
-typedef struct {
-  short   tm_hsec; /**< hundreds of seconds [0-99] */
-  short   tm_sec;  /**< seconds after the minute [0-59] */
-  short   tm_min;  /**< minutes after the hour [0-59] */
-  short   tm_hour; /**< hours since midnight [0-23] */
-  short   tm_mday; /**< day of the month [1-31] */
-  short   tm_mon;  /**< months since January [1-12] */
-  short   tm_year; /**< years including century */
-
-} CMML_UTC;
-
-/** 
- * CMML_Time_Type: enumerates the different time types
- */
-typedef enum _CMML_Time_Type {
-  CMML_SEC_TIME,   /**< time is seconds */
-  CMML_UTC_TIME    /**< time is utc */
-} CMML_Time_Type;
-
-
 /**
- * CMML_Time: a time specification in CMML: either seconds or utc
- * time; keeps the original time string for reuse, too
+ * CMML_Time: a time specification in CMML given in seconds;
+ * keeps the original time string for reuse, too
  */
 typedef struct {
   char *tstr;          /**< copy of original time string for reuse in printing */
-  CMML_Time_Type type; /**< the type of time for selecting the union content */
-  /** holds either a utc or a sec time */
-  union {
-    CMML_UTC * utc;    /**< actual time in utc */
-    double sec;        /**< actual time in seconds */
-  } t;
+  double sec;        /**< actual time in seconds */
 } CMML_Time;
 
 
@@ -137,57 +108,16 @@
   char *xml_version;      /**< version attribute of xml proc instr */
   char *xml_encoding;     /**< encoding attribute of xml proc instr */
   int   xml_standalone;   /**< standalone attribute of xml proc instr */
-  int   doctype_declared; /**< was doctype declared */
   char *cmml_lang;        /**< lang attribute of cmml tag */
+  char *cmml_xml_lang;    /**< xml:lang attribute of cmml tag */
   char *cmml_dir;         /**< dir attribute of cmml tag */
   char *cmml_id;          /**< id attribute of cmml tag */
   char *cmml_xmlns;       /**< xmlns attribute of cmml tag */
-  char *cmml_granulerate; /**< granulerate attribute of cmml tag */
+  char *cmml_role;        /**< role attribute of cmml tag */
 } CMML_Preamble;
 
 
 /**
- * CMML_ParamElement: a struct to keep the details of the param tag in
- * a import element
- */
-typedef struct {
-  char *id;    /**< id of param element */
-  char *name;  /**< property name of param element */
-  char *value; /**< property value of param element */
-} CMML_ParamElement;
-
-/**
- * CMML_ImportElement: a struct to keep the details of the import tag
- */
-typedef struct {
-  char *id;               /**< id of import tag */
-  char *lang;             /**< language code of import tag */
-  char *dir;              /**< directionality of lang (ltr/rtl) */
-  char *granulerate;      /**< base temporal resolution in Hz */
-  char *contenttype;      /**< content type of the import bitstream */
-  char *src;              /**< URI to import document */
-  CMML_Time * start_time; /**< insertion time in annodex bitstream */
-  CMML_Time * end_time;   /**< end time of this logical  bitstream */
-  char *title;            /**< comment on the import bitstream */
-  CMML_List * param;      /**< list of optional further name-value
-			     metadata for the import bitstreams */
-} CMML_ImportElement;
-
-/** 
- * CMML_Stream: an optional stream element containing information on
- * the set of import bitstreams which are being annotated by the CMML
- * data.
- * 
- */
-typedef struct {
-  char *id;             /**< id attribute of stream element */
-  CMML_Time * basetime; /**< basetime attribute of stream element */
-  CMML_Time * utc;      /**< utc attribute of stream element */
-  CMML_List * import;   /**< list of import elements */
-} CMML_Stream;
-
-
-/**
  * CMML_MetaElement: a struct to keep the details of the meta tag in
  * either a head or a clip
  */
@@ -278,8 +208,6 @@
 typedef enum _CMML_Element_Type {
   CMML_NONE,   /**< no element */
   CMML_CMML,   /**< cmml element */
-  CMML_STREAM, /**< stream element */
-  CMML_IMPORT, /**< import element */
   CMML_HEAD,   /**< head element */
   CMML_CLIP    /**< clip element */
 } CMML_Element_Type;
@@ -292,9 +220,8 @@
  */
 typedef struct {
   CMML_Element_Type type; /**< type of element to select in union */
-  /** holds either the stream, head or clip tag */
+  /** holds either the head or clip tag */
   union {
-    CMML_Stream * stream; /**< the stream tag */
     CMML_Head   * head;   /**< the head tag */
     CMML_Clip   * clip;   /**< the clip tag */
   } e;
@@ -321,9 +248,7 @@
   CMML_PARSE_ERROR,  /**< General parsing error */
   CMML_NO_CMML_TAG,  /**< No cmml tag was found */
   CMML_NO_HEAD_TAG,  /**< No head tag was found */
-  CMML_STREAM_NOT_FIRST,  /**< there is a head or a tag before the stream */
   CMML_HEAD_AFTER_CLIP,   /**< there is a clip tag before the head tag */
-  CMML_DUPLICATE_STREAM,  /**< there are two stream tags */
   CMML_DUPLICATE_HEAD,    /**< there are two head tags */
   /* sloppy errors */
   CMML_FORMAT_ERROR,      /**< error in the formatting of an implied attribute */
@@ -344,19 +269,6 @@
 } CMML_Error;
 
 /**
- * CMMLReadStream: Signature for a callback called when the CMML
- * stream element is parsed
- *
- * \param cmml the CMML* handle in use
- * \param stream the stream element's content represented in a
- *        CMML_Stream*
- * \param user_data user defined data
- *
- * \returns 0 on success, 1 on error
- */
-typedef int (*CMMLReadStream)  (CMML *cmml, const CMML_Stream *stream,
-			       void * user_data);
-/**
  * CMMLReadHead: Signature for a callback called when the CMML head
  * element is parsed
  *
@@ -440,8 +352,6 @@
  * cmml_set_read_callbacks: registration function for callbacks.
  *
  * \param cmml a CMML* handle
- * \param read_stream a CMMLReadStream callback function for the
- *        stream tag
  * \param read_head a CMMLReadHead callback function for the head
  *        tag
  * \param read_clip a CMMLReadClip callback function for the a
@@ -452,14 +362,13 @@
  * \returns 0 on success, -1 on failure
  */
 int cmml_set_read_callbacks (CMML *cmml,
-			     CMMLReadStream read_stream,
 			     CMMLReadHead read_head,
 			     CMMLReadClip read_clip,
 			     void * user_data);
 
 /**
  * cmml_read: read n bytes from a file descriptor and parse them.
- * Activates registered callbacks when reaching stream, head or clip
+ * Activates registered callbacks when reaching head or clip
  * end tags and blocks until they have completed. Stores parsed info
  * in status. If an error or EOF occurs, returns -1 in which case you
  * can check the error code with cmml_last_error().
@@ -484,7 +393,7 @@
 
 /**
  * cmml_get_preamble: returns a structure containing some of the
- * parsing informtion received out of a stream.
+ * parsing informtion received out of cmml preamble.
  *
  * \param cmml a CMML* handle
  *
@@ -493,16 +402,6 @@
 CMML_Preamble * cmml_get_preamble (CMML *cmml);
 
 /**
- * cmml_get_last_stream: Return a copy of the current stream element.
- *
- * \param cmml a CMML* handle
- *
- * \returns a CMML_Stream* structure with the stream element details;
- *          NULL if none existed
- */
-CMML_Stream * cmml_get_last_stream (CMML *cmml);
-
-/**
  * cmml_get_last_head: Return a copy of the current head element.
  *
  * \param cmml a CMML* handle
@@ -576,17 +475,6 @@
 double cmml_skip_to_secs (CMML *cmml, double seconds);
 
 /**
- * cmml_skip_to_utc: seeks forward thru clip tags to required time
- * offset (no backwards seeking: streaming!).
- *
- * \param cmml a CMML* handle
- * \param utc the time offset to seek to
- *
- * \returns the actual time offset seeked to in seconds or -1 on error
- */
-double cmml_skip_to_utc  (CMML *cmml, const char * utc);
-
-/**
  * cmml_skip_to_id: seeks forward thru clip tags to required id (no
  * backwards seeking: streaming!).
  *
@@ -619,30 +507,24 @@
  * \param encoding the character encoding to be used; UTF-8 if NULL
  * \param id the id attribute of the cmml tag; not used if NULL
  * \param lang the lang attribute of the cmml tag; not used if NULL
+ * \param xml_lang the xml:lang attribute of the cmml tag; not used if NULL
  * \param dir the dir attribute of the cmml tag; not used if NULL
- * \param granulerate the granulerate attribute of the cmml tag; not used if NULL
+ * \param role the role attribute of the cmml tag; not used if NULL
  *
  * \returns a CMML preamble
  */
-CMML_Preamble * cmml_preamble_new (const char *encoding, const char *id, const char *lang, const char *dir, const char *granulerate);
+CMML_Preamble * cmml_preamble_new (const char *encoding, const char *id, const char *lang, const char *xml_lang, const char *dir, const char *role);
 
 /**
  * cmml_element_new: Create a new CMML_Element.
  *
- * \param type the element type to create (head, stream, or clip)
+ * \param type the element type to create (head or clip)
  *
  * \returns a element of the requested type
  */
 CMML_Element * cmml_element_new (CMML_Element_Type type);
 
 /**
- * cmml_stream_new: Create a new CMML_Stream.
- *
- * \returns a stream element
- */
-CMML_Stream  * cmml_stream_new   (void);
-
-/**
  * cmml_head_new: Create a new CMML_Head.
  *
  * \returns a head element
@@ -687,15 +569,6 @@
 CMML_Element * cmml_element_clone (CMML_Element * src);
 
 /**
- * cmml_stream_clone: Create a copy of a stream element.
- *
- * \param src the original stream element
- *
- * \returns a copy of the stream element
- */
-CMML_Stream  * cmml_stream_clone  (CMML_Stream  * src);
-
-/**
  * cmml_head_clone: Create a copy of a head element.
  *
  * \param src the original head element
@@ -730,13 +603,6 @@
 void cmml_element_destroy (CMML_Element *element);
 
 /**
- * cmml_stream_destroy: Free a stream element.
- *
- * \param stream the stream element to free
- */
-void cmml_stream_destroy  (CMML_Stream  *stream);
-
-/**
  * cmml_head_destroy: Free a head element.
  *
  * \param head the head element to free
@@ -785,30 +651,6 @@
 int cmml_element_snprint        (char *buf, int n, CMML_Element *elem);
 
 /**
- * cmml_stream_snprint: Prints a stream element into a buffer.
- *
- * \param buf the buffer to print into
- * \param n the size of the buffer buf
- * \param stream the stream element structure
- *
- * \returns the number of characters written to the buffer (including
- * the terminating \\0) or -1 if buffer too small.
- */
-int cmml_stream_snprint         (char *buf, int n, CMML_Stream  *stream);
-
-/**
- * cmml_stream_pretty_snprint: Prints a stream element into a buffer.
- *
- * \param buf the buffer to print into
- * \param n the size of the buffer buf
- * \param stream the stream element structure
- *
- * \returns the number of characters written to the buffer (including
- * the terminating \\0) or -1 if buffer too small.
- */
-int cmml_stream_pretty_snprint  (char *buf, int n, CMML_Stream  *stream);
-
-/**
  * cmml_head_snprint: Prints a head element into a buffer.
  *
  * \param buf the buffer to print into
@@ -1035,7 +877,7 @@
  *
  * \param s name-value time specification string
  *
- * \returns a time struct with appropriate time type (utc or seconds).
+ * \returns a time struct with time in seconds.
  */
 CMML_Time * cmml_time_new  (const char * s);
 
@@ -1058,15 +900,6 @@
 CMML_Time * cmml_time_new_secs (double seconds);
 
 /**
- * cmml_utc_new: Creates a time struct only from name-value utc specs.
- *
- * \param s name-value time specification string
- *
- * \returns a time struct.
- */
-CMML_Time * cmml_utc_new   (const char * s);
-
-/**
  * cmml_time_interval_new: Handles start and end times for clip
  * tags, where we will only store sec offsets.
  *
@@ -1088,26 +921,13 @@
  * one libcmml stores internally for clips.
  *
  * \param s the string that contains the time spec
- * \param ref the reference utc time if given in the stream tag
  * \param base the basetime in seconds as given in the stream tag
  *
  * \returns a time structure in seconds
  */
-CMML_Time *cmml_time_new_in_sec (const char * s, CMML_Time * ref, double base);
+CMML_Time *cmml_time_new_in_sec (const char * s, double base);
 
 /**
- * cmml_time_utc_to_sec: Convert a time from utc to seconds with
- * reference to a basetime
- *
- * \param t the given time struct
- * \param ref the reference utc time if given in the stream tag
- * \param base the basetime in seconds as given in the stream tag
- *
- * \returns a time structure in seconds
- */
-CMML_Time *cmml_time_utc_to_sec (CMML_Time * t, CMML_Time * ref, double base);
-
-/**
  * cmml_time_free: Free time struct
  *
  * \param t the given time struct
@@ -1133,36 +953,6 @@
 double cmml_sec_parse (const char *s);
 
 /**
- * cmml_utc_parse: for parsing utc times with "clock:" 
- *
- * \param s the string containing only the utc string as
- * YYYYMMDDTHHmmss.hhZ 
- *
- * \returns a utc time structure
- */
-CMML_UTC * cmml_utc_parse (const char * s);
-
-/**
- * cmml_utc_clone: for copying utc times
- *
- * \param t the src utc time structure
- *
- * \returns the copied utc time structure
- */
-CMML_UTC * cmml_utc_clone (CMML_UTC *t);
-
-/**
- * cmml_utc_diff: for calculating the difference between two utc times
- * as t2-t1 in seconds
- *
- * \param t2 the more recent utc time
- * \param t1 the less recent utc time
- *
- * \returns the difference between the two utc times in seconds
- */
-double     cmml_utc_diff  (CMML_UTC *t2, CMML_UTC *t1);
-
-/**
  * cmml_npt_snprint: prints npt time to a string
  *
  * \param buf buffer to print string to
@@ -1174,30 +964,5 @@
  */
 int        cmml_npt_snprint (char * buf, int n, double seconds);
 
-/**
- * cmml_utc_snprint: for printing utc times
- *
- * \param buf  the buffer to print into
- * \param n the size of the buffer buf
- * \param t the utc time structure
- *
- * \returns the number of characters written to the buffer (including
- * the terminating \\0) or -1 if buffer too small.
- */
-int        cmml_utc_snprint (char *buf, int n, CMML_UTC *t);
 
-/**
- * cmml_utc_pretty_snprint: for printing utc times
- *
- * \param buf  the buffer to print into
- * \param n the size of the buffer buf
- * \param t the utc time structure
- *
- * \returns the number of characters written to the buffer (including
- * the terminating \\0) or -1 if buffer too small.
- */
-int        cmml_utc_pretty_snprint (char *buf, int n, CMML_UTC *t);
-
-
-
 #endif /* __CMML_H__ */

Modified: libcmml/branches/cmml4/src/cmml_element.c
===================================================================
--- libcmml/trunk/src/cmml_element.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml_element.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -54,7 +54,7 @@
  * cmml_preamble_new: Create a new CMML_Preamble.
  */
 CMML_Preamble * 
-cmml_preamble_new (const char *encoding, const char *id, const char *lang, const char *dir, const char *granulerate)
+cmml_preamble_new (const char *encoding, const char *id, const char *lang, const char *xml_lang, const char *dir, const char *role)
 {
   CMML_Preamble * p;
   p = (CMML_Preamble *) cmml_malloc(sizeof(CMML_Preamble));
@@ -65,12 +65,16 @@
     p->xml_encoding = cmml_strdup("UTF-8");
   }
   p->xml_standalone   = 1;
-  p->doctype_declared = 1;
   if (lang) {
     p->cmml_lang = cmml_strdup(lang);
   } else {
     p->cmml_lang = NULL;
   }
+  if (xml_lang) {
+    p->cmml_xml_lang = cmml_strdup(xml_lang);
+  } else {
+    p->cmml_xml_lang = NULL;
+  }
   if (dir) {
     p->cmml_dir = cmml_strdup(dir);
   } else {
@@ -81,10 +85,10 @@
   } else {
     p->cmml_id = NULL;
   }
-  if (granulerate) {
-    p->cmml_granulerate = cmml_strdup(granulerate);
+  if (role) {
+    p->cmml_role = cmml_strdup(role);
   } else {
-    p->cmml_granulerate = NULL;
+    p->cmml_role = NULL;
   }
   p->cmml_xmlns = cmml_strdup("http://www.annodex.net/cmml");
   return p;
@@ -99,9 +103,6 @@
   CMML_Element * elem = cmml_malloc(sizeof(CMML_Element));
   
   switch (type) {
-  case CMML_STREAM:
-    elem->e.stream = cmml_stream_new();
-    break;
   case CMML_HEAD:
     elem->e.head = cmml_head_new();
     break;
@@ -118,18 +119,6 @@
   return elem;
 }
 
-CMML_Stream * 
-cmml_stream_new ()
-{
-  CMML_Stream * s;
-  s = (CMML_Stream *) cmml_malloc(sizeof(CMML_Stream));
-  s->id = NULL;
-  s->basetime = NULL;
-  s->utc = NULL;
-  s->import = cmml_list_new();
-  return s;
-}
-
 CMML_Head * 
 cmml_head_new    (void)
 {
@@ -202,45 +191,6 @@
  * Cloning functions
  */
 
-static CMML_ParamElement *
-cmml_param_element_clone (CMML_ParamElement * param)
-{
-  CMML_ParamElement * new_param;
-
-  if (param == NULL) return NULL;
-
-  new_param = (CMML_ParamElement* ) cmml_malloc (sizeof(CMML_ParamElement));
-  /* maybe consider memcpy for speedup and introduce reference counting!
-     memcpy (new_param, param, sizeof (*new_param));
-     -> NO: may introduce a problem with byte alignment
-  */
-  new_param->id    = cmml_strdup (param->id);
-  new_param->name  = cmml_strdup (param->name);
-  new_param->value = cmml_strdup (param->value);
-  return new_param;
-}
-
-static CMML_ImportElement *
-cmml_import_element_clone (CMML_ImportElement * import)
-{
-  CMML_ImportElement * new_import;
-  if (import == NULL) return NULL;
-  new_import = (CMML_ImportElement*) cmml_malloc (sizeof(CMML_ImportElement));
-  new_import->id          = cmml_strdup (import->id);
-  new_import->lang        = cmml_strdup (import->lang);
-  new_import->dir         = cmml_strdup (import->dir);
-  new_import->granulerate = cmml_strdup (import->granulerate);
-  new_import->contenttype = cmml_strdup (import->contenttype);
-  new_import->src         = cmml_strdup (import->src);
-  new_import->start_time  = cmml_time_clone (import->start_time);
-  new_import->end_time    = cmml_time_clone (import->end_time);
-  new_import->title       = cmml_strdup (import->title);
-  new_import->param       = 
-    cmml_list_clone_with (import->param,
-			  (CMML_CloneFunc)cmml_param_element_clone);
-  return new_import;
-}
-
 static CMML_MetaElement *
 cmml_meta_element_clone (CMML_MetaElement * meta)
 {
@@ -294,12 +244,12 @@
   p->xml_version      = cmml_strdup(src->xml_version);
   p->xml_encoding     = cmml_strdup(src->xml_encoding);
   p->xml_standalone   = src->xml_standalone;
-  p->doctype_declared = src->doctype_declared;
   p->cmml_lang        = cmml_strdup(src->cmml_lang);
+  p->cmml_xml_lang    = cmml_strdup(src->cmml_xml_lang);
   p->cmml_dir         = cmml_strdup(src->cmml_dir);
   p->cmml_id          = cmml_strdup(src->cmml_id);
   p->cmml_xmlns       = cmml_strdup(src->cmml_xmlns);
-  p->cmml_granulerate = cmml_strdup(src->cmml_granulerate);
+  p->cmml_role        = cmml_strdup(src->cmml_role);
   return p;
 }
 
@@ -313,9 +263,6 @@
   elem = cmml_element_new(src->type);
   elem->type = src->type;
   switch (elem->type) {
-  case CMML_STREAM:
-    elem->e.stream = cmml_stream_clone(src->e.stream);
-    break;
   case CMML_HEAD:
     elem->e.head = cmml_head_clone(src->e.head);
     break;
@@ -330,27 +277,6 @@
   return elem;
 }
 
-CMML_Stream *
-cmml_stream_clone(CMML_Stream * src)
-{
-  CMML_Stream * s;
-  if (src == NULL) return NULL;
-  s = (CMML_Stream *) cmml_malloc(sizeof(CMML_Stream));
-  /*
-  memcpy (s, src, sizeof (*s));
-  */
-  s->id       = cmml_strdup(src->id);
-  s->basetime = cmml_time_clone(src->basetime);
-  if (src->utc != NULL) {
-    s->utc      = cmml_time_clone(src->utc);
-  } else {
-    s->utc = NULL;
-  }
-  s->import    =
-    cmml_list_clone_with (src->import, (CMML_CloneFunc)cmml_import_element_clone);
-  return s;
-}
-
 CMML_Head *
 cmml_head_clone(CMML_Head * head)
 {
@@ -423,35 +349,6 @@
 /*
  * Destroying functions
  */
-static CMML_ParamElement *
-cmml_param_element_destroy (CMML_ParamElement * param)
-{
-  if (param == NULL) return NULL;
-  cmml_free (param->id);
-  cmml_free (param->name);
-  cmml_free (param->value);
-  return NULL;
-}
-
-CMML_ImportElement *
-cmml_import_element_destroy (CMML_ImportElement * import)
-{
-  if (import == NULL) return NULL;
-  cmml_free (import->id);
-  cmml_free (import->lang);
-  cmml_free (import->dir);
-  cmml_free (import->granulerate);
-  cmml_free (import->contenttype);
-  cmml_free (import->src);
-  cmml_free (import->start_time);
-  cmml_free (import->end_time);
-  cmml_free (import->title);
-  cmml_list_free_with(import->param,
-		      (CMML_FreeFunc) cmml_param_element_destroy);
-  cmml_free (import);
-  return NULL;
-}
-
 CMML_MetaElement *
 cmml_meta_element_destroy (CMML_MetaElement * meta)
 {
@@ -490,10 +387,11 @@
   cmml_free(info->xml_version);
   cmml_free(info->xml_encoding);
   cmml_free(info->cmml_lang);
+  cmml_free(info->cmml_xml_lang);
   cmml_free(info->cmml_dir);
   cmml_free(info->cmml_id);
   cmml_free(info->cmml_xmlns);
-  cmml_free(info->cmml_granulerate);
+  cmml_free(info->cmml_role);
   cmml_free(info);
   return;
 }
@@ -506,9 +404,6 @@
 {
   if (!elem) return;
   switch (elem->type) {
-  case CMML_STREAM:
-    cmml_stream_destroy(elem->e.stream);
-    break;
   case CMML_HEAD:
     cmml_head_destroy(elem->e.head);
     break;
@@ -522,21 +417,6 @@
 }
 
 /*
- * cmml_stream_destroy: free all memory associated with a CMML_Stream
- */
-void 
-cmml_stream_destroy(CMML_Stream * s)
-{
-  if (s == NULL) return;
-  cmml_free(s->id);
-  cmml_time_free(s->basetime);
-  cmml_time_free(s->utc);
-  cmml_list_free_with(s->import, (CMML_FreeFunc) cmml_import_element_destroy);
-  cmml_free(s);
-  return;
-}
-
-/*
  * cmml_head_destroy: free all memory associated with a CMML_Head
  */
 void 
@@ -612,86 +492,6 @@
 
 /* return number of characters written */
 static
-int cmml_param_list_snprint (char *buf, int *_len, int *_n, int *_n_written, 
-			    CMML_List * param)
-{
-  int len = *_len;
-  int n = *_n;
-  int n_written = *_n_written;
-  
-  if (!cmml_list_is_empty(param)) {
-    CMML_List * param_node;
-      
-    for (param_node = param;
-	 param_node != NULL;
-	 param_node = param_node->next) {
-      CMML_ParamElement * m = (CMML_ParamElement *) param_node->data;
-	
-      BEGIN_TAG("param");
-      APPEND_ATTRIBUTE("id", m->id);
-      APPEND_ATTRIBUTE("name", m->name);
-      APPEND_ATTRIBUTE("value", m->value);
-      END_EMPTY_TAG();
-      NEWLINE;
-    }
-  }
-  *_len = len;
-  *_n = n;
-  *_n_written = n_written;
-  return 0;
-}
-
-/* return number of characters written */
-static
-int cmml_import_list_snprint (char *buf, int *_len, int *_n, int *_n_written, 
-			     CMML_List * import)
-{
-  int len = *_len;
-  int n = *_n;
-  int n_written = *_n_written;
-  
-  if (!cmml_list_is_empty(import)) {
-    CMML_List * import_node;
-      
-    for (import_node = import;
-	 import_node != NULL;
-	 import_node = import_node->next) {
-      CMML_ImportElement * m = (CMML_ImportElement *) import_node->data;
-	
-      BEGIN_TAG("import");
-      APPEND_ATTRIBUTE("id", m->id);
-      APPEND_ATTRIBUTE("lang", m->lang);
-      APPEND_ATTRIBUTE("dir", m->dir);
-      APPEND_ATTRIBUTE("granulerate", m->granulerate);
-      APPEND_ATTRIBUTE("contenttype", m->contenttype);
-      APPEND_ATTRIBUTE("src", m->src);
-      if (m->start_time != NULL) {
-	APPEND_ATTRIBUTE("start", m->start_time->tstr);
-      }
-      if (m->end_time != NULL) {
-	APPEND_ATTRIBUTE("end", m->end_time->tstr);
-      }
-      APPEND_ATTRIBUTE("title", m->title);
-      if(!cmml_list_is_empty(m->param)) {
-	END_TAG();
-	NEWLINE;
-	if (cmml_param_list_snprint(buf, &len, &n, &n_written, m->param) < 0)
-	  return -1;
-	CLOSE_TAG("import");
-      } else {
-	END_EMPTY_TAG();
-      }
-      NEWLINE;
-    }
-  }
-  *_len = len;
-  *_n = n;
-  *_n_written = n_written;
-  return 0;
-}
-
-/* return number of characters written */
-static
 int cmml_meta_list_snprint (char *buf, int *_len, int *_n, int *_n_written, 
 			    CMML_List * meta)
 {
@@ -788,26 +588,17 @@
   }
   n -= n_written;
   len += n_written;
-
-  /* write doctype declaration */
-  if (pre->doctype_declared) {
-    if ((n_written = 
-	 cmml_snprintf(buf + len, n, "<!DOCTYPE cmml SYSTEM \"cmml.dtd\">\n\n")) == -1) {
-      return -1;
-    }
-    n -= n_written;
-    len += n_written;
-  }
   
   /* write cmml tag */
   BEGIN_TAG("cmml");
   APPEND_ATTRIBUTE("id", pre->cmml_id);
   APPEND_ATTRIBUTE("lang", pre->cmml_lang);
+  APPEND_ATTRIBUTE("xml:lang", pre->cmml_xml_lang);
   APPEND_ATTRIBUTE("dir", pre->cmml_dir);
   /* to print or not to print?
   APPEND_ATTRIBUTE("xmlns", pre->cmml_xmlns);
   */
-  APPEND_ATTRIBUTE("granulerate", pre->cmml_granulerate);
+  APPEND_ATTRIBUTE("role", pre->cmml_role);
   END_TAG();
   NEWLINE;
 
@@ -820,7 +611,7 @@
  * characters actually written to the buffer (including the
  * terminating '\0').  If buf is too small, return -1.
  *
- * cmml_{stream,head,clip}_snprint work similarly but operate only on
+ * cmml_{head,clip}_snprint work similarly but operate only on
  * elements of the specified type.
  *
  * cmml_error_snprint prints a string description of the CMML_Error
@@ -834,9 +625,6 @@
   if (!elem) return 0;
   /* Deduce the type of the CMML_Element and call the appropriate */
   switch (elem->type) {
-  case CMML_STREAM:
-    n_written = cmml_stream_snprint(buf, n, (CMML_Stream*) elem->e.stream);
-    break;
   case CMML_HEAD:
     n_written = cmml_head_snprint(buf, n, (CMML_Head*) elem->e.head);
     break;
@@ -851,58 +639,6 @@
 }
 
 int 
-cmml_stream_snprint(char *buf, int n, CMML_Stream * m)
-{
-  int len = 0;
-  int n_written;
-  
-  if (m == NULL) return 0;
-  
-  BEGIN_TAG("stream");
-  APPEND_ATTRIBUTE("id", m->id);
-  if (m->basetime) {
-    APPEND_ATTRIBUTE("basetime", m->basetime->tstr);
-  }
-  if (m->utc) {
-    APPEND_ATTRIBUTE("utc", m->utc->tstr);
-  }
-  END_TAG();
-
-  if (cmml_import_list_snprint(buf, &len, &n, &n_written, m->import) < 0)
-    return -1;
-  CLOSE_TAG("stream");
-  
-  return len;
-}
-
-int 
-cmml_stream_pretty_snprint(char *buf, int n, CMML_Stream * m)
-{
-  int len = 0;
-  int n_written;
-  
-  if (m == NULL) return 0;
-  
-  BEGIN_TAG("stream");
-  APPEND_ATTRIBUTE("id", m->id);
-  if (m->basetime) {
-    APPEND_ATTRIBUTE("basetime", m->basetime->tstr);
-  }
-  if (m->utc) {
-    APPEND_ATTRIBUTE("utc", m->utc->tstr);
-  }
-  END_TAG();
-  NEWLINE;
-
-  if (cmml_import_list_snprint(buf, &len, &n, &n_written, m->import) < 0)
-    return -1;
-  CLOSE_TAG("stream");
-  NEWLINE;
-
-  return len;
-}
-
-int 
 cmml_head_snprint(char *buf, int n, CMML_Head * h)
 {
     int len = 0;
@@ -1170,15 +906,9 @@
   case CMML_NO_HEAD_TAG:
     REPORT (error, "head tag missing");
     break;
-  case CMML_STREAM_NOT_FIRST:
-    REPORT (error, "head or clip tag before stream tag not allowed");
-    break;
   case CMML_HEAD_AFTER_CLIP:
     REPORT (error, "head tag after clip tag not allowed");
     break;
-  case CMML_DUPLICATE_STREAM:
-    REPORT (error, "Multiple stream tags not allowed");
-    break;
   case CMML_DUPLICATE_HEAD:
     REPORT (error, "Multiple head tags not allowed");
     break;

Modified: libcmml/branches/cmml4/src/cmml_private.c
===================================================================
--- libcmml/trunk/src/cmml_private.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml_private.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -131,6 +131,8 @@
       docinfo->cmml_id = cmml_strdup(attr[i+1]);
     } else if (cmml_strcmp(attr[i], "lang") == 0) {
       docinfo->cmml_lang = cmml_strdup(attr[i+1]);
+    } else if (cmml_strcmp(attr[i], "xml_lang") == 0) {
+      docinfo->cmml_xml_lang = cmml_strdup(attr[i+1]);
     } else if (cmml_strcmp(attr[i], "dir") == 0) {
       docinfo->cmml_dir = cmml_strdup(attr[i+1]);
     } else if (cmml_strcmp(attr[i], "xmlns") == 0) {
@@ -144,197 +146,7 @@
   docinfo->cmml_xmlns = cmml_strdup("http://www.annodex.net/cmml");
 }
 
-
 /*
- * insert_stream_attrs: insert attributes from a "stream" element into
- * a CMML_Element of type CMML_HEAD.
- */
-static int
-insert_stream_attrs(CMML_Stream * stream, const XML_Char **attr, CMML_Context *ctxt)
-{
-  int i;
-  CMML_Time * timebase = NULL; /* backwards compatibility for CMML 2.1 */
-
-  if (!stream) return 0;
-
-  for (i = 0; attr[i] != NULL; i += 2) {
-#ifdef DEBUG
-    fprintf(stderr, "Inserting stream attribute %s=%s\n", attr[i], attr[i+1]);
-#endif
-    if (cmml_strcmp(attr[i], "id") == 0) {
-      stream->id = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "basetime") == 0) {
-      stream->basetime = cmml_time_new (attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "timebase") == 0) {
-      timebase = cmml_time_new(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "utc") == 0) {
-      stream->utc = cmml_utc_new (attr[i+1]);
-      if (!stream->utc->t.utc) { /* just ignoring tag */
-	cmml_time_free (stream->utc);
-	stream->utc = NULL;
-	cmml_set_error((CMML*)ctxt, CMML_FORMAT_ERROR);
-      }
-    }
-  }
-  /* adapt timebase */
-  if (stream->basetime == NULL) {
-    if (timebase != NULL) {
-      stream->basetime = timebase;
-    } else {
-      /* default value */
-      stream->basetime = cmml_time_new("0");
-    }
-  } else { /* timebase is not being used */
-    if (timebase != NULL) {
-      cmml_time_free (timebase);
-    }
-  }
-  /* check parsed basetime as it is used later in library */
-  if (stream->basetime->t.sec < 0.0) {
-    cmml_set_error((CMML*)ctxt, CMML_TIME_ERROR);
-    return -1; /* stream to be destroyed */
-  }
-  return 0;
-}
-
-/*
- * insert_import_tag: insert attributes from a "import" element into a
- * CMML_Element of type CMML_IMPORT.
- */
-static CMML_List *
-insert_import_tag (CMML_List * import_list, const XML_Char **attr, CMML_Context * ctxt)
-{
-  int i;
-  CMML_ImportElement * m;
-
-  if ((m = (CMML_ImportElement *) cmml_malloc(sizeof(CMML_ImportElement))) 
-      == NULL) return import_list;
-  m->id   = NULL;
-  m->lang = NULL;
-  m->dir  = NULL;
-  m->granulerate = NULL;
-  m->contenttype = NULL;
-  m->src         = NULL;
-  m->start_time  = NULL;
-  m->end_time    = NULL;
-  m->title       = NULL;
-  m->param       = NULL;
-
-  for (i = 0; attr[i] != NULL; i += 2) {
-#ifdef DEBUG
-    fprintf(stderr, "Inserting import attribute %s=%s\n", attr[i], attr[i+1]);
-#endif
-    if (cmml_strcmp(attr[i], "id") == 0) {
-      m->id = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "lang") == 0) {
-      m->lang = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "dir") == 0) {
-      m->dir = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "granulerate") == 0) {
-      m->granulerate = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "contenttype") == 0) {
-      m->contenttype = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "src") == 0) {
-      m->src = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "start") == 0) {
-      m->start_time = 
-	cmml_time_new_in_sec (attr[i+1],
-			      ctxt->status->stream->utc,
-			      ctxt->status->stream->basetime->t.sec);
-    } else if (cmml_strcmp(attr[i], "end") == 0) {
-      m->end_time = 
-	cmml_time_new_in_sec (attr[i+1],
-			      ctxt->status->stream->utc,
-			      ctxt->status->stream->basetime->t.sec);
-    } else if (cmml_strcmp(attr[i], "title") == 0) {
-      m->title = cmml_strdup(attr[i+1]);
-    }
-  }
-  /* set default start_time  */
-  if (m->start_time == NULL) {
-    m->start_time = cmml_time_new("0");
-  }
-  /* check if required src attribute is there */
-  if (!m->src) {
-    /* ignore import tag if it has no src and flag error */
-    cmml_set_error((CMML*)ctxt, CMML_TAG_IGNORED);
-    cmml_import_element_destroy(m);
-    return import_list;
-  }
-  /* check parsed start time for correctness */
-  if (m->start_time->t.sec < 0.0) {
-    cmml_set_error((CMML*)ctxt, CMML_TIME_ERROR);
-    cmml_import_element_destroy(m);
-    return import_list;
-  }
-  /* check parsed end time for correctness and delete it if not */
-  if ((m->end_time != NULL) && 
-      ((m->end_time->t.sec < 0.0) ||
-       (m->end_time->t.sec < m->start_time->t.sec))) {
-    cmml_set_error((CMML*)ctxt, CMML_FORMAT_ERROR);
-    cmml_time_free (m->end_time);
-  }
-  import_list = cmml_list_append(import_list, m);
-  return import_list;
-}
-
-/*
- * insert_param_tag: Make a new CMML_ImportElement and add it to the list
- * of CMML_ImportElements contained within the clip or head
- * CMML_Element.
- */
-static CMML_List * 
-insert_param_tag(CMML_List * import_list, const XML_Char **attr, 
-		  int import_cnt, CMML_Context * ctxt)
-{
-  CMML_List * import_node;
-  CMML_ParamElement * p;
-  CMML_ImportElement *s;
-  int i = 0;
-
-  /* make sure there are import elements to attach the param to */
-  if (!import_list || cmml_list_is_empty(import_list)) {
-    cmml_set_error((CMML*)ctxt, CMML_TAG_IGNORED);
-    return import_list;
-  }
-
-  /* create new param_element and insert it */
-  if((p = (CMML_ParamElement *) cmml_malloc(sizeof(CMML_ParamElement)))
-     == NULL) return import_list;
-  p->id = NULL;
-  p->name = NULL;
-  p->value = NULL;
-  for (i = 0; attr[i] != NULL; i += 2) {
-#ifdef DEBUG
-    fprintf(stderr, "Inserting param attribute %s=%s\n", attr[i], attr[i+1]);
-#endif
-    if (cmml_strcmp(attr[i], "id") == 0) {
-      p->id = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "name") == 0) {
-      p->name = cmml_strdup(attr[i+1]);
-    } else if (cmml_strcmp(attr[i], "value") == 0) {
-      p->value = cmml_strdup(attr[i+1]);
-    } 
-  }
-  /* check if required id and value attributes are there */
-  if (!p->name || !p->value) {
-    cmml_set_error((CMML*)ctxt, CMML_TAG_IGNORED);
-    cmml_free(p->id);
-    cmml_free(p->name);
-    cmml_free(p->value);
-  } else {
-    /* locate correct import_node in import_list to attach params to */
-    for (i=0, import_node = import_list; 
-	 (i<import_cnt) && (import_node!=NULL); 
-	 i++, import_node = import_node->next);
-    s = (CMML_ImportElement *) import_node->data;
-    s->param = cmml_list_append(s->param, p);
-  }
-  return import_list;
-}
-
-
-/*
  * insert_head_attrs: insert attributes from a "head" element into a
  * CMML_HEAD.
  */
@@ -532,11 +344,7 @@
   int i;
 
   if (!a) return -1;
-  if (!ctxt->status->stream) {
-    /* the document has no stream tag before this clip tag */
-    ctxt->status->stream = cmml_stream_new();
-    ctxt->status->stream->basetime = cmml_time_new("0");
-  }
+  ctxt->status->stream->basetime = cmml_time_new("0");
   for (i = 0; attr[i] != NULL; i += 2) {
 #ifdef DEBUG
     fprintf(stderr, "Inserting clip attribute %s=%s\n", attr[i], attr[i+1]);
@@ -556,12 +364,10 @@
     } else if (cmml_strcmp(attr[i], "start") == 0) {
       a->start_time = 
 	cmml_time_new_in_sec (attr[i+1], 
-			      ctxt->status->stream->utc,
 			      ctxt->status->stream->basetime->t.sec);
     } else if (cmml_strcmp(attr[i], "end") == 0) {
       a->end_time = 
 	cmml_time_new_in_sec (attr[i+1],
-			      ctxt->status->stream->utc,
 			      ctxt->status->stream->basetime->t.sec);
     }
   }
@@ -752,39 +558,14 @@
   }
 }
 
-/*
- * callback for expat to parse the DOCTYPE cmml declaration
- */
-static void
-cmml_doctype_parse (void *userData,
-		    const XML_Char *doctypeName,
-		    const XML_Char *sysid,
-		    const XML_Char *pubid,
-		    int            has_internal_subset)
-{
-  CMML_Context * context = (CMML_Context *) userData;
-  /* parse and validate something like
-     <!DOCTYPE cmml SYSTEM "cmml.dtd">
-  */
-  if (cmml_strcmp(doctypeName, "cmml") == 0 &&
-      cmml_strcmp(sysid, "cmml.dtd") == 0) {
-    /* found cmml doctype declaration -> store in status */
-    /* XXX: anything else to be done? */
-    context->status->info->doctype_declared = 1;
-  }
-}
 
-
 /*
  * cmml_start: handler (called by Expat) when encountering a start tag.
  *
- * If the tag name is "stream", "head"  or "a", then make a new
+ * If the tag name is head"  or "a", then make a new
  * CMML_Element, add attributes to it, and put it into the status struct.
  *
- * If the tag name is "param" then the CMML_Element at the tail of the
- * list can be import only.
- *
- * If the tag name is "title", "stream", or "base", then assert that
+ * If the tag name is "title" or "base", then assert that
  * the currently processed CMML_Element is a head, and add
  * attributes to that head.
  *
@@ -798,15 +579,14 @@
  * list can be either a head or an clip.
  *
  * The above arrangement takes advantage of the "shallowness" of the
- * CMML DTD, that is, whenever "title", "stream", "base", "desc",
- * "param" or "meta" is encountered, then its parent element is
+ * CMML DTD, that is, whenever "title", "base", "desc",
+ * or "meta" is encountered, then its parent element is
  * exactly one level above it.
  */
 static void 
 cmml_start(void *cmml, const XML_Char *name, const XML_Char **attrs)
 {
   CMML_Context * context = (CMML_Context*) cmml;
-  CMML_Stream * stream;
   CMML_Head   * head;
   CMML_Clip * clip;
 
@@ -828,70 +608,6 @@
     insert_root_attrs(context->status->info, attrs, cmml);
     return;
 
-  /* ----- the "stream" tag ---- */
-  } else if (cmml_strcmp(name, "stream") == 0) {
-    /* has to be first after cmml */
-    if (context->status->type != CMML_CMML) {
-      cmml_set_error(cmml, CMML_NO_CMML_TAG);
-      context->status->type = CMML_STREAM;
-      return;
-    }
-    context->status->type = CMML_STREAM;
-    if (context->status->head || context->status->clip) {
-      cmml_set_error(cmml, CMML_STREAM_NOT_FIRST);
-      return;
-    }
-    /* there can only be one stream tag */
-    if (context->status->stream != NULL) {
-      cmml_set_error(cmml, CMML_DUPLICATE_STREAM);
-      return;
-    }
-    /* parse stream attributes */
-    stream = cmml_stream_new();
-    if (insert_stream_attrs(stream, attrs, cmml) < 0) {
-      cmml_stream_destroy(stream);
-      return;
-    }
-    /* save stream tag */
-    context->status->stream = stream;
-    /* if in the middle of seeking for a time offset,
-       and seektime is before basetime, stop seeking and report error */
-    if (context->status->seek_type == _CMML_SEEK_TIME) {
-      if (context->status->seek_secs <= 
-	  context->status->stream->basetime->t.sec) {
-	context->status->seek_secs = _CMML_SEEK_FOUND;
-	context->status->seek_secs = -1.0;
-      }
-    }
-    return;
-
-  } else if (cmml_strcmp(name, "import") == 0) {
-    if (context->status->type != CMML_STREAM || 
-	context->status->stream == NULL) {
-      cmml_set_error(cmml, CMML_PARSE_ERROR);
-      return;
-    } else {
-      context->status->type = CMML_IMPORT;
-      context->status->stream->import = 
-	insert_import_tag(context->status->stream->import, attrs, context);
-      context->status->import_cnt++;
-    }
-    return;
-
-  } else if (cmml_strcmp(name, "param") == 0) {
-    if (context->status->type != CMML_IMPORT ||
-	context->status->stream == NULL ||
-	context->status->import_cnt < 0) {
-      cmml_set_error(cmml, CMML_TAG_IGNORED);
-      return;
-    } else {
-      context->status->stream->import =
-	insert_param_tag(context->status->stream->import, attrs, 
-			 context->status->import_cnt, context);
-    }
-    return;
-
-    
   /* ----- the "head" tag ----- */
   } else if (cmml_strcmp(name, "head") == 0) {
     /* has to be after cmml tag */
@@ -900,11 +616,7 @@
       context->status->type = CMML_HEAD;
       return;
     }
-    /* if there has been no stream tag, fix it up */
-    if (!context->status->stream) {
-      context->status->stream = cmml_stream_new();
-      context->status->stream->basetime = cmml_time_new("0");
-    }
+    context->status->stream->basetime = cmml_time_new("0");
     context->status->type = CMML_HEAD;
     /* there musn't be a head tag after a clip tag */
     if (context->status->clip) {
@@ -1100,39 +812,16 @@
   /* check the start time */
   if (ctxt->status->t_start) {
     in_interval = 0;
-    /* convert from utc to sec if necessary */
-    if (ctxt->status->t_start->type == CMML_UTC_TIME) {
-      ctxt->status->t_start = 
-	cmml_time_utc_to_sec (ctxt->status->t_start,
-			      ctxt->status->stream->utc,
-			      ctxt->status->stream->basetime->t.sec);
-      if (ctxt->status->t_start->t.sec < 0) {
-	cmml_time_free(ctxt->status->t_start);
-	ctxt->status->t_start = NULL;
-	in_interval = 1;
-      }
-    }
     /* compare the time of the clip */
     if (ctxt->status->t_start &&
-	ctxt->status->t_start->t.sec <= 
-	ctxt->status->clip->start_time->t.sec) {
-      in_interval = 1;
+	  ctxt->status->t_start->t.sec <= 
+	  ctxt->status->clip->start_time->t.sec) {
+        in_interval = 1;
     }
   }
 
   /* check the end time */
   if (ctxt->status->t_end) {
-    /* convert from utc to sec if necessary */
-    if (ctxt->status->t_end->type == CMML_UTC_TIME) {
-      ctxt->status->t_end = 
-	cmml_time_utc_to_sec (ctxt->status->t_end,
-			      ctxt->status->stream->utc,
-			      ctxt->status->stream->basetime->t.sec);
-      if (ctxt->status->t_end->t.sec < 0) {
-	cmml_time_free(ctxt->status->t_end);
-	ctxt->status->t_end = NULL;
-      }
-    }
     /* compare the time of the clip */
     if (ctxt->status->t_end) {
       if (ctxt->status->t_end->t.sec >=
@@ -1200,36 +889,6 @@
     context->status->type = CMML_NONE;
     return;
 
-  /* ----- the "stream" tag ----- */
-  } else if (cmml_strcmp(name, "stream") == 0) {
-    if (context->status->type != CMML_STREAM) {
-      /* ignore stream tag as there was no stream start tag */
-      cmml_set_error(cmml, CMML_TAG_IGNORED);
-      return;
-    }
-    /* disallow param tags and reset counter */
-    context->status->import_cnt = -1;
-    /* end of stream tag encountered -> throw user callback */
-    if (context->read_stream != NULL) {
-      context->read_stream ((CMML*)cmml, context->status->stream, context->user_data);
-    }
-    context->status->type = CMML_CMML;
-    return;
-
-  } else if (cmml_strcmp(name, "import") == 0) {
-    if (context->status->type != CMML_IMPORT) {
-      /* ignore import tag as there was no import start tag */
-      cmml_set_error(cmml, CMML_TAG_IGNORED);
-      return;
-    }
-    /* end of import tag encountered; go back to stream */
-    context->status->type = CMML_STREAM;
-    return;
-
-  } else if (cmml_strcmp(name, "param") == 0) {
-    /* empty tag: no action */
-    return;
-
   /* ----- the "head" tag ----- */
   } else if (cmml_strcmp(name, "head") == 0) {
     if (context->status->type != CMML_HEAD) {
@@ -1357,7 +1016,6 @@
   context->cdata->base = (XML_Char *) cmml_malloc(sizeof(XML_Char)*INIT_DATA_BUF_SIZE + 1);
   *(context->cdata->base) = '\0';
   context->cdata->limit = INIT_DATA_BUF_SIZE;
-  context->read_stream = NULL;
   context->read_head   = NULL;
   context->read_clip = NULL;
   context->user_data = NULL;
@@ -1366,15 +1024,13 @@
   context->status->info->xml_version      = NULL;
   context->status->info->xml_encoding     = NULL;
   context->status->info->xml_standalone   = -2;
-  context->status->info->doctype_declared = 0;
   context->status->info->cmml_lang        = NULL;
+  context->status->info->cmml_xml_lang    = NULL;
   context->status->info->cmml_dir         = NULL;
   context->status->info->cmml_id          = NULL;
   context->status->info->cmml_xmlns       = NULL;
-  context->status->info->cmml_granulerate = NULL;
+  context->status->info->cmml_role        = NULL;
   context->status->type = CMML_NONE;
-  context->status->stream = NULL;
-  context->status->import_cnt = -1;
   context->status->head   = NULL;
   context->status->clip = NULL;
   context->status->prev_clip = NULL;
@@ -1391,9 +1047,6 @@
   /* setup callback for xml directive tag to check validity */
   XML_SetXmlDeclHandler(context->parser, cmml_xml_decl_parse);
 
-  /* setup callback for doctype declaration */
-  XML_SetStartDoctypeDeclHandler(context->parser, cmml_doctype_parse);
-  
   /* setup parser for start/end tag handling to call the
      cmml_start and cmml_end function */
   XML_SetElementHandler(context->parser, cmml_start, cmml_end);
@@ -1417,7 +1070,6 @@
 
   /* status */
   cmml_preamble_destroy (context->status->info);
-  cmml_stream_destroy (context->status->stream);
   cmml_head_destroy   (context->status->head);
   cmml_clip_destroy (context->status->clip);
   cmml_clip_destroy (context->status->prev_clip);

Modified: libcmml/branches/cmml4/src/cmml_private.h
===================================================================
--- libcmml/trunk/src/cmml_private.h	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml_private.h	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -81,7 +81,6 @@
 
 /*
  * CMML_Status: contains current parsing state information such as
- * - a copy of the current stream tag
  * - a copy of the current headtag
  * - a link to the current a tag and its start & end times
  * - an indication which was the last parsed element's type
@@ -90,7 +89,6 @@
  * - whether there was a correctly parsed CMML DTD declaration
  * - when seeking, either the seconds or the id to seek for
  * Call the following functions to get (a copy of) the state info:
- * - cmml_get_last_stream
  * - cmml_get_last_head
  * - cmml_get_last_a
  * - cmml_get_last_error
@@ -98,8 +96,6 @@
 typedef struct {
   CMML_Preamble *info;
   CMML_Element_Type  type;
-  CMML_Stream *stream;
-  int          import_cnt;
   CMML_Head   *head;
   CMML_Clip   *clip;
   CMML_Clip   *prev_clip;
@@ -131,7 +127,6 @@
   int sloppy_parsing;         /* sloppy parsing turned on/off */
   CMML_Status * status;       /* current parsing status */
   CMML_DataBuf * cdata;       /* holding area for character data (PCDATA) */
-  CMMLReadStream read_stream; /* callback for stream tag */
   CMMLReadHead   read_head;   /* callback for head tag */
   CMMLReadClip read_clip; /* callback for clip tag */
   void * user_data;           /* user data for callback */
@@ -148,8 +143,6 @@
 CMML_Context * cmml_context_setup(FILE * file);
 FILE *         cmml_context_destroy(CMML_Context * context);
 int            cmml_parse_to_head (CMML_Context * context);
-CMML_ImportElement *
-               cmml_import_element_destroy (CMML_ImportElement * import);
 CMML_MetaElement *
                cmml_meta_element_destroy (CMML_MetaElement * meta);
 CMML_LinkElement *

Modified: libcmml/branches/cmml4/src/cmml_snprint.h
===================================================================
--- libcmml/trunk/src/cmml_snprint.h	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml_snprint.h	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -30,7 +30,7 @@
 
 /* cmml_snprint.h */
 
-/* macros for writing clip and import tags */
+/* macros for writing clip tags */
 
 #define BEGIN_TAG(name) \
   { \

Modified: libcmml/branches/cmml4/src/cmml_time.c
===================================================================
--- libcmml/trunk/src/cmml_time.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/src/cmml_time.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -248,10 +248,6 @@
 CMML_Time *
 cmml_time_new (const char * s)
 {
-  /* parse utc spec "clock:" */
-  if (strncmp(s, "clock:", 6) == 0) {
-    return cmml_utc_new(s+6);
-  }
   return cmml_sec_new(s);
 }
 
@@ -274,24 +270,6 @@
   return t;
 }
 
-/* creates a time struct only from name-value sec specs in utc */
-CMML_Time *
-cmml_utc_new (const char * s)
-{
-  CMML_Time * t;
-  t = (CMML_Time *) cmml_malloc(sizeof(CMML_Time));
-
-#ifdef DEBUG
-  fprintf(stderr, "creating new utc time: %s\n", s);
-#endif
-
-  t->tstr = cmml_strdup(s);
-  t->type = CMML_UTC_TIME;
-  t->t.utc = cmml_utc_parse(s);
-
-  return t;
-}
-
 /* handles start and end times for clip tags, where we will only store sec offsets */
 CMML_Time *
 cmml_time_new_in_sec (const char * s, CMML_Time * ref, double base)
@@ -302,40 +280,7 @@
   return cmml_time_utc_to_sec (t, ref, base);
 }
 
-/* convert a time from UTC to secs with ref to a time base */
-CMML_Time *
-cmml_time_utc_to_sec (CMML_Time * t, CMML_Time * ref, double base)
-{
-  double timediff;
-  char txtsec[100];
 
-  if (t->type == CMML_UTC_TIME && ref != NULL) {
-    /* convert to seconds representation */
-    timediff = cmml_utc_diff (t->t.utc, ref->t.utc);
-#ifdef DEBUG
-    fprintf(stderr, "comparing %s with %s\n", t->tstr, ref->tstr);
-    fprintf(stderr, "UTC time parsed in stream tag\n");
-    fprintf(stderr, "Year=%d\tMonth=%d\tDay=%d\n", 
-	    t->t.utc->tm_year, t->t.utc->tm_mon, t->t.utc->tm_mday);
-    fprintf(stderr, "Hour=%d\tMinutes=%d\tSec=%d\tHSec=%d\n",
-	    t->t.utc->tm_hour, t->t.utc->tm_min, 
-	    t->t.utc->tm_sec, t->t.utc->tm_hsec);
-    fprintf(stderr, "Year=%d\tMonth=%d\tDay=%d\n", 
-	    ref->t.utc->tm_year, ref->t.utc->tm_mon, ref->t.utc->tm_mday);
-    fprintf(stderr, "Hour=%d\tMinutes=%d\tSec=%d\tHSec=%d\n",
-	    ref->t.utc->tm_hour, ref->t.utc->tm_min, 
-	    ref->t.utc->tm_sec, ref->t.utc->tm_hsec);
-    fprintf(stderr, "creating new time with %f sec\n", timediff);
-#endif
-    cmml_time_free(t);
-    timediff += base;
-    cmml_snprintf (txtsec, 100, "%f", timediff);
-    t = cmml_time_new (txtsec);
-  }
-  return t;
-}
-
-
 /* creates two time constructs if the string was a time range, otherwise
    just a t_start time, and returns the number of times created;
    examples: npt:40,79 or smpte-25:00:20:20,00:21:30 */
@@ -367,9 +312,6 @@
     start_time = strncpy (start_time, s, len_start_time);
     start_time[len_start_time]='\0';
     *t_start = cmml_time_new(start_time);
-    if ((*t_start)->type == CMML_UTC_TIME) {
-      *t_end = cmml_utc_new(pos+1);
-    } else {
       /* Find out what type the timestamp is and parse appropriately */
       if (strncmp(s, "smpte-24", 8) == 0) {
 	seconds = parse_smpte(pos+1, 24.0);
@@ -398,7 +340,6 @@
 	(*t_end)->type = CMML_SEC_TIME;
 	(*t_end)->t.sec = seconds;
       }
-    }
     return 2;
   }
   return -1;
@@ -410,9 +351,6 @@
 {
   if (t == NULL) return;
   cmml_free(t->tstr);
-  if (t->type == CMML_UTC_TIME) {
-    cmml_free(t->t.utc);
-  }
   cmml_free(t);
   return;
 }
@@ -426,16 +364,14 @@
   t = (CMML_Time*) cmml_malloc(sizeof(CMML_Time));
   t->tstr = cmml_strdup(t1->tstr);
   t->type = t1->type;
-  if (t->type == CMML_UTC_TIME) {
-    t->t.utc = cmml_utc_clone (t1->t.utc);
-  } else if (t->type == CMML_SEC_TIME) {
+  if (t->type == CMML_SEC_TIME) {
     t->t.sec = t1->t.sec;
   }
 
   return t;
 }
 
-/* cmml_parse_sec: parse a sec-string of stream, head or clip tag */
+/* cmml_parse_sec: parse a sec-string of head or clip tag */
 /* this parses a name-value pair of npt:xxx, smpte:xxx etc. */
 double
 cmml_sec_parse (const char * str)
@@ -505,165 +441,6 @@
   return t;  
 }
 
-/* cmml_parse_utc: parse a utc-string of utc-tag in head or of clips */
-/* this is just parsing the plain utc string YYYYMMDDTHHmmss.hhZ */
-CMML_UTC *
-cmml_utc_parse (const char * s)
-{
-  CMML_UTC * t;
-  int n;
-  char tm_year[5], tm_month[3], tm_day[3], tm_hour[3], tm_min[3], tm_sec[3];
-
-  t = (CMML_UTC *) cmml_malloc(sizeof(CMML_UTC));
-
-  /* try parsing and return NULL in case of failure */
-  n = sscanf (s, "%4s%2s%2s%*c%2s%2s%2s.%hi", tm_year, tm_month, tm_day, 
-              tm_hour, tm_min, tm_sec, &(t->tm_hsec));
-#ifdef DEBUG
-  if (n==6 || n==7) fprintf(stderr, "Successfully ");
-  fprintf(stderr, "Parsed UTC time: %s\n", s);
-  fprintf(stderr, "Year=%4s\tMonth=%2s\tDay=%2s\n", 
-	  tm_year, tm_month, tm_day);
-  fprintf(stderr, "Hour=%2s\tMinutes=%2s\tSec=%2s\tHSec=%d\n",
-	  tm_hour, tm_min, tm_sec, t->tm_hsec);
-#endif
-
-  if (n==6 || n==7) {
-    /* successful parsing: assign values to fields */
-    t->tm_year = (short) atoi(tm_year);
-    t->tm_mon  = (short) atoi(tm_month);
-    t->tm_mday = (short) atoi(tm_day);
-    t->tm_hour = (short) atoi(tm_hour);
-    t->tm_min  = (short) atoi(tm_min);
-    t->tm_sec  = (short) atoi(tm_sec);
-
-#ifdef DEBUG
-    fprintf(stderr, "Year=%d\tMonth=%d\tDay=%d\n", 
-	    t->tm_year, t->tm_mon, t->tm_mday);
-    fprintf(stderr, "Hour=%d\tMinutes=%d\tSec=%d\tHSec=%d\n",
-	    t->tm_hour, t->tm_min, t->tm_sec, t->tm_hsec);
-#endif
-    
-    /* check valid time specs */
-    if ((t->tm_mon < 1 || t->tm_mon > 12) ||
-        (t->tm_mday < 1 || t->tm_mday > 31) ||
-        (t->tm_hour < 0 || t->tm_hour > 23) ||
-        (t->tm_min < 0 || t->tm_min > 59) ||
-        (t->tm_sec < 0 || t->tm_sec > 59) ||
-        (t->tm_hsec < 0 || t->tm_hsec > 99)) {
-      cmml_free(t);
-      return NULL;
-    } else {
-      return t;
-    }
-  } else {
-    cmml_free (t);
-    return NULL;
-  }
-}
-
-/* copy a utc time */
-CMML_UTC *
-cmml_utc_clone (CMML_UTC * t1)
-{
-  CMML_UTC * t;
-  if (t1 == NULL) return NULL;
-  t = (CMML_UTC *) cmml_malloc(sizeof(CMML_UTC));
-  t->tm_hsec = t1->tm_hsec;
-  t->tm_sec  = t1->tm_sec;
-  t->tm_min  = t1->tm_min;
-  t->tm_hour = t1->tm_hour;
-  t->tm_mday = t1->tm_mday;
-  t->tm_mon  = t1->tm_mon;
-  t->tm_year = t1->tm_year;
-  return t;
-}
-
-/* difference of two utc times in seconds */
-double
-cmml_utc_diff (CMML_UTC *t2, CMML_UTC *t1)
-{
-  double diffsec;
-
-  diffsec = (t2->tm_hsec - t1->tm_hsec)/100;
-  diffsec += (t2->tm_sec - t1->tm_sec);
-  diffsec += 60.0*(t2->tm_min - t1->tm_min);
-  diffsec += 3600.0*(t2->tm_hour - t1->tm_hour);
-  diffsec += 24.0*3600*(t2->tm_mday - t1->tm_mday);
-  /* presuming there are 30.4375 days in each month (=365.25/12)*/
-  diffsec += 30.4375*24*3600*(t2->tm_mon - t1->tm_mon);
-  diffsec += 12.0*30*24*3600*(t2->tm_year - t1->tm_year);
-
-#ifdef DEBUG
-  fprintf(stderr, "t1: Year=%d\tMonth=%d\tDay=%d\n", 
-	  t1->tm_year, t1->tm_mon, t1->tm_mday);
-  fprintf(stderr, "Hour=%d\tMinutes=%d\tSec=%d\tHSec=%d\n",
-	  t1->tm_hour, t1->tm_min, t1->tm_sec, t1->tm_hsec);
-  fprintf(stderr, "t2: Year=%d\tMonth=%d\tDay=%d\n", 
-	  t2->tm_year, t2->tm_mon, t2->tm_mday);
-  fprintf(stderr, "Hour=%d\tMinutes=%d\tSec=%d\tHSec=%d\n",
-	  t2->tm_hour, t2->tm_min, t2->tm_sec, t2->tm_hsec);
-  fprintf(stderr, "diffsec = %f\n", diffsec);
-#endif
-
-  return diffsec;
-
-  /* seems like the system time functions don't work */
-#if 0
-  time_t time1, time2;
-  struct tm tmptm1;
-  struct tm tmptm2;
-  double diffreturn;
-
-  if (t1 == NULL || t2 == NULL) {
-    return -1;
-  }
-
-  /* transform t1 to struct tm and seconds from EPOCH */
-  tmptm1.tm_sec  = t1->tm_sec;
-  tmptm1.tm_min  = t1->tm_min;
-  tmptm1.tm_hour = t1->tm_hour;
-  tmptm1.tm_mday = t1->tm_mday;
-  tmptm1.tm_mon  = t1->tm_mon-1;
-  tmptm1.tm_year = t1->tm_year-1900;
-  time1 = mktime(&tmptm1);
-#ifdef DEBUG
-  fprintf(stderr,"time1 %ld\n", time1);
-  fprintf(stderr, "Year=%d(%d)\tMonth=%d(%d)\tDay=%d(%d)\n", 
-	  tmptm1.tm_year, t1->tm_year, tmptm1.tm_mon, t1->tm_mon, tmptm1.tm_mday, t1->tm_mday);
-  fprintf(stderr, "Hour=%d(%d)\tMinutes=%d(%d)\tSec=%d(%d)\tHSec=0(%d)\n",
-	  tmptm1.tm_hour, t1->tm_hour, tmptm1.tm_min, t1->tm_min, tmptm1.tm_sec, t1->tm_sec, 
-	  t1->tm_hsec);
-#endif
-
-  /* convert t2 to struct tm and seconds from EPOCH */
-  tmptm2.tm_sec  = t2->tm_sec;
-  tmptm2.tm_min  = t2->tm_min;
-  tmptm2.tm_hour = t2->tm_hour;
-  tmptm2.tm_mday = t2->tm_mday;
-  tmptm2.tm_mon  = t2->tm_mon-1;
-  tmptm2.tm_year = t2->tm_year-1900;
-  time2 = mktime(&tmptm2);
-#ifdef DEBUG
-  fprintf(stderr,"time2 %ld\n", time2);
-  fprintf(stderr, "Year=%d(%d)\tMonth=%d(%d)\tDay=%d(%d)\n", 
-	  tmptm2.tm_year, t2->tm_year, tmptm2.tm_mon, t2->tm_mon, tmptm2.tm_mday, t2->tm_mday);
-  fprintf(stderr, "Hour=%d(%d)\tMinutes=%d(%d)\tSec=%d(%d)\tHSec=0(%d)\n",
-	  tmptm2.tm_hour, t2->tm_hour, tmptm2.tm_min, t2->tm_min, tmptm2.tm_sec, t2->tm_sec, 
-	  t2->tm_hsec);
-#endif
-
-  /* use system's time difference functions for calculation */
-  diffreturn = (double) difftime (time2, time1);
-  fprintf(stderr, "diffreturn=%f\n", diffreturn);
-  diffreturn += (t2->tm_hsec - t1->tm_hsec)/100;
-
-  return diffreturn;
-#endif
-
-}
-
-
 /*
  * cmml_npt_snprint: prints npt time to a string in the
  * format Hmmss.hh
@@ -691,43 +468,3 @@
   }
 
 }
-
-/*
- * cmml_utc_snprint: print utc time to a string in the
- * format YYYYMMDDTHHmmss.hhZ
- */
-int cmml_utc_snprint (char *buf, int n, CMML_UTC *t) 
-{
-  if (t == NULL) return 0;
-  if (n < 20) return 0;
-  
-  return sprintf (buf, "%4d%2d%2dT%2d%2d%2d.%3d", 
-		  t->tm_year,
-		  t->tm_mon,
-		  t->tm_mday,
-		  t->tm_hour,
-		  t->tm_min,
-		  t->tm_sec,
-		  t->tm_hsec);
-}
-
-/*
- * cmml_utc_pretty_snprint: print utc time to a string in the
- * format "DATE: MM/DD/YYYY TIME: HH:mm:ss.hh"
- */
-int cmml_utc_pretty_snprint (char *buf, int n, CMML_UTC *t)
-{
-  int n_written;
-  if (t == NULL) return 0;
-  n_written = sprintf (buf, "DATE: %02d/%02d/%04d TIME: %02d:%02d:%02d.%03d", 
-		       t->tm_mon,
-		       t->tm_mday,
-		       t->tm_year,
-
-		       t->tm_hour,
-		       t->tm_min,
-		       t->tm_sec,
-		       t->tm_hsec);
-  
-  return n_written;
-}

Modified: libcmml/branches/cmml4/tests/Makefile.am
===================================================================
--- libcmml/trunk/tests/Makefile.am	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/Makefile.am	2008-04-13 06:22:17 UTC (rev 3551)
@@ -119,16 +119,6 @@
 		echo "  cmml-seek-offset ... passed"; \
 	fi
 
-# seeking to utc offset
-	@../examples/cmml-seek-utc ${TESTSDIR}/special2.cmml 20021222T221105Z | diff -b - ${TESTSDIR}/special2.cmml.offset; \
-	if test $$? -ne 0 ; then \
-		echo "  libcmml: error on cmml-seek-utc special2.cmml 20021222T221105Z"; \
-		echo "---------------------------------------------------------------"; \
-		exit 1; \
-	else \
-		echo "  cmml-seek-utc ... passed"; \
-	fi
-
 # uri file opening id
 	@../examples/cmml-uri-file file://${TESTSDIR}/special2.cmml\#Question_Storm_Water | diff -b - ${TESTSDIR}/special2.cmml.offset; \
 	if test $$? -ne 0 ; then \

Modified: libcmml/branches/cmml4/tests/error1.cmml
===================================================================
--- libcmml/trunk/tests/error1.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error1.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,13 +3,6 @@
 
 <cmml lang="en">
 
-<stream basetime="npt:0">
-  <import contenttype="video/x-theora" src="series1Air_t.ogg" start="npt:0"/>
-  <import contenttype="audio/x-vorbis" src="series1Air_v.ogg" start="npt:0"/>
-  <import contenttype="audio/x-speex" src="series1Air.spx" start="npt:7"/>
-  <import contenttype="video/mpeg" src="series1Air.mpg" start="npt:0"/>
-</stream>
-
 <head>
 <title>
 Australia Advances Series - Personal Air Monitor

Modified: libcmml/branches/cmml4/tests/error1.cmml.correct
===================================================================
--- libcmml/trunk/tests/error1.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error1.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,13 +3,6 @@
 
 <cmml lang="en">
 
-<stream basetime="npt:0.000">
-<import contenttype="video/x-theora" src="series1Air_t.ogg" start="npt:0.000"/>
-<import contenttype="audio/x-vorbis" src="series1Air_v.ogg" start="npt:0.000"/>
-<import contenttype="audio/x-speex" src="series1Air.spx" start="npt:7.000"/>
-<import contenttype="video/mpeg" src="series1Air.mpg" start="npt:0.000"/>
-</stream>
-
 <head>
 <title>
 Australia Advances Series - Personal Air Monitor

Modified: libcmml/branches/cmml4/tests/error10.cmml
===================================================================
--- libcmml/trunk/tests/error10.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error10.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml lang="pl">
 
-<stream basetime="npt:0">
-  <import contenttype="video/mpeg" src="fish.mpg" start="npt:0"/>
-</stream>
-
 <head lang="en">
   <title>Types of fish</title>
   <meta name="Producer" content="Joe Ordinary"/>

Modified: libcmml/branches/cmml4/tests/error10.cmml.correct
===================================================================
--- libcmml/trunk/tests/error10.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error10.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,10 +4,6 @@
 
 <cmml lang="pl">
 
-<stream basetime="npt:0.000">
-<import contenttype="video/mpeg" src="fish.mpg" start="npt:0.000"/>
-</stream>
-
 <head lang="en">
 <title>Types of fish</title>
 <meta name="Producer" content="Joe Ordinary"/>

Modified: libcmml/branches/cmml4/tests/error11.cmml
===================================================================
--- libcmml/trunk/tests/error11.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error11.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="0" utc="today">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error12.cmml
===================================================================
--- libcmml/trunk/tests/error12.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error12.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="0">
-<media contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error13.cmml
===================================================================
--- libcmml/trunk/tests/error13.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error13.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="0">
-<import contenttype="audio/x-wav"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error14.cmml
===================================================================
--- libcmml/trunk/tests/error14.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error14.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml xmlns="test">
 
-<stream id="a1" basetime="0">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error15.cmml
===================================================================
--- libcmml/trunk/tests/error15.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error15.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="0">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error15.cmml.correct
===================================================================
--- libcmml/trunk/tests/error15.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error15.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,10 +4,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="0.000">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0.000"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error2.cmml
===================================================================
--- libcmml/trunk/tests/error2.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error2.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="npt:100.3" utc="20021222T221005Z">
-<import id="a2" granulerate="1000" contenttype="audio/x-wav" src="00-3-10.wav" start="npt:100.3"/>
-</stream>
-
 <head lang="en">
 <title>
 Do we take water for granted?

Modified: libcmml/branches/cmml4/tests/error2.cmml.correct
===================================================================
--- libcmml/trunk/tests/error2.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error2.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,10 +4,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="npt:100.300" utc="20021222T221005Z">
-<import id="a2" granulerate="1000" contenttype="audio/x-wav" src="00-3-10.wav" start="npt:100.300"/>
-</stream>
-
 <head lang="en">
 <title>
 Do we take water for granted?

Modified: libcmml/branches/cmml4/tests/error3.cmml
===================================================================
--- libcmml/trunk/tests/error3.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error3.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" timebase="5">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error3.cmml.correct
===================================================================
--- libcmml/trunk/tests/error3.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error3.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,10 +4,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="5.000">
-<import contenttype="audio/x-wav" src="00-3-18.wav" start="npt:0.000"/>
-</stream>
-
 <head lang="en">
 <title>Buried dams of water</title>
 </head>

Modified: libcmml/branches/cmml4/tests/error4.cmml
===================================================================
--- libcmml/trunk/tests/error4.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error4.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream basetime="npt:0">
-<import id="a1" contenttype="video/mpeg" src="cleaner.mpg" start="npt:0"/>
-</stream>
-
 <head>
 <title>
 Australia Advances Series - Cleaner Power Stations

Modified: libcmml/branches/cmml4/tests/error4.cmml.correct
===================================================================
--- libcmml/trunk/tests/error4.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error4.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,10 +4,6 @@
 
 <cmml>
 
-<stream basetime="npt:0.000">
-<import id="a1" contenttype="video/mpeg" src="cleaner.mpg" start="npt:0.000"/>
-</stream>
-
 <head>
 <title>
 Australia Advances Series - Cleaner Power Stations

Modified: libcmml/branches/cmml4/tests/error5.cmml
===================================================================
--- libcmml/trunk/tests/error5.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error5.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,11 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <!DOCTYPE cmml SYSTEM "cmml.dtd">
 
-<stream id="a" basetime="npt:29.69" utc="20030517T155030.000Z">
-<import id="flim" contenttype="video/quicktime" src="rtsp://my.location.com/flim.anx#@npt=20-30" start="npt:12"/>
-<import id="flim2" contenttype="video/mpeg" src="http://www.flim.com/flam.anx" start="npt:0" end="npt:12"/>
-</stream>
-
 <head>
 <title>
 I have five projects on sourceforge.

Modified: libcmml/branches/cmml4/tests/error6.cmml
===================================================================
--- libcmml/trunk/tests/error6.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error6.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml lang="en">
 
-<stream basetime="npt:0">
-<import src="matrix.mpg" start="npt:0"/>
-</stream>
-
 <clip id="no_spoon" lang="en" start="npt:46:5.9" end="npt:51:3.4">
 <meta name="Actor" content="Keanu Reeves"/>
 <meta name="Actor" content="Rowan Witt"/>

Modified: libcmml/branches/cmml4/tests/error6.cmml.correct
===================================================================
--- libcmml/trunk/tests/error6.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error6.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,8 +3,3 @@
 <!DOCTYPE cmml SYSTEM "cmml.dtd">
 
 <cmml lang="en">
-
-<stream basetime="npt:0.000">
-<import src="matrix.mpg" start="npt:0.000"/>
-</stream>
-

Modified: libcmml/branches/cmml4/tests/error7.cmml
===================================================================
--- libcmml/trunk/tests/error7.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error7.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -20,10 +20,6 @@
 </desc>
 </clip>
 
-<stream basetime="npt:0">
-<import contenttype="video/mpeg" src="GrimNewsOnOzoneB.mpg" start="npt:0"/>
-</stream>
-
 <clip id="startspeech" start="npt:9">
 <desc>
  Just when you thought the Earth's ozone layer was safe

Modified: libcmml/branches/cmml4/tests/error9.cmml
===================================================================
--- libcmml/trunk/tests/error9.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error9.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,14 +3,6 @@
 
 <cmml lang="en">
 
-<stream basetime="npt:0">
-  <import contenttype="video/mpeg" src="fish.mpg" start="npt:0"/>
-</stream>
-
-<stream basetime="npt:0">
-  <import contenttype="video/x-theora" src="fish.ogg" start="npt:0"/>
-</stream>
-
 <head>
   <title>Types of fish</title>
   <meta name="Producer" content="Joe Ordinary"/>

Modified: libcmml/branches/cmml4/tests/error9.cmml.correct
===================================================================
--- libcmml/trunk/tests/error9.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/error9.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -4,7 +4,3 @@
 
 <cmml lang="en">
 
-<stream basetime="npt:0.000">
-<import contenttype="video/mpeg" src="fish.mpg" start="npt:0.000"/>
-</stream>
-

Modified: libcmml/branches/cmml4/tests/i18n.cmml
===================================================================
--- libcmml/trunk/tests/i18n.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/i18n.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml lang="pl">
 
-<stream basetime="npt:0">
-  <import contenttype="video/mpeg" src="fish.mpg" start="npt:0"/>
-</stream>
-
 <head lang="en" dir="ltr" profile="http://www.annodex.net/profile.tst">
   <title lang="en" dir="ltr" id="fishtitle">Types of fish</title>
   <base id="base" href="http://www.annodex.net/"/>

Modified: libcmml/branches/cmml4/tests/i18n.cmml.correct
===================================================================
--- libcmml/trunk/tests/i18n.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/i18n.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml lang="pl">
 
-<stream basetime="npt:0.000">
-<import contenttype="video/mpeg" src="fish.mpg" start="npt:0.000"/>
-</stream>
-
 <head lang="en" dir="ltr" profile="http://www.annodex.net/profile.tst">
 <title id="fishtitle" lang="en" dir="ltr">Types of fish</title>
 <base id="base" href="http://www.annodex.net/"/>

Modified: libcmml/branches/cmml4/tests/simple.cmml
===================================================================
--- libcmml/trunk/tests/simple.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/simple.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,15 +3,6 @@
 
 <cmml lang="en" dir="ltr" id="simple" granulerate="1000/1">
 
-<stream id="fish" basetime="0">
-  <import id="videosrc" lang="en" dir="ltr" title="Video fish" 
-          granulerate="25/1" contenttype="video/mpeg" 
-          src="fish.mpg" start="0" end="360">
-    <param id="vheight" name="video.height" value="250"/>
-    <param id="vwidth"  name="video.width"  value="180"/>
-  </import>
-</stream>
-
 <head>
   <title>Types of fish</title>
   <meta name="Producer" content="Joe Ordinary"/>

Modified: libcmml/branches/cmml4/tests/simple.cmml.correct
===================================================================
--- libcmml/trunk/tests/simple.cmml.correct	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/simple.cmml.correct	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,13 +3,6 @@
 
 <cmml id="simple" lang="en" dir="ltr">
 
-<stream id="fish" basetime="0.000">
-<import id="videosrc" lang="en" dir="ltr" granulerate="25/1" contenttype="video/mpeg" src="fish.mpg" start="0.000" end="360.000" title="Video fish">
-<param id="vheight" name="video.height" value="250"/>
-<param id="vwidth" name="video.width" value="180"/>
-</import>
-</stream>
-
 <head>
 <title>Types of fish</title>
 <meta name="Producer" content="Joe Ordinary"/>

Modified: libcmml/branches/cmml4/tests/special1.cmml
===================================================================
--- libcmml/trunk/tests/special1.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/special1.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream basetime="npt:0">
-<import id="a1" contenttype="video/mpeg" src="series1Air.mpg" start="npt:0"/>
-</stream>
-
 <head>
 <title>
 Australia Advances Series - Personal Air Monitor

Modified: libcmml/branches/cmml4/tests/special2.cmml
===================================================================
--- libcmml/trunk/tests/special2.cmml	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tests/special2.cmml	2008-04-13 06:22:17 UTC (rev 3551)
@@ -3,10 +3,6 @@
 
 <cmml>
 
-<stream id="a1" basetime="npt:100.3" utc="20021222T221005Z">
-<import id="a2" granulerate="1000" contenttype="audio/x-wav" src="00-3-10.wav" start="npt:100.3"/>
-</stream>
-
 <head lang="en">
 <title>
 Do we take water for granted?

Modified: libcmml/branches/cmml4/tools/Makefile.am
===================================================================
--- libcmml/trunk/tools/Makefile.am	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tools/Makefile.am	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-# Copyright (C) 2003 CSIRO Australia
+# Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 #
 #  Redistribution and use in source and binary forms, with or without
 #  modification, are permitted provided that the following conditions

Modified: libcmml/branches/cmml4/tools/cmml-fix.c
===================================================================
--- libcmml/trunk/tools/cmml-fix.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tools/cmml-fix.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -63,8 +63,6 @@
                  Start parsing from the named clip.
   -s seconds,  --sec seconds
                  Start parsing from the given seconds offset
-  -u utc,      --utc utc
-                 Start parsing from the given utc time
   -o filename, --output filename
                  Specify the output filename. The file is written
                  to standard output by default.
@@ -101,8 +99,6 @@
   fprintf(stderr, "                 Start parsing from the named clip.\n");
   fprintf(stderr, "  -s seconds,  --sec seconds\n");
   fprintf(stderr, "                 Start parsing from the given seconds offset\n");
-  fprintf(stderr, "  -u utc,      --utc utc\n");
-  fprintf(stderr, "                 Start parsing from the given utc time\n");
   fprintf(stderr, "  -o filename, --output filename\n");
   fprintf(stderr, "                 Specify the output filename. The file is written\n");
   fprintf(stderr, "                 to standard output by default.\n");
@@ -111,7 +107,6 @@
 #else
   fprintf(stderr, "  -i clip_id     Start parsing from the named clip\n");
   fprintf(stderr, "  -s seconds     Start parsing from the given seconds offset\n");
-  fprintf(stderr, "  -u utc         Start parsing from the given utc time\n");
   fprintf(stderr, "  -o filename\n");
   fprintf(stderr, "                 Specify the output filename. The file is written\n");
   fprintf(stderr, "                 to standard output by default.\n");
@@ -123,32 +118,6 @@
 }
 
 /**
- * read_stream: the callback for a stream element
- *
- * \param cmml the CMML* handle in use
- * \param stream the stream element's content represented in a
- *        CMML_Stream*
- * \param user_data user defined data
- *
- * \returns 0 on success, 1 on error
- */
-static int
-read_stream (CMML * cmml, const CMML_Stream * stream, void * user_data) {
-  char buf[BUFSIZE];
-  CMML_Error * err;
-  if ((err = cmml_get_last_error(cmml)) != NULL) {
-    cmml_error_snprint(buf, BUFSIZE, err, cmml);
-    fprintf(stderr, "cmml-fix: Parsing stream tag %s\n", buf);
-    fprintf(stderr, "cmml-fix: Non-recoverable error\n");
-    return -1;
-  } else {
-    /* print stream */
-    cmml_stream_pretty_snprint (buf, BUFSIZE, (CMML_Stream *) stream);
-    fprintf(outfile, "%s\n", buf);
-  }  return 0;
-}
-
-/**
  * read_head: the callback for a head element
  *
  * \param cmml the CMML* handle in use
@@ -217,7 +186,6 @@
   long n = 0;
   char * clip_id = NULL;
   double secs = -1.0;
-  char * utc = NULL;
   char * outfilename = NULL;
   buf[0]='\0';
 
@@ -234,7 +202,6 @@
       {"output", required_argument,0,'o'},
       {"id",required_argument,0,'i'},
       {"sec",required_argument,0,'s'},
-      {"utc",required_argument,0,'u'},
       {0,0,0,0}
     };
 
@@ -265,9 +232,6 @@
 	secs = atof(optarg);
       }
       break;
-    case 'u': /* utc */
-      utc = optarg;
-      break;
     default:
       break;
     }
@@ -296,7 +260,7 @@
 
   /* try open file for parsing and setup cmml parsing */
   errno=0;
-  if (strcmp (pathfile, "-") == 0) {
+  if (strcmp (pathfile, "-") == 0) {
     doc = cmml_new (stdin);
   } else {
     doc = cmml_open (pathfile);
@@ -322,23 +286,21 @@
   /* seek to clip_id; if not found, to file end */
   if (clip_id != NULL) {
     /* register callbacks */
-    cmml_set_read_callbacks (doc, read_stream, read_head, NULL, NULL);
+    cmml_set_read_callbacks (doc, read_head, NULL, NULL);
     cmml_skip_to_id (doc, clip_id);
   }
 
   /* seek to time offset; if not found, to file end */
-  if (secs > 0 || utc != NULL) {
+  if (secs > 0) {
     /* register callbacks */
-    cmml_set_read_callbacks (doc, read_stream, read_head, NULL, NULL);
+    cmml_set_read_callbacks (doc, read_head, NULL, NULL);
     if (secs > 0) {
       cmml_skip_to_secs (doc, secs);
-    } else { /* if (utc != NULL) { */
-      cmml_skip_to_utc (doc, utc);
     }
   }
 
   /* register callbacks */
-  cmml_set_read_callbacks (doc, read_stream, read_head, read_clip, NULL);
+  cmml_set_read_callbacks (doc, read_head, read_clip, NULL);
 
   /* read document frame-wise and check against CMML.dtd */
   while ((n = cmml_read (doc, BUFSIZE)) > 0) {

Modified: libcmml/branches/cmml4/tools/cmml-fortune.c
===================================================================
--- libcmml/trunk/tools/cmml-fortune.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tools/cmml-fortune.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions

Modified: libcmml/branches/cmml4/tools/cmml-timeshift.c
===================================================================
--- libcmml/trunk/tools/cmml-timeshift.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tools/cmml-timeshift.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -118,33 +118,6 @@
 }
 
 /**
- * read_stream: the callback for a stream element
- *
- * \param cmml the CMML* handle in use
- * \param stream the stream element's content represented in a
- *        CMML_Stream*
- * \param user_data user defined data
- *
- * \returns 0 on success, 1 on error
- */
-static int
-read_stream (CMML * cmml, const CMML_Stream * stream, void * user_data) {
-  char buf[BUFSIZE];
-  CMML_Error * err;
-  if ((err = cmml_get_last_error(cmml)) != NULL) {
-    cmml_error_snprint(buf, BUFSIZE, err, cmml);
-    fprintf(stderr, "cmml-timeshift: Parsing stream tag %s\n", buf);
-    fprintf(stderr, "cmml-timeshift: Non-recoverable error\n");
-    return -1;
-  } else {
-    /* print stream */
-    cmml_stream_pretty_snprint (buf, BUFSIZE, (CMML_Stream *) stream);
-    fprintf(outfile, "%s\n", buf);
-  }
-  return 0;
-}
-
-/**
  * read_head: the callback for a head element
  *
  * \param cmml the CMML* handle in use
@@ -328,7 +301,7 @@
   fprintf(outfile, "%s\n", buf);
 
   /* register callbacks */
-  cmml_set_read_callbacks (doc, read_stream, read_head, read_clip, NULL);
+  cmml_set_read_callbacks (doc, read_head, read_clip, NULL);
 
   /* read document frame-wise and check against CMML.dtd */
   while ((n = cmml_read (doc, BUFSIZE)) > 0) {

Modified: libcmml/branches/cmml4/tools/cmml-validate.c
===================================================================
--- libcmml/trunk/tools/cmml-validate.c	2008-04-07 09:03:45 UTC (rev 3547)
+++ libcmml/branches/cmml4/tools/cmml-validate.c	2008-04-13 06:22:17 UTC (rev 3551)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 CSIRO Australia
+/* Copyright (C) 2003-2007 CSIRO Australia, 2008- Annodex Association
 
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
@@ -64,8 +64,6 @@
                  Start parsing from the named clip.
   -s seconds, --sec seconds
                  Start parsing from the given seconds offset
-  -u utc,     --utc utc
-                 Start parsing from the given utc time
   -b, --verbose  Output parsed file to stdout
   -h, --help     Display this help information
   -v, --version  Display version information
@@ -102,15 +100,12 @@
   fprintf(stderr, "                 Start parsing from the named clip.\n");
   fprintf(stderr, "  -s seconds, --sec seconds\n");
   fprintf(stderr, "                 Start parsing from the given seconds offset\n");
-  fprintf(stderr, "  -u utc,     --utc utc\n");
-  fprintf(stderr, "                 Start parsing from the given utc time\n");
   fprintf(stderr, "  -b, --verbose  Output parsed file to stdout\n");
   fprintf(stderr, "  -h, --help     Display this help information\n");
   fprintf(stderr, "  -v, --version  Display version information\n");
 #else
   fprintf(stderr, "  -i clip_id     Start parsing from the named clip\n");
   fprintf(stderr, "  -s seconds     Start parsing from the given seconds offset\n");
-  fprintf(stderr, "  -u utc         Start parsing from the given utc time\n");
   fprintf(stderr, "  -b             Output parsed file to stdout\n");
   fprintf(stderr, "  -h             Display this help information\n");
   fprintf(stderr, "  -v             Display version information\n");
@@ -120,34 +115,6 @@
 }
 
 /**
- * read_stream: the callback for a stream element
- *
- * \param cmml the CMML* handle in use
- * \param stream the stream element's content represented in a
- *        CMML_Stream*
- * \param user_data user defined data
- *
- * \returns 0 on success, 1 on error
- */
-static int
-read_stream (CMML * cmml, const CMML_Stream * stream, void * user_data) {
-  char buf[BUFSIZE];
-  CMML_Error * err;
-  if ((err = cmml_get_last_error(cmml)) != NULL) {
-    cmml_error_snprint(buf, BUFSIZE, err, cmml);
-    fprintf(stderr, "cmml-validate: Parsing stream tag %s\n", buf);
-    fprintf(stderr, "cmml-validate: Non-recoverable error\n");
-    return -1;
-  } else {
-    /* print stream */
-    if (verbose) {
-      cmml_stream_pretty_snprint (buf, BUFSIZE, (CMML_Stream *) stream);
-      fprintf(stdout, "%s\n", buf);
-    }
-  }  return 0;
-}
-
-/**
  * read_head: the callback for a head element
  *
  * \param cmml the CMML* handle in use
@@ -220,7 +187,6 @@
   long n = 0;
   char * clip_id = NULL;
   double secs = -1.0;
-  char * utc = NULL;
   int sloppy = 0;
   verbose = 0;
 
@@ -235,7 +201,6 @@
       {"sloppy",no_argument,0,'y'},
       {"id",required_argument,0,'i'},
       {"sec",required_argument,0,'s'},
-      {"utc",required_argument,0,'u'},
       {0,0,0,0}
     };
 
@@ -263,9 +228,6 @@
 	secs = atof(optarg);
       }
       break;
-    case 'u': /* utc */
-      utc = optarg;
-      break;
     case 'y': /* sloppy */
       sloppy = 1;
       break;
@@ -321,23 +283,21 @@
   /* seek to clip_id; if not found, to file end */
   if (clip_id != NULL) {
     /* register callbacks */
-    cmml_set_read_callbacks (doc, read_stream, read_head, NULL, NULL);
+    cmml_set_read_callbacks (doc, read_head, NULL, NULL);
     cmml_skip_to_id (doc, clip_id);
   }
 
   /* seek to time offset; if not found, to file end */
-  if (secs > 0 || utc != NULL) {
+  if (secs > 0) {
     /* register callbacks */
-    cmml_set_read_callbacks (doc, read_stream, read_head, NULL, NULL);
+    cmml_set_read_callbacks (doc, read_head, NULL, NULL);
     if (secs > 0) {
       cmml_skip_to_secs (doc, secs);
-    } else { /* if (utc != NULL) { */
-      cmml_skip_to_utc (doc, utc);
     }
   }
 
   /* register callbacks */
-  cmml_set_read_callbacks (doc, read_stream, read_head, read_clip, NULL);
+  cmml_set_read_callbacks (doc, read_head, read_clip, NULL);
 
   /* read document frame-wise and check against CMML.dtd */
   while ((n = cmml_read (doc, BUFSIZE)) > 0) {



More information about the commits mailing list