Skip to content

Commit

Permalink
Port the DAISY 2.02 validator from Pipeline 1
Browse files Browse the repository at this point in the history
Validations made in the DAISY 2.02 Validator Pipeline 2 script:

 * check that all references in and across documents are valid
 * check that only these kinds of files are present:
   application/xhtml+xml, text/html, application/smil+xml, audio/mpeg,
   audio/wav, image/jpeg, image/gif, image/png or text/css
 * check that SMIL-files conform to d202smil.rng (or d202msmil.rng for
   master.smil)
 * check that the NCC conforms to d202ncc.rng
 * check that the heading hierarchy in the NCC and content files are
   correct (no levels are skipped)
 * NOT IMPLEMENTED: inform whether MP3 files has ID3v2, and warn if
   the file is mono (single channel) or uses variable bit rate (VBR)
 * NOT IMPLEMENTED: compare audio duration with info from SMIL files
   and NCC totalTime (this was not implemented in DP1 either it seems?)
 * inform if SMIL audio clips are missing clip-begin or clip-end
   attributes
 * check that the SMIL metadata "ncc:totalElapsedTime" and
   "ncc:timeInThisSmil" values add up correctly, with a
   `timeToleranceMs` margin for error
 * check that the SMIL time values add up correctly to the NCC metadata
  "ncc:totalTime", with a `timeToleranceMs` margin for error
  • Loading branch information
josteinaj authored and rdeltour committed Nov 25, 2014
1 parent 40e9d17 commit 2b04ed2
Show file tree
Hide file tree
Showing 27 changed files with 5,189 additions and 0 deletions.
1 change: 1 addition & 0 deletions catalog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<nextCatalog catalog="./daisy202-to-epub3/src/main/resources/META-INF/catalog.xml"/>
<nextCatalog catalog="./daisy202-validator/src/main/resources/META-INF/catalog.xml"/>
<nextCatalog catalog="./daisy3-to-epub3/src/main/resources/META-INF/catalog.xml"/>
<nextCatalog catalog="./dtbook-to-epub3/src/main/resources/META-INF/catalog.xml"/>
<nextCatalog catalog="./dtbook-to-html/src/main/resources/META-INF/catalog.xml"/>
Expand Down
20 changes: 20 additions & 0 deletions daisy202-validator/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.daisy.pipeline.modules</groupId>
<artifactId>modules-parent</artifactId>
<version>1.2</version>
<relativePath/>
</parent>

<artifactId>daisy202-validator</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>bundle</packaging>

<name>DAISY Pipeline 2 module :: DAISY 2.02 Validator</name>

</project>
22 changes: 22 additions & 0 deletions daisy202-validator/src/main/resources/META-INF/catalog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" xmlns:px="http://www.daisy.org/ns/pipeline">

<uri name="http://www.daisy.org/pipeline/modules/daisy202-validator/daisy202-validator.xpl" uri="../xml/xproc/daisy202-validator.xpl" px:script="true"/>
<uri name="http://www.daisy.org/pipeline/modules/daisy202-validator/library.xpl" uri="../xml/xproc/library.xpl"/>

<public publicId="-//DAISY//DTD content v2.02//EN" uri="../xml/schemas/d202/xhtml1-transitional-bodyref.dtd" />
<public publicId="-//DAISY//DTD ncc v2.02//EN" uri="../xml/schemas/d202/d202ncc.dtd" />
<public publicId="-//DAISY//RNG ncc v2.02//EN" uri="../xml/schemas/d202/d202ncc.rng" />
<public publicId="-//DAISY//DTD nccmulti v2.02//EN" uri="../xml/schemas/d202/d202nccmulti.dtd" />
<public publicId="-//DAISY//DTD smil v2.02//EN" uri="../xml/schemas/d202/d202smil.dtd" />
<public publicId="-//DAISY//RNG smil v2.02//EN" uri="../xml/schemas/d202/d202smil.rng" />
<public publicId="-//DAISY//DTD msmil v2.02//EN" uri="../xml/schemas/d202/d202msmil.dtd" />
<public publicId="-//DAISY//RNG msmil v2.02//EN" uri="../xml/schemas/d202/d202msmil.rng" />
<public publicId="-//DAISY//DTD discinfo v2.02//EN" uri="../xml/schemas/d202/d202discinfo.dtd" />

<nextCatalog catalog="org:daisy:pipeline:modules:daisy202-utils"/>
<nextCatalog catalog="org:daisy:pipeline:modules:common-utils"/>
<nextCatalog catalog="org:daisy:pipeline:modules:fileset-utils"/>
<nextCatalog catalog="org:daisy:pipeline:modules:validation-utils"/>

