[ttml2] add schema suppport for isd vocabulary
authorGlenn Adams <glenn@skynav.com>
Wed, 14 Jan 2015 19:16:11 -0700
changeset 837 b47a32faeaa7
parent 836 0e851a15a12b
child 838 a7f98e694433
[ttml2] add schema suppport for isd vocabulary
ttml2/spec/build.xml
ttml2/spec/rnc/ttml2-core-attribs.rnc
ttml2/spec/rnc/ttml2-datatypes.rnc
ttml2/spec/rnc/ttml2-metadata.rnc
ttml2/spec/rnc/ttml2-parameter-attribs.rnc
ttml2/spec/rnc/ttml2.rnc
ttml2/spec/ttml2.xml
ttml2/spec/xsd/ttml2-datatypes.xsd
ttml2/spec/xsd/ttml2-parameter-attribs.xsd
--- a/ttml2/spec/build.xml	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/build.xml	Wed Jan 14 19:16:11 2015 -0700
@@ -18,6 +18,7 @@
     <property name="rnc.schema" value="${rnc.dir}/ttml2.rnc"/>
     <property name="xsd.dir" value="${basedir}/xsd"/>
     <property name="xsd.schema" value="${xsd.dir}/ttml2.xsd"/>
+    <property name="xsd.isd.schema" value="${xsd.dir}/ttml2-isd.xsd"/>
     <property name="profiles.dir" value="${basedir}/profiles"/>
     <property name="examples.dir" value="${basedir}/examples"/>
 
@@ -64,6 +65,7 @@
           <arg value="-b"/>
           <arg value="ttml2-bindings.xjb"/>
           <arg value="ttml2.xsd"/>
+          <arg value="ttml2-isd.xsd"/>
         </exec>
     </target>
 
@@ -125,7 +127,7 @@
         <schemavalidate fullchecking="true" warn="true">
           <schema namespace="http://www.w3.org/ns/ttml" file="${xsd.schema}"/>
           <fileset dir="${examples.dir}">
-            <include name="ex3.xml"/>
+            <include name="ex1.xml"/>
           </fileset>
         </schemavalidate>
     </target>
@@ -152,8 +154,26 @@
         </schemavalidate>
     </target>
 
+    <target name="validate-example-4" description="Validates Example 4.">
+        <!-- validate using RNC schema -->
+        <java fork="true" jar="${jing.jar}">
+            <arg value="-c"/>
+            <arg value="${rnc.schema}"/>
+            <arg value="${examples.dir}/ex4.xml"/>
+        </java>
+        <!-- validate using XSD schema -->
+        <schemavalidate fullchecking="true" warn="true">
+          <schema namespace="http://www.w3.org/ns/ttml#isd" file="${xsd.isd.schema}"/>
+          <schema namespace="http://www.w3.org/ns/ttml#parameter" file="${xsd.dir}/ttml2-parameter-items.xsd"/>
+          <schema namespace="http://www.w3.org/ns/ttml" file="${xsd.dir}/ttml2-content.xsd"/>
+          <fileset dir="${examples.dir}">
+            <include name="ex4.xml"/>
+          </fileset>
+        </schemavalidate>
+    </target>
+
     <target name="validate-examples"
-	    depends="validate-example-1, validate-example-3"/>
+	    depends="validate-example-1, validate-example-3, validate-example-4"/>
 
     <target name="validate-xsl" description="Validates all XML files.">
         <xmlvalidate lenient="true">
--- a/ttml2/spec/rnc/ttml2-core-attribs.rnc	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-core-attribs.rnc	Wed Jan 14 19:16:11 2015 -0700
@@ -10,6 +10,9 @@
 TTAF.id.attrib
   = attribute xml:id { xsd:ID }?
 
+TTAF.id.required.attrib
+  = attribute xml:id { xsd:ID }
+
 TTAF.lang.attrib
   = attribute xml:lang { TTAF.LanguageCode.datatype }?
 
--- a/ttml2/spec/rnc/ttml2-datatypes.rnc	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-datatypes.rnc	Wed Jan 14 19:16:11 2015 -0700
@@ -307,6 +307,9 @@
   "always" |
   "whenActive"
 
+TTAF.StorageAspectRatio.datatype =
+  xsd:string { pattern = "\p{Nd}+\s+\p{Nd}+" }
+
 TTAF.SubFrameRate.datatype =
   xsd:positiveInteger
 
