docx2hub

Converts Microsoft docx to flat hub XML

Repository
Git URL https://github.com/transpect/docx2hub.git
SVN URL https://github.com/transpect/docx2hub
Base URI http://transpect.io/docx2hub/

Source ⬇

docx2hub:apply-changemarkup

Import

<p:import href="http://transpect.io/docx2hub/xpl/apply-changemarkup.xpl"/>

Dependencies

Synopsis

<docx2hub:apply-changemarkup xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="source" primary="true"/>
  <p:input port="params"/>
  <p:input port="stylesheet"/>
  <p:input port="schematron"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:output port="schema" sequence="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'file:/tmp/debug'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="active" required="false" select="'yes'"/>
</docx2hub:apply-changemarkup>

docx2hub:docx2html

Converts docx to XHTML

Import

<p:import href="http://transpect.io/docx2hub/xpl/docx2html.xpl"/>

Dependencies

Synopsis

<docx2hub:docx2html xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="docx2hub-xslt"/>
  <p:input port="source" primary="true"/>
  <p:input port="paths"/>
  <p:output port="result" primary="true"/>
  <p:output port="hub"/>
  <p:option name="docx" required="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'debug'"/>
  <p:option name="srcpaths" required="false" select="'no'"/>
  <p:option name="unwrap-tooltip-links" required="false" select="'no'"/>
  <p:option name="hub-version" required="false" select="'1.2'"/>
  <p:option name="fail-on-error" required="false" select="'no'"/>
  <p:option name="extract-dir" required="false" select="''"/>
  <p:option name="create-svg" required="false" select="'false'"/>
</docx2hub:docx2html>

docx2hub:convert

This script is used to convert docx to Hub XML. By default, the output is stored in the same directory as the input docx file, with the same basename. It is a library that needs other externals. For standalone operation, please check out the front-end project.

From the directory wherey you checked out the front-end project, you invoke it with:

calabash/calabash.sh docx2hub/wml2hub.xpl docx=PATH-TO-MY-DOCX-FILE.docx

where docx may be an OS path or a file:, http:, or https: URL.

Import it with

<p:import href="http://transpect.io/docx2hub/xpl/wml2hub.xpl" />

if you use it from transpect or if you imported this project as svn:external.

In the latter case, include the following line in you project's xmlcatalog/catalog.xml:

<nextCatalog catalog="../docx2hub/xmlcatalog/catalog.xml"/>

Experts may override the default conversion rules by supplying custom XSLT (that imports main.xsl) on the 'xslt' port.

Import

<p:import href="http://transpect.io/docx2hub/xpl/docx2hub.xpl"/>

Dependencies

Synopsis

<docx2hub:convert xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="xslt"/>
  <p:input port="source" primary="true"/>
  <p:input port="single-tree-schematron"/>
  <p:input port="check-tables-schematron"/>
  <p:input port="changemarkup-schematron"/>
  <p:input port="mathtype2mml-schematron"/>
  <p:input port="field-functions-schematron"/>
  <p:input port="result-schematron"/>
  <p:input port="custom-font-maps" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="insert-xpath"/>
  <p:output port="report" sequence="true"/>
  <p:output port="schema" sequence="true"/>
  <p:output port="zip-manifest"/>
  <p:option name="docx" required="true"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="srcpaths" select="'no'"/>
  <p:option name="unwrap-tooltip-links" select="'no'"/>
  <p:option name="remove-biblioentry-paragraphs" select="'yes'"/>
  <p:option name="mml-space-handling" select="'mspace'"/>
  <p:option name="mml-version" select="''"/>
  <p:option name="hub-version" select="'1.2'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="field-vars" select="'no'"/>
  <p:option name="extract-dir" select="''"/>
  <p:option name="discard-alternate-choices" select="'yes'"/>
  <p:option name="charmap-policy" select="'unicode'"/>
  <p:option name="mathtype2mml" required="false" select="'yes'"/>
  <p:option name="mathtype-source-pi" required="false" select="'no'"/>
  <p:option name="apply-changemarkup" required="false" select="'yes'"/>
  <p:option name="use-filename-from-http-response" required="false" select="'no'"/>
  <p:option name="check-tables" required="false" select="'no'"/>
  <p:option name="create-svg" select="'false'"/>
  <p:option name="include-header-and-footer" required="false" select="'no'"/>
  <p:option name="insert-document-defaults" required="false" select="'yes'"/>
  <p:option name="float-nr-check-error-level" select="''"/>
  <p:option name="report-referenced-images-in-docx" required="false" select="'no'"/>
  <p:option name="lang-variant" select="'no'"/>
  <p:option name="terminate-on-unbalanced-instrTexts" required="false" select="'yes'"/>
  <p:option name="keep-paraid" required="false" select="'false'"/>
  <p:option name="heuristic-character-replacements" select="'#all'"/>
  <p:option name="table-headers-and-footers-from-tblLook" select="'no'"/>
  <p:option name="normalize-thead" select="'yes'"/>
