Monday, October 20, 2008

How to perform your own transformation using DITA-OT

This task assumes that you have DITA-OT appropriate installed in your computer.

DITA-OT transform DITA XML documents to other formats. However, you can tranform any XML document from command line using the Xalan XSLT processor, which is included in the DITA-OT.

To do this:
  1. Have your own XSL stylesheet written and make sure it do what you expect with the XML source files they are designed to transform. You can try out using a browser.
  2. In the DITA-OT folder, click to run startcmd.bat, which automatically set the system environment variables for you.
  3. The command line for most standard transformations is as follows:
    java org.apache.xalan.xslt.Process -in xmlSource -xsl stylesheet -out outputfile


where xmlSource is the XML source file name, stylesheet is the XSL stylesheet file name, and outputfile is the output file name.


If you want the output to be displayed on the screen, simply omit the -out flag and argument

Note:If you are using an external DTD or Schema, you need to have it to be found by the processor. Or you can just delete it from the source file. Otherwise, the processor will complain that it can't find the DTD or Schema.

No comments: