Generating DITA From Within OxygenXML

You can transform Word documents from within OxygenXML without using the Open Toolkit

OxygenXML has two handy features that make transforming Word documents into DITA convenient, especially as you are defining the style-to-tag mapping or implementing custom XSLT extensions:
  • OxygenXML can open Zip archives in its Archive Browser. As DOCX files are just Zip archives, it means you can open Word DOCX files in Oxygen and get to the individual files inside very easily.
  • OxygenXML can run XSLT transforms and, in particular, can run them against files within Zip packages.

In addition, you can use Oxygen's built-in Open Toolkit to manage resolution of the XSD schema for style-to-tag mapping documents simply by deploying the DITA for Publisher's Toolkit plugins to Oxygen's Toolkit instance (see Installing the Toolkit Plugins).

You can use Oxygen's normal Toolkit transformation scenario to run transforms against Word documents. Simply set the transtype Ant parameter to "word2dita" and specify the Word document as the input file.

You can also transform Word documents directly in Oxygen, which is handy for testing and development of your style-to-tag mapping.

To run the transform in Oxygen, do the following:
  1. Open the DOCX file you want to transform in Oxygen's Archive Browser
  2. Navigate to the file word/document.xml within Archive Browser and open it in the editor (double click on the filename).

    All Word documents have a file named document.xml, which contains all the paragraph content for the document. This file is the input to actual Word-to-DITA transform.

  3. Open the file org.dita4publishers.word2dita/xsl/docx2dita.xsl from the Toolkit plugin, either as deployed to your Toolkit or from the DITA for Publishers distribution package (the transform has no dependencies on any other Toolkit components so you can run it standalone).
  4. From the docx2dita.xsl file, select the Configure Transformation Scenario button from the Toolbar and select New to create a new transformation scenario.
  5. For the XML file select the document.xml file you opened from the DOCX archive.
  6. Select the Parameters button to open the Parameters dialog and set the following parameters:
    The URI of the output directory to hold the generated files.
    The URI of the style-to-tag map document to use for the transform.
  7. Save the scenario and select Transform now to run the transform.

You should get some output. Use Oxygen's File->Open dialog to open the generated file (map or topic).

You can now rerun the transform at will and see the updated files in the editor.