Adhering to certain development practices will properly isolate your code from that of DITA Open Toolkit. This will make it easier to you to upgrade to new versions of DITA-OT when they are released.
Use a properly-constructed DITA-OT plug-in.
Use a version control system to store your code.
Store the source code of your plug-ins outside of the DITA-OT installation directory, and add the
repository location to the list of plug-in directories defined in the
Never modify any of the core DITA-OT code.
Avoid copying entire DITA-OT files into your customization plug-in. When you only copy the attribute sets and templates that you need to override, there is less risk of impact from new features or fixes in the base code, making your code more stable and easier to upgrade between releases.
If you only need to change a few attribute sets and templates, you may prefer to store your overrides in
In cases that require substantial customizations, you may prefer to organize the files in a folder
structure that mimics the hierarchy of the default plug-in you are customizing. This facilitates comparisons
with the default settings in the base plug-in and makes it easier to migrate your changes to new toolkit
versions. See
Upgrade your customization plug-in to new versions of DITA-OT regularly. Do not wait through several major releases before upgrading.
For XSLT customizations, use a custom namespace for any modified template modes, template names, attribute sets, functions, and variables. This helps to clarify which portions of the code are specific to your customizations, and serves to isolate your changes in the event that items with the same name are added to the base plug-ins in the future.
For example, instead of creating a template named
Instead of:
use:
In Ant scripts, use the XSLT module from DITA-OT instead of Ant’s built-in
The XSLT module allows access to DITA-OT features like using the job configuration to select files in the temporary folder based on file metadata and custom XSLT extension functions.
Instead of:
use:
In Ant scripts, always refer to files in other plug-ins using the
Instead of:
use:
This fixes cases where plug-ins are installed to custom plug-in directories or the plug-in folder name doesn’t match the plug-in ID.
In XSLT, use the
Instead of:
use:
As with the plug-in directory property in Ant, this allows plug-ins to resolve to the correct directory even
when a plug-in moves to a new location. The plug-in is referenced using the syntax
In Ant scripts, use
For example, to select all images referenced by input DITA files, instead of:
use:
The