--- a/ttml2/spec/rnc/ttml2-metadata.rnc	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-metadata.rnc	Wed Jan 14 19:16:11 2015 -0700
@@ -19,7 +19,7 @@
 
 TTAF.External.class =
   element * - ( tt:* | ttm:* ) {
-    ( attribute * - ( xml:id ) { text }
+    ( attribute * - ( xml:id | local:* ) { text }
       | TTAF.External.class
     )*
   }
--- a/ttml2/spec/rnc/ttml2-parameter-attribs.rnc	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/rnc/ttml2-parameter-attribs.rnc	Wed Jan 14 19:16:11 2015 -0700
@@ -42,6 +42,8 @@
   = attribute ttp:processorProfileCombination { TTAF.ProfileCombination.datatype }?
 TTAF.profile.attrib
   = attribute ttp:profile { TTAF.Profile.datatype }?
+TTAF.storageAspectRatio.attrib
+  = attribute ttp:storageAspectRatio { TTAF.StorageAspectRatio.datatype }?
 TTAF.subFrameRate.attrib
   = attribute ttp:subFrameRate { TTAF.SubFrameRate.datatype }?
 TTAF.tickRate.attrib
@@ -74,6 +76,7 @@
   TTAF.processorProfiles.attrib,
   TTAF.processorProfileCombination.attrib,
   TTAF.profile.attrib,
+  TTAF.storageAspectRatio.attrib,
   TTAF.subFrameRate.attrib,
   TTAF.tickRate.attrib,
   TTAF.timeBase.attrib,
--- a/ttml2/spec/rnc/ttml2.rnc	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/rnc/ttml2.rnc	Wed Jan 14 19:16:11 2015 -0700
@@ -24,8 +24,9 @@
 include "ttml2-content.rnc"
 include "ttml2-head.rnc"
 include "ttml2-document.rnc"
+include "ttml2-isd.rnc"
 
-start = TTAF.tt | TTAF.parameters.profile
+start = TTAF.tt | TTAF.parameters.profile | TTAF.isd.sequence
 
 # .......................................................................
 # .......................................................................
--- a/ttml2/spec/ttml2.xml	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/ttml2.xml	Wed Jan 14 19:16:11 2015 -0700
@@ -19678,8 +19678,7 @@
 <head>isd:sequence</head>
 <p>The <el>isd:sequence</el> element serves as the root document element of an <loc href="#terms-intermediate-synchronic-document-sequence">Intermediate
 Synchronic Document Sequence</loc>  document.</p>
-<p>The <el>isd:sequence</el> element accepts as its children zero or more elements in the
-<loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group,
+<p>The <el>isd:sequence</el> element accepts as its children zero or more <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc> elements,
 followed by zero or one <loc href="#profile-vocabulary-profile"><el>ttp:profile</el></loc> element,
 followed by zero or more <loc href="#isd-vocabulary-isd"><el>isd:isd</el></loc> elements.</p>
 <p>Child <el>isd:isd</el> elements must be ordered in accordance to the media time equivalent of their
@@ -19696,7 +19695,7 @@
   <loc href="#content-attribute-xml-lang"><phrase role="reqattr">xml:lang</phrase></loc> = <loc href="http://www.w3.org/TR/xmlschema-2/#string">xsd:string</loc>
   {<emph>any attribute in the <loc href="#isd-parameter-attribute-set">ISD Parameter Attribute Set</loc></emph>}&gt;
   {<emph>any attribute not in default or any TT namespace</emph>}&gt;
-  <emph>Content:</emph> <loc href="#element-vocab-group-metadata">Metadata.class</loc>*, <loc href="#profile-vocabulary-profile">ttp:profile</loc>?, <loc href="#isd-vocabulary-isd">isd:isd</loc>*
+  <emph>Content:</emph> <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc>*, <loc href="#profile-vocabulary-profile">ttp:profile</loc>?, <loc href="#isd-vocabulary-isd">isd:isd</loc>*
 &lt;/isd:sequence&gt;
 </eg>
 </td>
@@ -19752,8 +19751,7 @@
 <p>The <el>isd:isd</el> element serves either as (1) the root document element of a standalone <loc href="#terms-intermediate-synchronic-document">Intermediate
 Synchronic Document</loc> or (2) as a child of an <loc href="#isd-vocabulary-sequence"><el>isd:sequence</el></loc> element of a
 <loc href="#terms-intermediate-synchronic-document-sequence">Intermediate Synchronic Document Sequence</loc> document.</p>
-<p>The <el>isd:isd</el> element accepts as its children zero or more elements in the
-<loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group,
+<p>The <el>isd:isd</el> element accepts as its children zero or more <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc> elements,
 followed by zero or one <loc href="#profile-vocabulary-profile"><el>ttp:profile</el></loc> element,
 followed by zero or more <loc href="#isd-vocabulary-css"><el>isd:css</el></loc> elements,
 followed by zero or more <loc href="#isd-vocabulary-region"><el>isd:region</el></loc> elements.</p>
@@ -19770,7 +19768,7 @@
   <loc href="#content-attribute-xml-lang">xml:lang</loc> = <loc href="http://www.w3.org/TR/xmlschema-2/#string">xsd:string</loc>
   {<emph>any attribute in the <loc href="#isd-parameter-attribute-set">ISD Parameter Attribute Set</loc></emph>}&gt;
   {<emph>any attribute not in default or any TT namespace</emph>}&gt;
-  <emph>Content:</emph> <loc href="#element-vocab-group-metadata">Metadata.class</loc>*, <loc href="#profile-vocabulary-profile">ttp:profile</loc>?, <loc href="#isd-vocabulary-css">isd:css</loc>*, <loc href="#isd-vocabulary-region">isd:region</loc>*
+  <emph>Content:</emph> <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc>*, <loc href="#profile-vocabulary-profile">ttp:profile</loc>?, <loc href="#isd-vocabulary-css">isd:css</loc>*, <loc href="#isd-vocabulary-region">isd:region</loc>*
 &lt;/isd:isd&gt;
 </eg>
 </td>
@@ -19818,8 +19816,7 @@
 set of <emph>E</emph>, <emph>CSS(E)</emph>, is determined, and, if that <emph>CSS(E)</emph> is not already specified
 by an existing <el>isd:css</el> element, then it is assigned a unique identifier and instantiated as a new
 <el>isd:css</el> element.</p>
-<p>The <el>isd:css</el> element accepts as its children zero or more elements in the
-<loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group.</p>
+<p>The <el>isd:css</el> element accepts as its children zero or more <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc> elements.</p>
 <table id="elt-syntax-isd-style" role="syntax">
 <caption>XML Representation &ndash; Element Information Item: isd:css</caption>
 <tbody>
@@ -19830,7 +19827,7 @@
   <loc href="#content-attribute-xml-id"><phrase role="reqattr">xml:id</phrase></loc> = ID
   {<emph>any attribute in TT Style namespace</emph>}
   {<emph>any attribute not in default or any TT namespace</emph>}&gt;
-  <emph>Content:</emph> <loc href="#element-vocab-group-metadata">Metadata.class</loc>*
+  <emph>Content:</emph> <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc>*
 &lt;/isd:css&gt;
 </eg>
 </td>
@@ -19851,8 +19848,7 @@
 <p>The <el>isd:region</el> element is used to represent a layout and presentation region
 and the content selected into that region, where that content takes the form of a
 <loc href="#document-structure-vocabulary-body">body</loc> element and its descendant TTML content elements.</p>
-<p>The <el>isd:region</el> element accepts as its children zero or more elements in the
-<loc href="#element-vocab-group-metadata"><code>Metadata.class</code></loc> element group,
+<p>The <el>isd:region</el> element accepts as its children zero or more <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc> elements,
 followed by zero or more <loc href="#animation-vocabulary-animate"><el>animate</el></loc> elements,
 followed by exactly one <loc href="#document-structure-vocabulary-body"><el>body</el></loc> element.</p>
 <table id="elt-syntax-isd-region" role="syntax">
@@ -19866,7 +19862,7 @@
   <loc href="#metadata-attribute-role">ttm:role</loc> = <loc href="http://www.w3.org/TR/xmlschema-2/#string">xsd:string</loc>
   <loc href="#content-attribute-xml-id"><phrase role="reqattr">xml:id</phrase></loc> = ID
   {<emph>any attribute not in default or any TT namespace</emph>}&gt;
-  <emph>Content:</emph> <loc href="#element-vocab-group-metadata">Metadata.class</loc>*, <loc href="#animation-vocabulary-animate">animate</loc>*, <loc href="#document-structure-vocabulary-body">body</loc>
+  <emph>Content:</emph> <loc href="#metadata-vocabulary-metadata"><el>ttm:metadata</el></loc>*, <loc href="#animation-vocabulary-animate">animate</loc>*, <loc href="#document-structure-vocabulary-body">body</loc>
 &lt;/isd:region&gt;
 </eg>
 </td>
@@ -19910,6 +19906,7 @@
 <item><p><loc href="#parameter-attribute-frameRateMultiplier">ttp:frameRateMultipler</loc></p></item>
 <item><p><loc href="#parameter-attribute-mediaOffset">ttp:mediaOffset</loc></p></item>
 <item><p><loc href="#parameter-attribute-pixelAspectRatio">ttp:pixelAspectRatio</loc></p></item>
+<item><p><loc href="#parameter-attribute-storageAspectRatio">ttp:storageAspectRatio</loc></p></item>
 <item><p><loc href="#parameter-attribute-subFrameRate">ttp:subFrameRate</loc></p></item>
 <item><p><loc href="#parameter-attribute-tickRate">ttp:tickRate</loc></p></item>
 </ulist>
--- a/ttml2/spec/xsd/ttml2-datatypes.xsd	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/xsd/ttml2-datatypes.xsd	Wed Jan 14 19:16:11 2015 -0700
@@ -536,6 +536,14 @@
       <xs:enumeration value="whenActive"/>
     </xs:restriction>
   </xs:simpleType>
+  <xs:simpleType name="storageAspectRatio">
+    <xs:annotation>
+      <xs:documentation>positiveInteger:positiveInteger</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="\p{Nd}+\s+\p{Nd}+"/>
+    </xs:restriction>
+  </xs:simpleType>
   <xs:simpleType name="subFrameRate">
     <xs:restriction base="xs:positiveInteger"/>
   </xs:simpleType>
--- a/ttml2/spec/xsd/ttml2-parameter-attribs.xsd	Wed Jan 14 11:50:55 2015 -0700
+++ b/ttml2/spec/xsd/ttml2-parameter-attribs.xsd	Wed Jan 14 19:16:11 2015 -0700
@@ -17,12 +17,13 @@
   <xs:attribute name="markerMode" type="ttd:markerMode"/>
   <xs:attribute name="mediaDuration" type="ttd:mediaDuration"/>
   <xs:attribute name="mediaOffset" type="ttd:mediaOffset"/>
+  <xs:attribute name="pixelAspectRatio" type="ttd:pixelAspectRatio"/>
   <xs:attribute name="processorProfiles" type="ttd:profiles"/>
   <xs:attribute name="processorProfileCombination" type="ttd:profileCombination"/>
   <xs:attribute name="permitFeatureNarrowing" type="ttd:permitFeatureNarrowingOrWidening"/>
   <xs:attribute name="permitFeatureWidening" type="ttd:permitFeatureNarrowingOrWidening"/>
   <xs:attribute name="profile" type="ttd:profile"/>
-  <xs:attribute name="pixelAspectRatio" type="ttd:pixelAspectRatio"/>
+  <xs:attribute name="storageAspectRatio" type="ttd:storageAspectRatio"/>
   <xs:attribute name="subFrameRate" type="ttd:subFrameRate"/>
   <xs:attribute name="tickRate" type="ttd:tickRate"/>
   <xs:attribute name="timeBase" type="ttd:timeBase"/>
@@ -44,10 +45,11 @@
     <xs:attribute ref="ttp:mediaOffset"/>
     <xs:attribute ref="ttp:permitFeatureNarrowing"/>
     <xs:attribute ref="ttp:permitFeatureWidening"/>
+    <xs:attribute ref="ttp:pixelAspectRatio"/>
     <xs:attribute ref="ttp:processorProfiles"/>
     <xs:attribute ref="ttp:processorProfileCombination"/>
     <xs:attribute ref="ttp:profile"/>
-    <xs:attribute ref="ttp:pixelAspectRatio"/>
+    <xs:attribute ref="ttp:storageAspectRatio"/>
     <xs:attribute ref="ttp:subFrameRate"/>
     <xs:attribute ref="ttp:tickRate"/>
     <xs:attribute ref="ttp:timeBase"/>