<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:px="http://www.daisy.org/ns/pipeline/xproc" xmlns:d="http://www.daisy.org/ns/pipeline/data" xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:pef="http://www.daisy.org/ns/2008/pef" type="px:zedai-to-pef.script" version="1.0" exclude-inline-prefixes="#all" name="main"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h1 px:role="name">ZedAI to braille</h1> <p px:role="desc">Transforms a ZedAI (DAISY 4 XML) document into an embosser ready braille document.</p> <a px:role="homepage" href="http://daisy.github.io/pipeline/Get-Help/User-Guide/Scripts/zedai-to-pef/"> Online documentation </a> <dl px:role="author"> <dt>Name:</dt> <dd px:role="name">Bert Frees</dd> <dt>Organization:</dt> <dd px:role="organization" href="http://www.sbs-online.ch/">SBS</dd> <dt>E-mail:</dt> <dd><a px:role="contact" href="mailto:bertfrees@gmail.com">bertfrees@gmail.com</a></dd> </dl> </p:documentation> <p:input port="source" primary="true" px:name="source" px:media-type="application/z3998-auth+xml"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Input ZedAI</h2> <p px:role="desc">The ZedAI you want to convert to braille.</p> </p:documentation> </p:input> <p:option name="stylesheet" px:sequence="true" required="false" select="''" px:media-type="text/css application/xslt+xml"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Style sheets</h2> <p px:role="desc" xml:space="preserve">A list of CSS/Sass style sheets to apply. DEPRECATION WARNING: XSLT style sheets are also supported, but this feature might be removed in the future. It is recommended to apply any XSLT style sheets during pre-processing of the document. Must be a space separated list of URIs, absolute or relative to the input. Style sheets specified through this option are called "[user style sheets](https://www.w3.org/TR/CSS2/cascade.html#cascade)". Style sheets can also be attached to the source document. These are referred to as "[author style sheets](https://www.w3.org/TR/CSS2/cascade.html#cascade)". They can be linked (using an ['xml-stylesheet' processing instruction](https://www.w3.org/TR/xml-stylesheet) or a ['link' element](https://www.w3.org/Style/styling-XML#External)), embedded (using a ['style' element](https://www.w3.org/Style/styling-XML#Embedded)) and/or inlined (using '[style' attributes](https://www.w3.org/TR/css-style-attr/)). Style sheets are applied to the document in the following way: XSLT style sheets are applied before CSS/Sass style sheets. XSLT style sheets are applied one by one, first the user style sheets, then the author style sheets, in the order in which they are specified. All CSS/Sass style sheets are applied at once, but the order in which they are specified (first user style sheets, then author style sheets) has an influence on the [cascading order](https://www.w3.org/TR/CSS2/cascade.html#cascading-order). CSS/Sass style sheets are interpreted according to [braille CSS](http://braillespecs.github.io/braille-css) rules. For info on how to use Sass (Syntactically Awesome StyleSheets) see the [Sass manual](http://sass-lang.com/documentation/file.SASS_REFERENCE.html).</p> </p:documentation> <p:pipeinfo> <px:type> <choice> <data type="anyFileURI" datatypeLibrary="http://www.daisy.org/ns/pipeline/xproc"> <documentation xml:lang="en">File path relative to input ZedAI.</documentation> </data> <data type="anyURI"> <documentation xml:lang="en">Any other absolute URI</documentation> </data> </choice> </px:type> </p:pipeinfo> </p:option> <p:option name="transform" required="false" px:type="transform-query" select="'(translator:liblouis)(formatter:dotify)'"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Transformer features</h2> <p px:role="desc" xml:space="preserve">Features of the braille transformer. Features of the [braille transformer](http://daisy.github.io/pipeline/Get-Help/User-Guide/Braille/) to be used for creating the paginated braille document from the CSS styled input document. Together with the "Braille code" option this determines the transformer that is selected.</p> </p:documentation></p:option> <p:option name="output-dir" required="true" px:output="result" px:type="anyDirURI" px:media-type="text"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Output file</h2> <p px:role="desc">The output braille file.</p> </p:documentation></p:option> <p:option name="output-file-format" required="false" px:type="transform-query" select="''"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Output file format</h2> <p px:role="desc" xml:space="preserve">The file format in which to store the braille result. If left blank, the braille will be stored in PEF format.</p> </p:documentation></p:option> <p:option name="include-preview" required="false" px:type="boolean" select="'false'"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Include preview</h2> <p px:role="desc" xml:space="preserve">Whether or not to include a HTML preview of the braille result.</p> </p:documentation></p:option> <p:option name="preview-table" required="false" px:type="transform-query" select="''"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">ASCII braille table for HTML preview</h2> <p px:role="desc" xml:space="preserve">The ASCII braille table used to render the HTML preview. If left blank, the locale information in the input document will be used to select a suitable table.</p> </p:documentation></p:option> <p:option name="preview-output-dir" required="false" px:output="result" px:type="anyDirURI" px:media-type="text/html" select="''"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Preview</h2> <p px:role="desc">An HTML preview of the braille result.</p> </p:documentation></p:option> <p:option name="include-pef" required="false" px:type="boolean" select="'false'"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">Include PEF</h2> <p px:role="desc" xml:space="preserve">Whether or not to keep the intermediary PEF file (for debugging).</p> </p:documentation></p:option> <p:option name="pef-output-dir" required="false" px:output="result" px:type="anyDirURI" px:media-type="application/x-pef+xml" select="''"><p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2 px:role="name">PEF</h2> <p px:role="desc">The intermediary PEF file.</p> </p:documentation></p:option> <p:import href="zedai-to-pef.convert.xpl"> <p:documentation> px:zedai-to-pef </p:documentation> </p:import> <p:import href="xml-to-pef.store.xpl"> <p:documentation> px:xml-to-pef.store </p:documentation> </p:import> <p:import href="http://www.daisy.org/pipeline/modules/file-utils/library.xpl"> <p:documentation> px:tempdir </p:documentation> </p:import> <p:import href="http://www.daisy.org/pipeline/modules/zedai-utils/library.xpl"> <p:documentation> px:zedai-load </p:documentation> </p:import> <px:tempdir name="temp-dir"> <p:with-option name="href" select="if ($temp-dir!='') then $temp-dir else $pef-output-dir"/> </px:tempdir> <p:sink/> <px:zedai-load name="load"> <p:input port="source"> <p:pipe step="main" port="source"/> </p:input> </px:zedai-load> <px:zedai-to-pef> <p:input port="source.in-memory"> <p:pipe step="load" port="in-memory.out"/> </p:input> <p:with-option name="stylesheet" select="$stylesheet"/> <p:with-option name="transform" select="$transform"/> <p:with-option name="temp-dir" select="string(/c:result)"> <p:pipe step="temp-dir" port="result"/> </p:with-option> </px:zedai-to-pef> <px:xml-to-pef.store> <p:input port="obfl"> <p:empty/> </p:input> <p:with-option name="name" select="replace(p:base-uri(/),'^.*/([^/]*)\.[^/\.]*$','$1')"> <p:pipe step="main" port="source"/> </p:with-option> <p:with-option name="include-pef" select="$include-pef"/> <p:with-option name="include-preview" select="$include-preview"/> <p:with-option name="output-file-format" select="$output-file-format"/> <p:with-option name="preview-table" select="$preview-table"/> <p:with-option name="output-dir" select="$output-dir"/> <p:with-option name="pef-output-dir" select="$pef-output-dir"/> <p:with-option name="preview-output-dir" select="$preview-output-dir"/> </px:xml-to-pef.store> </p:declare-step>