<p:declare-step type="dedicon:dtbook-to-pef" version="1.0" exclude-inline-prefixes="#all" name="main"> <p:documentation> <h1 px:role="name">DTBook to PEF (Dedicon)</h1> <p px:role="desc">Transforms a DTBook (DAISY 3 XML) document into a PEF.</p> </p:documentation> <p:input port="source" primary="true" px:name="source" px:media-type="application/x-dtbook+xml"><p:documentation> <h2 px:role="name">Input DTBook</h2> </p:documentation></p:input> <p:option name="stylesheet" select="' http://www.daisy.org/pipeline/modules/braille/dtbook-to-pef/xsl/volume-breaking.xsl http://www.dedicon.nl/pipeline/modules/braille/volume-breaking.scss http://www.dedicon.nl/pipeline/modules/braille/default.scss'" px:sequence="true" required="false" px:type="px:dtbook-to-pef.script-stylesheet" px:media-type="text/css application/xslt+xml"><p:documentation> <h2 px:role="name">Style sheets</h2> <p px:role="desc" xml:space="preserve">A list of XSLT or CSS/SASS style sheets to apply. Must be a space separated list of URIs, absolute or relative to the input. Style sheets can also be associated with the source in other ways: 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 ones specified through this option, then the ones associated with the source document, 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 the ones specified through this option, then the ones associated with the source document) 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:option> <p:option name="include-preview" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Include preview</h2> <p px:role="desc" xml:space="preserve">Whether or not to include a preview of the PEF in HTML.</p> </p:documentation></p:option> <p:option name="include-brf" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Include plain text file (BRF)</h2> <p px:role="desc" xml:space="preserve">Whether or not to include a plain text ASCII version of the PEF.</p> </p:documentation></p:option> <p:option name="include-metadata" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Include metadata file</h2> </p:documentation> </p:option> <p:option name="metadata-date" select="''"/> <p:option name="include-obfl" select="'false'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Include OBFL</h2> <p px:role="desc" xml:space="preserve">Keeps the intermediary OBFL-file for debugging.</p> </p:documentation></p:option> <p:option name="add-boilerplate" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Add boilerplate text</h2> <p px:role="desc">When enabled, and when the input has a `docauthor` element, will insert boilerplate text such as a title page.</p> </p:documentation> </p:option> <p:option name="page-width" select="'-1'" required="false" px:type="integer"> <p:documentation> <h2 px:role="name">Page layout: Page width </h2> <p px:role="desc" xml:space="preserve">The number of columns available for printing. Makes the variable `$page-width` available in style sheets and includes the following rule by default: ~~~sass @page { size: $page-width $page-height; } ~~~ See the CSS specification for more info: - the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule - the [`size`](http://braillespecs.github.io/braille-css/#the-size-property) property Use `-1` to compute this from metadata.</p> </p:documentation> </p:option> <p:option name="page-height" select="'-1'" required="false" px:type="integer"> <p:documentation> <h2 px:role="name">Page layout: Page height </h2> <p px:role="desc" xml:space="preserve">The number of rows available for printing. Makes the variable `$page-height` available in style sheets and includes the following rule by default: ~~~sass @page { size: $page-width $page-height; } ~~~ See the CSS specification for more info: - the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule - the [`size`](http://braillespecs.github.io/braille-css/#the-size-property) property Use `-1` to compute this from metadata.</p> </p:documentation> </p:option> <p:option name="printing" select="'duplex'"> <p:pipeinfo> <px:type> <choice> <value>simplex</value> <documentation>Simplex</documentation> <value>simplex-form-feeds</value> <documentation>Simplex with extra form feeds</documentation> <value>duplex</value> <documentation>Duplex</documentation> </choice> </px:type><px:type> <choice> <value>simplex</value> <documentation>Simplex</documentation> <value>simplex-form-feeds</value> <documentation>Simplex with extra form feeds</documentation> <value>duplex</value> <documentation>Duplex</documentation> </choice> </px:type> </p:pipeinfo> <p:documentation> <h2 px:role="name">Page layout: Printing</h2> <p px:role="desc" xml:space="preserve">Option `Simplex with extra form feeds` adds extra form feeds to the braille files to enforce single sided printing.</p> </p:documentation> </p:option> <p:option name="hyphenation" select="'from-meta'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Translation/formatting of text: Hyphenation</h2> <p px:role="desc" xml:space="preserve">When enabled, will automatically hyphenate text. Makes the variable `$hyphenation` available in style sheets and includes the following rule by default: ~~~sass @if $hyphenation { :root { hyphens: auto; } } ~~~ See the CSS specification for more info: - the [`hyphens`](http://braillespecs.github.io/braille-css/#the-hyphens-property) property </p> </p:documentation> <p:pipeinfo> <px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type><px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type> </p:pipeinfo> </p:option> <p:option name="line-spacing" select="'single'" required="false" pxd:type="px:xml-to-pef-line-spacing"><p:documentation> <h2 px:role="name">Translation/formatting of text: Line spacing</h2> <p px:role="desc" xml:space="preserve">Single or double line spacing. Makes the variable `$line-spacing` available in style sheets and includes the following rule by default: ~~~sass @if $line-spacing == double { :root { line-height: 2; } } ~~~ See the CSS specification for more info: - the [`line-height`](http://braillespecs.github.io/braille-css/#h3_the-line-height-property) property </p> </p:documentation></p:option> <p:option name="capital-letters" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Translation/formatting of text: Capital letters</h2> <p px:role="desc" xml:space="preserve">When enabled, will indicate capital letters. Makes the variable `$capital-letters` available in style sheets and includes the following rule by default: ~~~sass @if $capital-letters != true { :root { text-transform: lowercase; } } ~~~</p> </p:documentation></p:option> <p:option name="include-captions" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Block elements: Include captions</h2> <p px:role="desc" xml:space="preserve">When enabled, will include captions for images, tables, and so on. Makes the variable `$include-captions` available in style sheets and includes the following rule by default: ~~~sass caption { display: if($include-captions, block, none); } ~~~</p> </p:documentation></p:option> <p:option name="include-images" select="'false'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Block elements: Include images</h2> <p px:role="desc" xml:space="preserve">When enabled, will include the alt text of the images. When disabled, the images will be completely removed. Makes the variable `$include-images` available in style sheets and includes the following rule by default: ~~~sass @if $include-images { img::after { content: attr(alt); } } ~~~</p> </p:documentation></p:option> <p:option name="include-image-groups" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Block elements: Include image groups</h2> <p px:role="desc" xml:space="preserve">**Not implemented**</p> </p:documentation></p:option> <p:option name="include-line-groups" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Block elements: Include line groups</h2> <p px:role="desc" xml:space="preserve">When disabled, lines in a linegroup are joined together to form one block. Makes the variable `$include-line-groups` available in style sheets and includes the following rule by default: ~~~sass linegroup line { display: if($include-line-groups, block, inline); } ~~~</p> </p:documentation></p:option> <p:option name="include-production-notes" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Inline elements: Include production notes</h2> <p px:role="desc" xml:space="preserve">When enabled, production notes are included in the content. Makes the variable `$include-production-notes` available in style sheets and includes the following rule by default: ~~~sass prodnote { display: if($include-production-notes, block, none); } ~~~</p> </p:documentation></p:option> <p:option name="show-braille-page-numbers" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Page numbers: Show braille page numbers</h2> <p px:role="desc" xml:space="preserve">When enabled, will number braille pages. Makes the variable `$show-braille-page-numbers` available in style sheets. In order to use the variable include a rule like the following in your custom style sheet: ~~~sass @if $show-braille-page-numbers { @page { @top-right { content: counter(page); } } } ~~~ This will create a page number in the top right corner of every braille page. See the CSS specification for more info: - the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule - the [`counter()`](http://braillespecs.github.io/braille-css/#printing-counters-the-counter-function) function </p> </p:documentation></p:option> <p:option name="show-print-page-numbers" select="'true'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Page numbers: Show print page numbers</h2> <p px:role="desc" xml:space="preserve">When enabled, will indicate original page numbers. Makes the variable `$show-print-page-numbers` available in style sheets and includes the following rule by default: ~~~sass @if $show-print-page-numbers { pagenum { string-set: print-page content(); } } ~~~ In order to use the `print-page` string include a rule like the following in your custom style sheet: ~~~css @page { @bottom-right { content: string(print-page); } } ~~~ See the CSS specification for more info: - the [`string-set`](http://braillespecs.github.io/braille-css/#h4_the-string-set-property) property - the [`@page`](http://braillespecs.github.io/braille-css/#h4_the-page-rule) rule - the [`string()`](http://braillespecs.github.io/braille-css/#h4_the-string-function) function </p> </p:documentation></p:option> <p:option name="show-inline-print-page-numbers" select="'from-meta'"> <p:pipeinfo> <px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type><px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type> </p:pipeinfo> <p:documentation> <h2 px:role="name">Page numbers: Show inline print page numbers</h2> </p:documentation> </p:option> <p:option name="force-braille-page-break" select="'false'" required="false" px:type="boolean"><p:documentation> <h2 px:role="name">Page numbers: Force braille page break</h2> <p px:role="desc" xml:space="preserve">Force braille page breaks at print page breaks. Makes the variable `$force-braille-page-break` available in style sheets and includes the following rule by default: ~~~sass @if $force-braille-page-break { pagenum { page-break-before: always; } } ~~~ See the CSS specification for more info: - the [`page-break-before`](http://braillespecs.github.io/braille-css/#h4_controlling-page-breaks) property </p> </p:documentation></p:option> <p:option name="toc-depth" select="'6'" required="false" px:type="integer"><p:documentation> <h2 px:role="name">Table of contents: Table of contents depth</h2> <p px:role="desc" xml:space="preserve">The depth of the table of contents hierarchy to include. '0' means no table of contents. A table of contents will be generated from the heading elements present in the document: from `h1` elements if the specified value for "depth" is 1, from `h1` and `h2` elements if the specified value is 2, etc. The resulting table of contents has the following nested structure: ~~~xml <list id="generated-document-toc"> <li> <a href="#ch_1">Chapter 1</a> <list> <li> <a href="#ch_1_1">1.1</a> ... </li> <li> <a href="#ch_1_2">1.2</a> ... </li> ... </list> </li> ... </list> ~~~ Another one of these is generated but with ID `generated-volume-toc`. `ch_1`, `ch_1_2` etc. are the IDs of the heading elements from which the list was constructed, and the content of the links are exact copies of the content of the heading elements. By default the list is not rendered. The list should be styled and positioned with CSS. The following rules are included by default: ~~~css #generated-document-toc { flow: document-toc; display: -obfl-toc; -obfl-toc-range: document; } #generated-volume-toc { flow: volume-toc; display: -obfl-toc; -obfl-toc-range: volume; } ~~~ This means that a document range table of contents is added to the named flow called "document-toc", and a volume range table of contents is added to the named flow called "volume-toc". In order to consume these named flows use the function `flow()`. For example, to position the document range table of contents at the beginning of the first volume, and to repeat the volume range table of content at the beginning of every other volume, include the following additional rules: ~~~css @volume { @begin { content: flow(volume-toc); } } @volume:first { @begin { content: flow(document-toc); } } ~~~ See the CSS specification for more info: - the [`display: obfl-toc`](http://braillespecs.github.io/braille-css/obfl#extending-the-display-property-with--obfl-toc) value - the [`flow`](http://braillespecs.github.io/braille-css/#the-flow-property) property - the [`flow()`](http://braillespecs.github.io/braille-css/#h4_the-flow-function) function - the [`@volume`](http://braillespecs.github.io/braille-css/#h3_the-volume-rule) rule - the [`@begin`](http://braillespecs.github.io/braille-css/#h3_the-begin-and-end-rules) rule </p> </p:documentation></p:option> <p:option name="include-document-toc-in-last-volume" required="false" select="'from-meta'"> <p:pipeinfo> <px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type><px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type> </p:pipeinfo> <p:documentation> <h2 px:role="name">Table of contents: Include document TOC</h2> <p px:role="desc" xml:space="preserve">Whether or not to include a document-level TOC in the last volume.</p> </p:documentation> </p:option> <p:option name="include-print-toc" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Table of contents: Include print TOC</h2> <p px:role="desc" xml:space="preserve">Whether or not to include a print TOC.</p> </p:documentation> </p:option> <p:option name="include-symbols-list" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Include symbols list</h2> <p px:role="desc" xml:space="preserve">When enabled, a list of symbols and their descriptions is included in the first volume.</p> </p:documentation> </p:option> <p:option name="symbols-code" select="'http://www.dedicon.nl/pipeline/modules/braille/symbols_code.xml'"> <p:documentation> <h2 px:role="name">Symbols list</h2> <p px:role="desc" xml:space="preserve">If left unchanged, the default symbols list will be used.</p> </p:documentation> </p:option> <p:option name="symbols-list-header" required="false" px:type="string" select="'Symbolenlijst'"> <p:documentation> <h2 px:role="name">Symbols list header</h2> </p:documentation> </p:option> <p:option name="jacket-header" required="false" px:type="string" select="'Flaptekst'"> <p:documentation> <h2 px:role="name">Jacket header</h2> </p:documentation> </p:option> <p:option name="move-print-cover-to-first-volume" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Volumes: Move print cover to first volume</h2> <p px:role="desc">When enabled, and when the input has a `level1` element with class `flap`, `jacket_copy` or `jacketcopy`, will move that cover to the first volume.</p> </p:documentation> </p:option> <p:option name="move-print-colophon-to-last-volume" required="false" select="'from-meta'"> <p:pipeinfo> <px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type><px:type> <choice> <value>true</value> <documentation>Yes</documentation> <value>false</value> <documentation>No</documentation> <value>from-meta</value> <documentation>Use value from metadata field</documentation> </choice> </px:type> </p:pipeinfo> <p:documentation> <h2 px:role="name">Volumes: Move print colophon to last volume</h2> <p px:role="desc">When enabled, and when the input has a `level1` element with class `colophon`, will move that colophon to the last volume.</p> </p:documentation> </p:option> <p:option name="maximum-number-of-sheets" select="'-1'" required="false" px:type="integer"> <p:documentation> <h2 px:role="name">Volumes: Maximum number of sheets </h2> <p px:role="desc" xml:space="preserve">The maximum number of sheets in a volume. Makes the variable `$maximum-number-of-sheets` available in style sheets and includes the following rule by default: ~~~sass @volume { max-length: $maximum-number-of-sheets; } ~~~ See the CSS specification for more info: - the [`@volume`](http://braillespecs.github.io/braille-css/#h3_the-volume-rule) rule - the [`max-length`](http://braillespecs.github.io/braille-css/#h3_the-length-properties) property Use `-1` to compute this from metadata.</p> </p:documentation> </p:option> <p:option name="volume-back-cover-empty" required="false" px:type="boolean" select="'true'"> <p:documentation> <h2 px:role="name">Volumes: The back cover must be empty</h2> <p px:role="desc" xml:space="preserve">Applies to duplex printing. When enabled, the last page of a printed volume will contain no text and can have pits only. If the number of pages of a volume is a 4-fold and the last page is not empty, an extra page will be appended.</p> </p:documentation> </p:option> <p:option name="pef-output-dir" required="true" px:output="result" px:type="anyDirURI" px:media-type="application/x-pef+xml"><p:documentation> <h2 px:role="name">PEF</h2> <p px:role="desc">The PEF.</p> </p:documentation></p:option> <p:option name="brf-output-dir" select="''" required="false" px:output="result" px:type="anyDirURI" px:media-type="text"><p:documentation> <h2 px:role="name">BRF</h2> <p px:role="desc">A plain text ASCII version of the PEF.</p> </p:documentation></p:option> <p:option name="preview-output-dir" select="''" required="false" px:output="result" px:type="anyDirURI" px:media-type="text/html"><p:documentation> <h2 px:role="name">Preview</h2> <p px:role="desc">An HTML preview of the PEF.</p> </p:documentation></p:option> <p:variable name="file-format" px:type="string" select="'(table:"com_braillo.BrailloTableProvider.TableType.BRAILLO_6DOT_031_01")(line-breaks:dos)(pad:both)(charset:"IBM00858")(file-extension:".brl")'"/> <p:import href="http://www.daisy.org/pipeline/modules/braille/dtbook-to-pef/library.xpl"/> <p:import href="http://www.daisy.org/pipeline/modules/braille/common-utils/library.xpl"/> <p:import href="http://www.daisy.org/pipeline/modules/braille/pef-utils/library.xpl"/> <p:import href="http://www.daisy.org/pipeline/modules/file-utils/library.xpl"/> <p:import href="http://www.daisy.org/pipeline/modules/common-utils/library.xpl"/> <p:import href="http://www.daisy.org/pipeline/modules/dtbook-utils/library.xpl"/> <p:import href="http://www.dedicon.nl/pipeline/modules/braille/library.xpl"/> <p:in-scope-names name="in-scope-names"/> <px:merge-parameters> <p:input port="source"> <p:pipe port="result" step="in-scope-names"/> </p:input> </px:merge-parameters> <px:delete-parameters parameter-names="stylesheet symbols-code ascii-table include-brf include-preview include-obfl pef-output-dir brf-output-dir preview-output-dir temp-dir"/> <px:add-parameters> <p:with-param name="skip-margin-top-of-page" select="true()"/> <p:with-param name="page-width" select="if ($page-width='-1') then if (//dtb:meta[@name='prod:docType']/@content='ro') then '28' else if (//dtb:meta[@name='prod:docType']/@content='sv') then '33' else '28' else $page-width"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="page-height" select="if ($page-height='-1') then if (//dtb:meta[@name='prod:docType']/@content='ro') then '26' else if (//dtb:meta[@name='prod:docType']/@content='sv') then '27' else '26' else $page-height"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="maximum-number-of-sheets" select="if ($maximum-number-of-sheets='-1') then if (//dtb:meta[@name='prod:docType']/@content='ro') then '35' else if (//dtb:meta[@name='prod:docType']/@content='sv') then '37' else '35' else $maximum-number-of-sheets"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="hyphenation" select="if ($hyphenation='from-meta') then (//dtb:meta[@name='prod:docHyphenate']/@content,'Y')[1]='Y' else $hyphenation='true'"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="show-inline-print-page-numbers" select="if ($show-inline-print-page-numbers='from-meta') then //dtb:meta[@name='prod:docType']/@content='sv' else $show-inline-print-page-numbers='true'"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="include-document-toc-in-last-volume" select="if ($include-document-toc-in-last-volume='from-meta') then //dtb:meta[@name='prod:docType']/@content='ro' else $include-document-toc-in-last-volume='true'"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="move-print-colophon-to-last-volume" select="if ($move-print-colophon-to-last-volume='from-meta') then //dtb:meta[@name='prod:docType']/@content='sv' else $move-print-colophon-to-last-volume='true'"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="duplex" select="$printing='duplex'"> <p:pipe step="main" port="source"/> </p:with-param> <p:with-param name="ascii-file-format" select="$file-format"> <p:pipe step="main" port="source"/> </p:with-param> </px:add-parameters> <p:identity name="input-options"/> <p:sink/> <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/> <dedicon:message reset="true" message="Start Dedicon pre-processing"> <p:input port="source"> <p:pipe step="main" port="source"/> </p:input> </dedicon:message> <p:choose> <p:when test="$include-print-toc = 'false'"> <dedicon:message message="Removing print TOC"/> <dedicon:remove-print-toc/> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Keeping print TOC"/> </p:otherwise> </p:choose> <dedicon:message message="Applying fix for backslashes in attribute src"/> <dedicon:src-backslash-fix/> <dedicon:message message="Moving notes after their noteref"/> <dedicon:move-notes/> <p:choose> <p:when test="$move-print-cover-to-first-volume='true'"> <dedicon:message message="Managing jacket"/> <dedicon:jacket> <p:with-option name="jacket-header" select="$jacket-header"/> </dedicon:jacket> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Skipping jacket"/> </p:otherwise> </p:choose> <p:choose> <p:when test="$include-symbols-list='true'"> <dedicon:message message="Including symbols list"/> <dedicon:symbols-list> <p:with-option name="symbols-code" select="$symbols-code"/> <p:with-option name="symbols-list-header" select="$symbols-list-header"/> </dedicon:symbols-list> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Skipping symbols list"/> </p:otherwise> </p:choose> <p:choose> <p:when test="$add-boilerplate='true'"> <dedicon:message message="Adding boilerplate"/> <dedicon:add-boilerplate> <p:input port="parameters"> <p:pipe step="input-options" port="result"/> </p:input> </dedicon:add-boilerplate> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Skipping boilerplate"/> </p:otherwise> </p:choose> <dedicon:message message="End Dedicon pre-processing"/> <px:set-base-uri base-uri="file:/irrelevant.xml"/> <px:dtbook-load name="load"/> <px:dtbook-to-pef default-stylesheet="http://www.daisy.org/pipeline/modules/braille/dtbook-to-pef/css/default.css" transform="(formatter:dotify)(translator:dedicon)" name="convert"> <p:input port="source.in-memory"> <p:pipe step="load" port="in-memory.out"/> </p:input> <p:with-option name="temp-dir" select="string(/c:result)"> <p:pipe step="temp-dir" port="result"/> </p:with-option> <p:with-option name="stylesheet" select="$stylesheet"/> <p:with-option name="include-obfl" select="$include-obfl"/> <p:input port="parameters"> <p:pipe port="result" step="input-options"/> </p:input> </px:dtbook-to-pef> <p:group> <p:variable name="identifier" select="//dtb:meta[@name='dc:Identifier']/@content"> <p:pipe step="main" port="source"/> </p:variable> <p:variable name="name" select="if ($identifier) then $identifier else replace(p:base-uri(/),'^.*/([^/]*)\.[^/\.]*$','$1')"> <p:pipe step="main" port="source"/> </p:variable> <p:variable name="title" select="//dtb:meta[@name='dc:Title']/@content"> <p:pipe step="main" port="source"/> </p:variable> <p:for-each> <p:choose> <p:when test="$volume-back-cover-empty='true'"> <dedicon:message message="Volume back cover will be empty"/> <dedicon:empty-back-cover> <p:with-option name="xquery" select="resolve-uri('../../xquery/empty-back-cover.xql')"/> </dedicon:empty-back-cover> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Skipping ''volume back cover will be empty''"/> </p:otherwise> </p:choose> <p:identity name="pef"/> <p:group> <p:variable name="preview-href" select=" if ($include-preview='true' and $preview-output-dir!='') then concat($preview-output-dir,'/',$name,'.pef.html') else '' "/> <p:variable name="brf-file-format" select="$file-format"/> <p:variable name="brf-name-pattern" select="concat('p',$name,'_{}')"/> <p:variable name="brf-number-width" select="3"/> <p:variable name="brf-dir-href" select=" if ($include-brf='true') then if ($brf-output-dir!='') then $brf-output-dir else if ($pef-output-dir!='') then $pef-output-dir else '' else '' "/> <pef:store> <p:with-option name="href" select="concat($pef-output-dir,'/',$name,'.pef')"/> <p:with-option name="preview-href" select="$preview-href"/> <p:with-option name="brf-dir-href" select="$brf-dir-href"/> <p:with-option name="brf-file-format" select="$brf-file-format"/> <p:with-option name="brf-name-pattern" select="$brf-name-pattern"/> <p:with-option name="brf-number-width" select="$brf-number-width"/> </pef:store> <dedicon:message message="Inserting newline in BRL files"> <p:input port="source"> <p:pipe port="result" step="pef"/> </p:input> </dedicon:message> <dedicon:brl-uris name="brl-uris"> <p:with-option name="xquery" select="resolve-uri('../../xquery/brl-uris.xql')"/> <p:with-option name="brf-dir-href" select="$brf-dir-href"/> <p:with-option name="brf-file-format" select="$brf-file-format"/> <p:with-option name="brf-name-pattern" select="$brf-name-pattern"/> <p:with-option name="brf-number-width" select="$brf-number-width"/> </dedicon:brl-uris> <p:for-each> <dedicon:brl-must-start-with-newline> <p:with-option name="brl-uri" select="."/> </dedicon:brl-must-start-with-newline> </p:for-each> <p:choose> <p:when test="$printing='simplex'"> <dedicon:message message="Replacing double form feeds in BRL files"> <p:input port="source"> <p:empty/> </p:input> </dedicon:message> <p:for-each> <p:iteration-source> <p:pipe step="brl-uris" port="result"/> </p:iteration-source> <dedicon:brl-replace-double-form-feeds> <p:with-option name="brl-uri" select="."/> </dedicon:brl-replace-double-form-feeds> </p:for-each> </p:when> <p:otherwise> <p:sink> <p:input port="source"> <p:empty/> </p:input> </p:sink> </p:otherwise> </p:choose> <p:choose> <p:when test="$include-metadata='true'"> <dedicon:message message="Storing metadata"> <p:input port="source"> <p:pipe port="result" step="pef"/> </p:input> </dedicon:message> <dedicon:metadata> <p:with-option name="xquery" select="resolve-uri('../../xquery/metadata.xql')"/> <p:with-option name="identifier" select="$identifier"/> <p:with-option name="brf-file-format" select="$brf-file-format"/> <p:with-option name="brf-name-pattern" select="$brf-name-pattern"/> <p:with-option name="brf-number-width" select="$brf-number-width"/> <p:with-option name="optional-date" select="$metadata-date"/> </dedicon:metadata> <p:store> <p:with-option name="href" select="concat($pef-output-dir, '/m', $name, '_001.xml')"/> </p:store> </p:when> <p:otherwise> <dedicon:message severity="TRACE" message="Skipping metadata"> <p:input port="source"> <p:empty/> </p:input> </dedicon:message> <p:sink/> </p:otherwise> </p:choose> <p:choose> <p:when test="$preview-href != ''"> <dedicon:message message="Modifying preview"> <p:input port="source"> <p:empty/> </p:input> </dedicon:message> <dedicon:modify-preview> <p:with-option name="preview-uri" select="$preview-href"/> </dedicon:modify-preview> </p:when> <p:otherwise> <p:sink> <p:input port="source"> <p:empty/> </p:input> </p:sink> </p:otherwise> </p:choose> </p:group> </p:for-each> <p:for-each> <p:iteration-source> <p:pipe step="convert" port="obfl"/> </p:iteration-source> <dedicon:message message="Storing OBFL"/> <p:store> <p:with-option name="href" select="concat($pef-output-dir,'/',$name,'.obfl')"/> </p:store> </p:for-each> <dedicon:message> <p:with-option name="message" select="concat('Finished ''', $title, '''')"/> <p:input port="source"> <p:empty/> </p:input> </dedicon:message> <p:sink/> </p:group> </p:declare-step>