Search code examples
dita

In Oxygen XML Editor, can I automatically xcopy a folder to my Transformation's output folder?


I am using version 21 of the Oxygen XML Editor and the DITA Map WebHelp Classic (deprecated) Transformation Scenario. I have a folder that contains HTML files I want to open in a new window/tab, so that are xref'd in my XML file such as:

[<b><xref href="External/aFile.html" format="html" scope="external">Some Text</xref></b>]

I have a PostProcess batch script that I manually run that does an xcopy of the External folder to Oxygen's out/webhelp folder, and I would like to instead run it automatically in Oxygen after the Transformation is done. Is there I way I can do this?


Solution

  • Two ways:

    1) Use your custom ANT build file in the Oxygen transformation scenario: To use a custom build file in a DITA-OT transformation, follow these steps:

    • Use the Configure Transformation Scenario(s) action to open the Configure Transformation Scenario(s) dialog box.
    • Select the transformation scenario and click Edit.
    • Go to the Advanced tab and change the Custom build file path to point to the custom build file.

    As an example, if you want to call a custom script before running the DITA OT, your custom build file would have the following content:

    <project basedir="." default="dist">
    <!--The DITA OT default build file-->
     <import file="path/to/DITA-OT3.x/build.xml"/>
     <target name="dist">
       <!--Call the DITA OT default target-->
       <antcall target="init"/>
      <!-- You could run your script here -->
      <!--<copy></copy>-->
     </target>
    </project>
    

    2) Create your own DITA Open Toolkit plugin which adds a new transformation type with a custom ANT build file which calls the WebHelp transformation type and afterwards can perform the copy operation:

    https://www.oxygenxml.com/doc/versions/21.1/ug-editor/topics/whr-xslt-customization.html