Three transformations in one

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

Three transformations in one

Tue May 15, 2018 4:15 pm

Hello,

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
adrian
Posts: 2445

Re: Three transformations in one

Wed May 16, 2018 4:03 pm

Hi,

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.

Options:
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:
${frameworks}/tei/xml/tei/stylesheet/html/html.xsl
${frameworks}/xhtml/html2dita/preprocess.xsl
${frameworks}/xhtml/html2dita/h2d.xsl
In Parameters you have to specify:
word-directory=${cfdu}/..
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.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Tay
Posts: 13

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 1 guest