Three transformations in one

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Posts: 5

Three transformations in one

Tue May 15, 2018 4:15 pm


I have a large number of docx files to transform to dita, however the docx to dita transformation is not giving me the result i was hoping for.
What i do instead is, transfrom the docx to TEI P5, then the TEI P5 to XHTML and finally the XHTML to DITA.
The procedure is longer but gives me the result i need( images are present, tables are respected...)
my question is : is there a way to automate these 3 transformations into one transformation ? could i put the three xslt sheets in one transformation ?
I would appreciate your help.
Thank you
Posts: 2424

Re: Three transformations in one

Wed May 16, 2018 4:03 pm


If they are all XSLT transformations, it is relatively simple to chain them together in a single XML transformation with XSLT scenario. You can press Additional XSLT stylesheets in the scenario configuration dialog and add there each of the stylesheets (in order).

However, for this particular chain of transformations the "DOCX TEI P5" is an ANT transformation. Oxygen does not implement pipelining of transformation scenarios, so you'll need to use other tricks.

1. If you have some knowledge of ANT, duplicate the ANT build file of the "DOCX TEI P5" transformation Oxygen\frameworks\tei\xml\tei\stylesheet\docx\build-from.xml and in the convert target add the other xslt transformations (see below the stylesheets) that process the output of the previous one.

2. You can create an additional XML transformation with XSLT scenario that runs all stylesheets (XHTML to DITA has two stylesheets):
XSL URL: ${frameworks}/tei/xml/tei/stylesheet/profiles/default/docx/from.xsl
In Additional XSLT stylesheets use in this order:
In Parameters you have to specify:
infotype=topic (or one of task, reference, concept). By default, if unspecified it's 'topic'.

And for the Output tab specify:
Save as: ${afd}/${afn}.dita
This scenario will only generate the dita file. If you need the images (or other resources) you'll have to also run the DOCX TEI P5 scenario.

Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
Posts: 5

Re: Three transformations in one

Wed May 16, 2018 4:57 pm

Thank you Adrian ! I tried the second option (since i have no Ant knowledge) and it's getting me a lot closer to what i need.
Hats off to you :)

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 0 guests