Skip to content

Commit

Permalink
Added SMIL schematron check to report when @clipBegin==@clipEnd // refs
Browse files Browse the repository at this point in the history
  • Loading branch information
tofi86 authored and rdeltour committed Jun 12, 2017
1 parent 5e6a69a commit 0071676
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
@@ -1,9 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron">

<ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
<ns uri="http://www.w3.org/ns/SMIL" prefix="s"/>

<include href="./mod/id-unique.sch"/>

</schema>

<ns uri="http://www.idpf.org/2007/ops" prefix="epub"/>
<ns uri="http://www.w3.org/ns/SMIL" prefix="s"/>

<include href="./mod/id-unique.sch"/>

<pattern id="clip-attribute-checks">
<rule context="s:audio[@clipBegin and @clipEnd]">
<!-- #568 check @clipBegin==@clipEnd -->
<assert test="@clipBegin != @clipEnd">Attributes 'clipBegin' and 'clipEnd' must not be equal!</assert>
</rule>
</pattern>

</schema>
Expand Up @@ -165,4 +165,11 @@ public void testValidateDocumentValidOverlay007()
{
testValidateDocument("valid/overlay-007.smil");
}

@Test
public void testValidateDocumentInvalidOverlay008_Issue568()
{
Collections.addAll(expectedErrors, MessageId.RSC_005);
testValidateDocument("invalid/overlay-008.smil");
}
}
13 changes: 13 additions & 0 deletions src/test/resources/30/single/overlays/invalid/overlay-008.smil
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="../../../src/schema/media-overlay-30.rnc" type="compact"?>
<?oxygen SCHSchema="../../../src/schema/media-overlay-30.sch"?>
<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" xmlns:epub="http://www.idpf.org/2007/ops">
<body>
<seq id="id1" epub:textref="chapter1.xhtml#sectionstart" epub:type="chapter">
<par id="id2">
<text src="chapter1.xhtml#text1"/>
<audio src="chapter1_audio.mp3" clipBegin="0:23:34.221" clipEnd="0:23:34.221"/>
</par>
</seq>
</body>
</smil>

0 comments on commit 0071676

Please sign in to comment.