
doc.transformers.int_daisy_opsCreator.html Maven / Gradle / Ivy
int_daisy_opsCreator
Transformer documentation: int_daisy_opsCreator
Transformer Purpose
Create an OPS 2.0 publication from DTBook and/or XHTML input.
Note - this implementation does not support the XML islands feature of OPS 2.0
Input Requirements
One or several (logically ordered) documents to add to the OPS publication.
The selected DTBOOK and XHTML docs will be instantiated as Filesets, so auxilliary files need not be included as inparams.
Output
On success
An OPS 2.0 publication containing an NCX. The NCX contents id defined by the NCX Configuration file.
On error
No specific recovery scheme. On error, this transformer will send a fatal message, then throw an exception and abort.
Configuration/Customization
Parameters (tdf)
- input
- File.pathSeparator separated list of path specs
- output
- Pathspec of output OCF
- ncxConfig
- Custom NCX configuration file (else will use embedded default
- forceXhtml
- Whether to always create an XHTML-based EPUB, even if the input is DTBook 2005-2
- dc:title
- Dublin Core Title. If a value is set, it will override any corresponding value given in input document(s).
- dc:creator
- Dublin Core Creator If a value is set, it will override any corresponding value given in input document(s).
- dc:publisher
- Dublin Core Publisher If a value is set, it will override any corresponding value given in input document(s).
- dc:date
- Dublin Core Date (date of publication) If a value is set, it will override any corresponding value given in input document(s).
- dc:identifier
- Dublin Core Identifier If a value is set, it will override any corresponding value given in input document(s).
- dc:language
- Dublin Core Language If a value is set, it will override any corresponding value given in input document(s).
Extended configurability: NCX configuration
An external XML document guides the behavior of the NCX creation process. This is to
allow producers to define which elements should get referenced in the NCX and
in which way.
See Example of NCX Configuration File
See NCX Configuration RelaxNG Schema
Further development
Support for XML islands
Dependencies
Author
Markus Gylling
Licensing
LGPL
Example of NCX Configuration File
This is example is the default NCX confguration file, which is used if
the user does not specify an explicit alternative.
<?xml version="1.0" encoding="utf-8" ?>
<ncx:ncx-include xmlns:ncx="http://www.daisy.org/pipeline/ncxconfig#">
<!-- Default configuration for OPS NCX. Schema: see ncx-config.rng -->
<ncx:navMap>
<!-- Qualified names of elements to include in navMap, the definitions may include attributes -->
<!-- xhtml -->
<h1 xmlns="http://www.w3.org/1999/xhtml" />
<h2 xmlns="http://www.w3.org/1999/xhtml" />
<h3 xmlns="http://www.w3.org/1999/xhtml" />
<h4 xmlns="http://www.w3.org/1999/xhtml" />
<h5 xmlns="http://www.w3.org/1999/xhtml" />
<h6 xmlns="http://www.w3.org/1999/xhtml" />
<!-- dtbook -->
<h1 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<h2 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<h3 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<h4 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<h5 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<h6 xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
</ncx:navMap>
<ncx:navLists>
<!-- Qualified names of elements to include in navLists, the definitions may include attributes -->
<pagenum xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<noteref xmlns="http://www.daisy.org/z3986/2005/dtbook/" />
<!--
Optionally use an xpath statement to define an explicit label
<note xmlns="http://www.daisy.org/z3986/2005/dtbook/" ncx:label="/*[1]|/text()" />
-->
</ncx:navLists>
<ncx:navListLabels>
<!-- define labels for lists in varying languages -->
<pagenum xmlns="http://www.daisy.org/z3986/2005/dtbook/">
<ncx:label xml:lang="en" ncx:text="Pages" />
<ncx:label xml:lang="sv" ncx:text="Sidor" />
</pagenum>
<noteref xmlns="http://www.daisy.org/z3986/2005/dtbook/">
<ncx:label xml:lang="en" ncx:text="Note References"/>
<ncx:label xml:lang="sv" ncx:text="Notreferenser"/>
</noteref>
</ncx:navListLabels>
</ncx:ncx-include>
NCX Configuration RelaxNG Schema
File: transformers/int_daisy_opsCreator/ncx-config.rng
<grammar
xmlns="http://relaxng.org/ns/structure/1.0"
ns="http://www.daisy.org/pipeline/ncxconfig#"
xmlns:ncx="http://www.daisy.org/pipeline/ncxconfig#"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<ref name="root"/>
</start>
<define name="root">
<element name="ncx-include">
<element name="navMap">
<oneOrMore>
<ref name="templateElement.empty" />
</oneOrMore>
</element>
<element name="navLists">
<zeroOrMore>
<ref name="templateElement.empty" />
</zeroOrMore>
</element>
<optional>
<element name="navListLabels">
<zeroOrMore>
<ref name="templateElement.label" />
</zeroOrMore>
</element>
</optional>
</element>
</define>
<define name="templateElement.empty">
<element>
<anyName>
<except>
<nsName ns="http://www.daisy.org/pipeline/ncxconfig#" />
</except>
</anyName>
<interleave>
<optional>
<ref name="label.attribute"/>
</optional>
<zeroOrMore>
<attribute>
<nsName/>
</attribute>
</zeroOrMore>
</interleave>
<empty/>
</element>
</define>
<define name="templateElement.label">
<element>
<anyName>
<except>
<nsName ns="http://www.daisy.org/pipeline/ncxconfig#" />
</except>
</anyName>
<zeroOrMore>
<attribute>
<nsName/>
</attribute>
</zeroOrMore>
<oneOrMore>
<ref name="label.element"/>
</oneOrMore>
</element>
</define>
<define name="label.attribute">
<attribute name="label">
<!-- an xpath statement -->
<data type="normalizedString"/>
</attribute>
</define>
<define name="label.element">
<element name="label">
<attribute name="xml:lang"/>
<attribute name="ncx:text"/>
</element>
</define>
</grammar>