Plug-in use cases
Plug-ins allow you to extend the functionality of DITA-OT. This might entail adding support for specialized
document types, integrating processing overrides, or defining new output transformations.
Setting parameters with plug-ins To ensure that output is always generated with the same settings, you can create a plug-in to define a new output format that automatically sets certain DITA-OT parameters.Adding a new target to the Ant build process As of DITA-OT 3.0, the ant.import
extension point can be used to make new targets available to the Ant processing pipeline. This can be done as part of creating a new transformation, extending pre-processing, or simply to make new Ant targets available to other plug-ins.Adding an Ant target to the pre-processing pipeline You can add an Ant target to the pre-processing pipeline. This enables you to insert additional processing before or after the pre-processing chain or a specific step in the pre-processing operation.Adding a new transformation type Plug-ins can add an entirely new transformation type. The new transformation type can be very simple, such as an HTML build that creates an additional control file; it also can be very complex, adding any number of new processing steps.Adding parameters to existing XSLT steps You can pass parameters from the Ant build to existing XSLT steps in both the pre-processing pipeline and certain DITA-OT transformations. This can be useful if you want to make the parameters available as global <xsl:param>
values within XSLT overrides.Overriding an XSLT-processing step You can override specific XSLT-processing steps in both the pre-processing pipeline and certain DITA-OT transformations.Adding a Java library to the classpath You can use the dita.conductor.lib.import
extension point to add an additional Java library to the DITA-OT classpath parameter.Adding new diagnostic messages Use the dita.xsl.messages
extension point to add plug-in-specific messages to the diagnostic messages that are generated by DITA-OT. These messages then can be used by any XSLT override.Creating a new plug-in extension point If your plug-in needs to define its own extension points in an XML file, add the string "_template
" to the filename before the file suffix. When the plug-in is installed, this file will be processed like the built-in DITA-OT templates.Extending an XML catalog file You can update either the main DITA-OT XML catalog or the XML catalog that is used by the PDF plug-in. This enables DITA-OT to support new specializations and document-type shells.Adjusting file names in map-first pre-processing To dynamically adjust the names and locations of output files in the map-first pre-processing routine (preprocess2
), you can create a custom plug-in and specify the code that contains your custom rewrite rules.Adding Saxon customizations Plug-ins can contribute XSLT extension functions and collation URI resolvers. These customizations are automatically configured to work with Saxon when transformations are run using the DITA-OT <pipeline>
task with custom XSLT.