Search code examples
xmlxsltpluginsantdita

Creating custom Dita plugin for Oxygen Author


I need to create a custom plugin that takes a dita file and converts it into a txt file. The issue i'm having is how do i get the contents that my XSLT generates from the dita map and push it to the ant file that creates the txt file. This thinking process can be wrong. If so how is this done normally. Could anyone push me in the right direction?

Thanks in advance!


Solution

  • There is an open source plugin for converting DITA topics to plain text:

    https://github.com/jelovirt/dita-ot-plugins/tree/master/com.github.dita-ot-plugins.plaintext

    but the plugin was tested and properly works only with the older DITA OT 1.8. But it could be helpful for you as a starting point. You can create your own XSLT stylesheet which gets applied over each topic to generate the text.

    If you want to generate a single text file from the entire DITA Map contents, you can look at how this open source plugin creates a single merged XML document from the entire DITA Map contents:

    https://github.com/oxygenxml/dita-merged

    After the merged file is created you can create and apply your own XSLT processing on the merged XML file to produce the text document.

    I'm also linking to your original post on the Oxygen XML Forum: https://www.oxygenxml.com/forum/viewtopic.php?f=20&t=14773&p=43577#p43570

    You did not say anything about your use case. For example there is also a popular DITA OT 2.x plugin for converting DITA content to Markdown:

    https://github.com/jelovirt/dita-ot-markdown