Appendix A - Subcheck artifacts with TTML examples

Example of TTML specification listing in the constraints.xml:

<Specifications>
  <Specification ID="spec-imsc1.1">
         <Name>
            TTML Profiles for Internet Media 
            Subtitles and Captions 1.1
          </Name>
         <Acronym>IMSC1.1 Common</Acronym>
         <Version>2018-11-08</Version>
  </Specification>
  <Specification ID="spec-ttml2">
         <Name>
            Timed Text Markup Language 2 
            (TTML2) CR
         </Name>
         <Acronym>TTML2</Acronym>
         <Version>2018-11-08</Version>
  </Specification>
</Specifications>

Example of a documented IMSC rule:

<Constraint ID="d1e1321">
    <ShortName>
        Extent attribute presence on region 
        element
   </ShortName>
    <SpecifiedBy>
        <SpecificationReference>
            spec-imsc1-text
        </SpecificationReference>
        <SpecText>
         [The feature] #extent-region [is] 
         permitted...
        </SpecText>
        <Error_Level>ERROR</Error_Level>
        <Chapter>7.4</Chapter>
        <URI>
          https://www.w3.org/TR/ttml-imsc1/#features-and-extensions-1
        </URI>
    </SpecifiedBy>
    <SpecifiedBy>
        <SpecificationReference>
            spec-imsc1.0.1-text
        </SpecificationReference>
        <SpecText>...</SpecText>
        <Error_Level>ERROR</Error_Level>
        <Chapter>7.4</Chapter>
        <URI>
            https://www.w3.org/TR/ttml-imsc1.0.1/#features-and-extensions-1
        </URI>
    </SpecifiedBy>
    <SpecifiedBy>
        <SpecificationReference>
            spec-imsc1.1-text
        </SpecificationReference>
        <SpecText>...</SpecText>
        <Error_Level>ERROR</Error_Level>
        <Chapter>8.4.2</Chapter>
        <URI>
           https://www.w3.org/TR/ttml-imsc1.1/#extent-region
        </URI>
    </SpecifiedBy>
    <ShortDescription>
        tts:extent on all regions
    </ShortDescription>
    <ShortDescriptionUser>
        The extent attribute shall be present on all region
        elements.
    </ShortDescriptionUser>
</Constraint>

Example of rule implementation in Schematron:

<sch:pattern id="attributeRequirement">
    <sch:rule 
     context="/tt:tt/tt:head/tt:layout/tt:region">
      <sch:assert 
       diagnostics="elementId"
       see="http://www.irt.de/subcheck/constraints/d1e1321"
       id="assert-d1e1321-1">
        The attribute tts:extent is present.
      </sch:assert>
    </sch:rule>
</sch:pattern>

Example of an IMSC document with an error:

<tt xmlns="http://www.w3.org/ns/ttml" 
    ttp:profile="http://www.w3.org/ns/ttml/profile/imsc1/text"
    xmlns:ttp="http://www.w3.org/ns/ttml#parameter"
    xmlns:tts="http://www.w3.org/ns/ttml#styling" 
    xml:lang="en">
    <head>
        <layout>
            <region tts:origin="10% 80%"
             xml:id="bottom"/>
        </layout>
    </head>
    <body>
        <div>
            <p region="bottom" begin="0s" end="1s">
                Hello, I am Mork from Ork.
            </p>
        </div>
    </body>
</tt>

Example of the SVRL Output:

<svrl:failed-assert
   test="attribute::tts:extent" 
   see="http://www.irt.de/subcheck/constraints/d1e1321"
   location="/*:tt[namespace-uri()='http://www.w3.org/ns/ttml'][1]/..."
   subcheck:alternativeLocation="/tt/head/layout/region">
    <svrl:text>
        The attribute tts:extent is present.
    </svrl:text>
    <svrl:diagnostic-reference 
     diagnostic="elementId">
       The affected 'region' element has the ID 'bottom'.
    </svrl:diagnostic-reference>
</svrl:failed-assert>

Example of the report view output:

<errorCategory>
    <constraintID>d1e1321</constraintID>
    <title>
        Extent attribute presence on region element
    </title>
    <shortUserDesc>
        The extent attribute shall be present on all 
        region elements.
    </shortUserDesc>
    <specs>
        <spec>
            <name>
                TTML Profiles for Internet Media 
                Subtitles and Captions 1.0 (IMSC1)- 
                Text Profile, Version 2016-04-21
            </name>
            <nameAcronym>IMSC1-Text</nameAcronym>
            <text>
                [The feature] #extent-region [is] 
                permitted ...
            </text>
            <errorLevel>ERROR</errorLevel>
            <section>Chapter 7.4</section>
            <uri>
                https://www.w3.org/TR/ttml-imsc1...
            </uri>
        </spec>
        <spec>
            <name>
                TTML Profiles for Internet Media 
                Subtitles and Captions 1.0.1 (IMSC1)
                - Text Profile, Version 2017-07-13
            </name>
            <nameAcronym>IMSC1.0.1-Text</nameAcronym>
            <text>
                [The feature] #extent-region [is] 
                permitted...
            </text>
            <errorLevel>ERROR</errorLevel>
            <section>Chapter 7.4</section>
            <uri>
               https://www.w3.org/TR/ttml-imsc1.0.1/...
            </uri>
        </spec>
        <spec>
            <name>
                TTML Profiles for Internet Media 
                Subtitles and Captions 1.1 - 
                Text Profile,Version 2017-10-17
            </name>
            <nameAcronym>IMSC1.1-Text (Beta)</nameAcronym>
            <text>
                The tts:extent attribute SHALL be present 
                on all region elements, where it SHALL use 
                px units, percentage values, or root 
                container relative units.
            </text>
            <errorLevel>ERROR</errorLevel>
            <section>Chapter 8.4.2</section>
            <uri>
                https://www.w3.org/TR/ttml-imsc1.1/...
            </uri>
        </spec>
    </specs>
    <errors>
        <error>
            <messages>
                <messageMain>
                   Assertion: The attribute tts:extent is 
                   present.
                   Error Information:
                   The affected 'region' element has the ID 
                  'bottom'.
               </messageMain>
                <messageAssertion>
                   The attribute tts:extent is present.
                </messageAssertion>
                <messageDiagnosticsAll>
                    The affected 'region' element has the ID
                    'bottom'.
                </messageDiagnosticsAll>
            </messages>
            <locations>
                <location 
                  locationType="resolvableXPATH">
                    /*:tt[namespace-uri()='http://www.w3.org/...
                </location>
                <location
                 locationType="humanXPATH">
                    /tt/head/layout/region
                </location>
            </locations>
        </error>
    </errors>
</errorCategory>