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

NameDocumentationConnections

xslt

  • Default document: ../xsl/main.xsl

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.

  • Default document: ../sch/field-functions.sch.xml

result-schematron

Schematron that will validate the flat Hub. It will chiefly report error messages that were embedded during conversion.

  • Default document: ../sch/result.sch.xml

Output Ports

NameDocumentationConnections

result

insert-xpath

report

schema

zip-manifest

Options

NameDocumentationDefault

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'

'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

StepInputsOutputsOptions

docx2hub:single-tree single-tree

source

source on docx2hub

xslt

xslt on docx2hub

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

source

result on separate-field-functions

schema

field-functions-schematron on docx2hub

parameters

p:empty

result

assert-valid = 'false'

p:sink d47e328

source

result on check-field-functions0

p:add-attribute d47e329

source

report on check-field-functions0

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.

source

result on d47e329

result

match = '/*'

attribute-name = 'tr:rule-family'

attribute-value = 'docx2hub_field-functions'

p:sink d47e341

source

result on check-field-functions

p:add-attribute d47e342

source

field-functions-schematron on docx2hub

result

match = '/*'

attribute-name = 'tr:step-name'

attribute-value = 'docx2hub'

p:add-attribute decorate-field-functions-schematron

source

result on d47e342

result

match = '/*'

attribute-name = 'tr:rule-family'

attribute-value = 'docx2hub'

p:sink d47e351

source

result on decorate-field-functions-schematron

tr:xslt-mode d47e353

source

result on separate-field-functions

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

parameters

params on single-tree

stylesheet

xslt on docx2hub

models

p:empty

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

source

result on d47e396

result

match = '/*'

attribute-name = 'xml:base'

attribute-value = replace(/c:param-set/c:param[@name='local-href']/@value, '\.do[ct][xm]$', '.hub.xml')

tr:prepend-hub-xml-model pi

source

result on rebase

result

hub-version = $hub-version

p:validate-with-schematron check-result0

source

result on pi

schema

result-schematron on docx2hub

parameters

p:empty

result

assert-valid = 'false'

p:sink d47e450

source

result on check-result0

p:add-attribute check-result

source

report on check-result0

result

match = '/*'

attribute-name = 'tr:rule-family'

attribute-value = 'docx2hub_result'

p:sink d47e458

source

result on check-result

p:add-attribute decorate-result-schematron

source

result-schematron on docx2hub

result

match = '/*'

attribute-name = 'tr:rule-family'

attribute-value = 'docx2hub'

p:sink d47e466

source

result on decorate-result-schematron

p:identity d47e467

source

result on pi

result