</docx2hub:convert>

docx2hub:mathtype2mml

Import

<p:import href="http://transpect.io/docx2hub/xpl/mathtype2mml.xpl"/>

Dependencies

Synopsis

<docx2hub:mathtype2mml xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="source" primary="true"/>
  <p:input port="zip-manifest"/>
  <p:input port="params"/>
  <p:input port="schematron"/>
  <p:input port="custom-font-maps" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="modified-zip-manifest"/>
  <p:output port="report" sequence="true"/>
  <p:output port="schema" sequence="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'file:/tmp/debug'"/>
  <p:option name="active" required="false" select="'yes'"/>
  <p:option name="word-container-cleanup" required="false" select="'yes'"/>
  <p:option name="mathtype-source-pi" required="false" select="'no'"/>
  <p:option name="mml-space-handling" select="'mspace'"/>
</docx2hub:mathtype2mml>

docx2hub:single-tree-enhanced

For usage in docx_modify and other XProc steps with need of the docx single-tree plus some more enhancements.

Import

<p:import href="http://transpect.io/docx2hub/xpl/single-tree-enhanced.xpl"/>

Synopsis

<docx2hub:single-tree-enhanced xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="xslt"/>
  <p:input port="source" primary="true"/>
  <p:input port="single-tree-schematron"/>
  <p:input port="change-markup-schematron"/>
  <p:input port="mathtype2mml-schematron"/>
  <p:input port="custom-font-maps" sequence="true" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="report" sequence="true"/>
  <p:output port="zip-manifest"/>
  <p:output port="params"/>
  <p:output port="schema" sequence="true"/>
  <p:option name="docx" required="true"/>
  <p:option name="debug" select="'no'"/>
  <p:option name="debug-dir-uri" select="'debug'"/>
  <p:option name="status-dir-uri" select="'status'"/>
  <p:option name="srcpaths" select="'no'"/>
  <p:option name="no-srcpaths-for-text-runs-threshold" select="'40000'"/>
  <p:option name="unwrap-tooltip-links" select="'no'"/>
  <p:option name="mml-space-handling" select="'mspace'"/>
  <p:option name="hub-version" select="'1.2'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="field-vars" select="'no'"/>
  <p:option name="extract-dir" select="''"/>
  <p:option name="remove-biblioentry-paragraphs" select="'yes'"/>
  <p:option name="mathtype2mml" required="false" select="'yes'"/>
  <p:option name="mathtype-source-pi" required="false" select="'no'"/>
  <p:option name="mathtype2mml-cleanup" required="false" select="'yes'"/>
  <p:option name="apply-changemarkup" required="false" select="'yes'"/>
  <p:option name="use-filename-from-http-response" required="false" select="'no'"/>
  <p:option name="insert-document-defaults" required="false" select="'yes'"/>
</docx2hub:single-tree-enhanced>

docx2hub:single-tree

Import

<p:import href="http://transpect.io/docx2hub/xpl/single-tree.xpl"/>

Dependencies

Synopsis

<docx2hub:single-tree xmlns:docx2hub="http://transpect.io/docx2hub">
  <p:input port="source" primary="true"/>
  <p:input port="schematron" primary="false"/>
  <p:input port="xslt" primary="false"/>
  <p:output port="result" primary="true"/>
  <p:output port="params"/>
  <p:output port="zip-manifest"/>
  <p:output port="report" sequence="true"/>
  <p:output port="schema" sequence="true"/>
  <p:option name="docx" required="true"/>
  <p:option name="debug" required="false" select="'no'"/>
  <p:option name="debug-dir-uri" required="false" select="'file:/tmp/debug'"/>
  <p:option name="srcpaths" required="false" select="'no'"/>
  <p:option name="unwrap-tooltip-links" required="false" select="'no'"/>
  <p:option name="remove-biblioentry-paragraphs" required="false" select="'yes'"/>
  <p:option name="mml-space-handling" select="'mspace'"/>
  <p:option name="hub-version" required="false" select="'1.2'"/>
  <p:option name="fail-on-error" select="'no'"/>
  <p:option name="field-vars" required="false" select="'no'"/>
  <p:option name="extract-dir" required="false" select="''"/>
  <p:option name="no-srcpaths-for-text-runs-threshold" select="'40000'"/>
  <p:option name="use-filename-from-http-response" required="false" select="'no'"/>
  <p:option name="insert-document-defaults" select="'yes'"/>
</docx2hub:single-tree>

GitHub sync date: 2024-04-23+02:00