<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:px="http://www.daisy.org/ns/pipeline/xproc" xmlns:pxi="http://www.daisy.org/ns/pipeline/xproc/internal" xmlns:cx="http://xmlcalabash.com/ns/extensions" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" type="pxi:dtbook-tidy" name="main"> <p:input port="source" px:media-type="application/x-dtbook+xml" sequence="false"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <p>A single DTBook document</p> </p:documentation> </p:input> <p:output port="result" px:media-type="application/x-dtbook+xml" sequence="false"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <p>The result DTBook document</p> </p:documentation> </p:output> <p:option name="simplifyHeadingLayout" select="false()" cx:as="xs:boolean"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2>Simplify headings layout</h2> <p>TBD</p> </p:documentation> </p:option> <p:option name="externalizeWhitespace" select="false()" cx:as="xs:boolean"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2>Externalize whitespaces</h2> <p>TBD</p> </p:documentation> </p:option> <p:option name="documentLanguage" select="''"> <p:documentation xmlns="http://www.w3.org/1999/xhtml"> <h2>Document language</h2> <p>TBD</p> </p:documentation> </p:option> <p:xslt name="tidy-remove-empty-elements"> <p:input port="stylesheet"><p:document href="xsl/tidy-remove-empty-elements.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> <p:choose> <p:when test="$simplifyHeadingLayout"> <p:xslt name="tidy-level-cleaner"> <p:input port="stylesheet"><p:document href="xsl/tidy-level-cleaner.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> </p:when> <p:otherwise> <p:identity/> </p:otherwise> </p:choose> <p:xslt name="tidy-move-pagenum"> <p:input port="stylesheet"><p:document href="xsl/tidy-move-pagenum.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> <p:xslt name="tidy-pagenum-type"> <p:input port="stylesheet"><p:document href="xsl/tidy-pagenum-type.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> <p:xslt name="tidy-change-inline-pagenum-to-block"> <p:input port="stylesheet"><p:document href="xsl/tidy-change-inline-pagenum-to-block.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> <p:xslt name="tidy-add-author-title"> <p:input port="stylesheet"><p:document href="xsl/tidy-add-author-title.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> <p:xslt name="tidy-add-lang"> <p:input port="stylesheet"><p:document href="xsl/tidy-add-lang.xsl"/></p:input> <p:with-param name="documentLanguage" select="$documentLanguage"/> </p:xslt> <p:choose> <p:when test="$externalizeWhitespace"> <p:xslt name="tidy-externalize-whitespace"> <p:input port="stylesheet"><p:document href="xsl/tidy-externalize-whitespace.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> </p:when> <p:otherwise> <p:identity/> </p:otherwise> </p:choose> <p:xslt name="tidy-indent"> <p:input port="stylesheet"><p:document href="xsl/tidy-indent.xsl"/></p:input> <p:input port="parameters"><p:empty/></p:input> </p:xslt> </p:declare-step>