</catalog>
70 changes: 70 additions & 0 deletions daisy202-validator/src/main/resources/xml/i18n.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<i18n>
<!-- messages imported from Pipeline 1 (so most of them will probably not be used in the ported version of the script) -->
<translation string="Schema $1 could not be instantiated.">
<text xml:lang="en">Schema $1 could not be instantiated.</text>
</translation>
<translation string="Delegate $1 could not be instantiated.">
<text xml:lang="en">Delegate $1 could not be instantiated.</text>
</translation>
<translation string="An error occurred while validating the fileset: $1.">
<text xml:lang="en">An error occurred while validating the fileset: $1.</text>
</translation>
<translation string="An error occurred while validating using schema: $1.">
<text xml:lang="en">An error occurred while validating using schema: $1.</text>
</translation>
<translation string="Schema type $1 is not supported.">
<text xml:lang="en">Schema type $1 is not supported.</text>
</translation>
<translation string="An error occurred while validating using against inline DTD: $1.">
<text xml:lang="en">An error occurred while validating using against inline DTD: $1.</text>
</translation>
<translation string="$1 issues were reported.">
<text xml:lang="en">$1 issues were reported.</text>
</translation>
<translation string="No errors or warnings reported. Congratulations!">
<text xml:lang="en">No errors or warnings reported. Congratulations!</text>
</translation>
<translation string="Cant recognize $1 as the manifest of a fileset.">
<text xml:lang="en">Cant recognize $1 as the manifest of a fileset.</text>
</translation>
<translation string="Exceptions occurred during validation process. Transformer aborting.">
<text xml:lang="en">Exceptions occurred during validation process. Transformer aborting.</text>
</translation>
<translation string="No validation resources could be applied to input. Transformer aborting.">
<text xml:lang="en">No validation resources could be applied to input. Transformer aborting.</text>
</translation>
<translation string="Schema identifier $1 could not be associated with a local resource: will attempt to fetch schema online">
<text xml:lang="en">Schema identifier $1 could not be associated with a local resource: will attempt to fetch schema online</text>
</translation>
<translation string="The input fileset is not of the required type $1.">
<text xml:lang="en">The input fileset is not of the required type $1.</text>
</translation>
<translation string="Set error severity threshold breached. Transformer aborting.">
<text xml:lang="en">Set error severity threshold breached. Transformer aborting.</text>
</translation>
<translation string="Validating using the $1 $2.">
<text xml:lang="en">Validating using the $1 $2.</text>
</translation>
<translation string="Validating a $1.">
<text xml:lang="en">Validating a $1.</text>
</translation>
<translation string="Proceeding with inline DTD validation.">
<text xml:lang="en">Proceeding with inline DTD validation.</text>
</translation>
<translation string="Proceeding with (inline and/or external) schema validation with $1 schemas.">
<text xml:lang="en">Proceeding with (inline and/or external) schema validation with $1 schemas.</text>
</translation>
<translation string="Completed fileset instantiation (DTD, URI validation).">
<text xml:lang="en">Completed fileset instantiation (DTD, URI validation).</text>
</translation>
<translation string="Completed full validation of input fileset.">
<text xml:lang="en">Completed full validation of input fileset.</text>
</translation>
<translation string="Completed validation using inline DTDs.">
<text xml:lang="en">Completed validation using inline DTDs.</text>
</translation>
<translation string="Completed validation using inline and/or inparameter Schemas.">
<text xml:lang="en">Completed validation using inline and/or inparameter Schemas.</text>
</translation>
</i18n>
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!-- d202discinfo.dtd m gylling version 2002-12-22 -->

<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1 for XHTML//EN"
"xhtml-lat1.ent">
%HTMLlat1;

<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;

<!ENTITY % HTMLspecial PUBLIC
"-//W3C//ENTITIES Special for XHTML//EN"
"xhtml-special.ent">
%HTMLspecial;

<!ENTITY % LanguageCode "NMTOKEN"> <!-- [RFC1766] -->

<!ENTITY % URI "CDATA"> <!-- [RFC2396] -->

<!ELEMENT html (head, body)>

<!ATTLIST html
xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
>

<!-- ============ h e a d ============ -->

<!ENTITY % head.misc "(style|meta|link)*">

<!ELEMENT head (%head.misc;,((title), %head.misc;))?>

<!ELEMENT title (#PCDATA)>

<!ELEMENT meta EMPTY>

<!ATTLIST meta
http-equiv CDATA #IMPLIED
name CDATA #IMPLIED
content CDATA #REQUIRED
scheme CDATA #IMPLIED
>

<!ELEMENT link EMPTY>

<!ATTLIST link
rel CDATA #REQUIRED
type CDATA #REQUIRED
href %URI; #REQUIRED
>

<!-- ============ b o d y ============ -->

<!ELEMENT body (a+)>

<!ELEMENT a (#PCDATA)>

<!ATTLIST a
id ID #IMPLIED
href %URI; #REQUIRED
>
Loading

0 comments on commit 2b04ed2

Please sign in to comment.