docx2hub:convert docx2hub
docx2hub/xpl/docx2hub.xpl
Import URI: http://transpect.io/docx2hub/xpl/docx2hub.xpl
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 a 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.
Input Ports
Name | Documentation | Connections |
---|---|---|
xslt |
| |
sourceⓅ | This is to prevent a default readable port connecting to this step’s xslt port. | |
field-functions-schematron | Schematron that will validate the intermediate format after merging/splitting Word field functions. |
|
result-schematron | Schematron that will validate the flat Hub. It will chiefly report error messages that were embedded during conversion. |
|
Output Ports
Name | Documentation | Connections |
---|---|---|
resultⓅ | ||
insert-xpath | ||
reportⓈ | ||
schemaⓈ | ||
zip-manifest |
Options
Name | Documentation | Default |
---|---|---|
docxⓇ | OS name (preferably with full path, may not resolve if only a relative path is given), file:, http:, or https: URL. The file will be fetched first if it is an HTTP URL. | |
debug | 'no' | |
debug-dir-uri | 'debug' | |
status-dir-uri | 'status' | |
srcpaths | 'no' | |
unwrap-tooltip-links | 'no' | |
hub-version | '1.2' | |
fail-on-error | 'no' | |
field-vars | 'no' | |
extract-dir | Directory (OS path, not file: URL) to which the file will be unzipped. If option is empty string, will be '.tmp' appended to OS file path. | '' |
create-svg | Whether Office Open Drawing ML should be mapped to SVG | 'no' |
Subpipeline
Step | Inputs | Outputs | Options |
---|---|---|---|
docx2hub:single-tree single-tree | result | docx = $docx debug = $debug debug-dir-uri = $debug-dir-uri hub-version = $hub-version unwrap-tooltip-links = $unwrap-tooltip-links fail-on-error = $fail-on-error field-vars = $field-vars srcpaths = $srcpaths extract-dir = $extract-dir | |
tr:xslt-mode d47e166 |
| result | msg = 'yes' mode = 'docx2hub:add-props' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/03') debug = $debug debug-dir-uri = $debug-dir-uri |
tr:xslt-mode d47e197 |
| result | msg = 'yes' mode = 'docx2hub:props2atts' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/05') debug = $debug debug-dir-uri = $debug-dir-uri |
tr:xslt-mode d47e227 |
| result | msg = 'yes' mode = 'docx2hub:remove-redundant-run-atts' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/07') debug = $debug debug-dir-uri = $debug-dir-uri |
tr:xslt-mode d47e256 |
| result | msg = 'yes' mode = 'docx2hub:join-instrText-runs' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/08') debug = $debug debug-dir-uri = $debug-dir-uri hub-version = $hub-version |
tr:xslt-mode separate-field-functions |
| result | msg = 'yes' mode = 'docx2hub:separate-field-functions' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/11') debug = $debug debug-dir-uri = $debug-dir-uri |
p:validate-with-schematron check-field-functions0 |
| result | assert-valid = 'false' |
p:sink d47e328 |
| ||
p:add-attribute d47e329 |
| result | match = '/*' attribute-name = 'tr:step-name' attribute-value = 'docx2hub' |
p:add-attribute check-field-functions Will also check other things such as change markup. | result | match = '/*' attribute-name = 'tr:rule-family' attribute-value = 'docx2hub_field-functions' | |
p:sink d47e341 |
| ||
p:add-attribute d47e342 |
| result | match = '/*' attribute-name = 'tr:step-name' attribute-value = 'docx2hub' |
p:add-attribute decorate-field-functions-schematron | result | match = '/*' attribute-name = 'tr:rule-family' attribute-value = 'docx2hub' | |
p:sink d47e351 | |||
tr:xslt-mode d47e353 |
| result | msg = 'yes' mode = 'wml-to-dbk' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/20') debug = $debug debug-dir-uri = $debug-dir-uri hub-version = $hub-version |
tr:xslt-mode d47e396 |
| result | msg = 'yes' mode = 'docx2hub:join-runs' prefix = concat('docx2hub/', /c:param-set/c:param[@name='basename']/@value, '/24') debug = $debug debug-dir-uri = $debug-dir-uri hub-version = $hub-version |
p:add-attribute rebase | result | match = '/*' attribute-name = 'xml:base' attribute-value = replace(/c:param-set/c:param[@name='local-href']/@value, '\.do[ct][xm]$', '.hub.xml') | |
result | hub-version = $hub-version | ||
p:validate-with-schematron check-result0 |
| result | assert-valid = 'false' |
p:sink d47e450 |
| ||
p:add-attribute check-result |
| result | match = '/*' attribute-name = 'tr:rule-family' attribute-value = 'docx2hub_result' |
p:sink d47e458 |
| ||
p:add-attribute decorate-result-schematron |
| result | match = '/*' attribute-name = 'tr:rule-family' attribute-value = 'docx2hub' |
p:sink d47e466 |
| ||
p:identity d47e467 | result |