Plug-ins may do a number of things, such as adding support for specialized DTDs or Schemas,
integrating processing overrides, or providing entirely new output transforms. Extensions
are integrated using a file named
The root element of the plugin.xml file is
The
Any extension that is not recognized by the DITA-OT is ignored; all elements other than
The XML Catalogs extension point is used to update the XML Catalogs used to resolve DTD or Schema document types, or to add URI mappings. To do this, first create a catalog with only your new values, using the OASIS Catalog format, and place that in your plugin.
Adds the content of the catalog file defined in
Adds the content of the catalog file defined in
The Ant conductor extension point is used to make new targets available to Ant processing.
Add Ant import to main Ant build file.
To do this, first place your extensions in an Ant project file within your plugin, such
as myAntStuff.xml. Create a small wrapper file
Then create the following feature:
There are extension points to execute an Ant target before or after all preprocessing.
In addition, there are extension points to execute an Ant target before a given preprocessing step.
The following feature adds "myAntTargetBeforeChunk" Ant target to be executed before the chunk step in preprocessing:
The transtype extension point is used to define a new "transtype", or transform type, which makes use of targets in your Ant extensions.
The XSLT import extension points are used to override various steps of XSLT processing. For this, the extension attribute indicates the step that the override applies to; the value attribute is a relative path to the override within the current plugin; the type attribute should be set to "file". The plugin installer will add an XSL import statement to the default code, so that your override becomes a part of the normal build. The following XSLT steps are available to override in the core toolkit:
The generated text extension point is used to add new strings to the default set of Generated Text.
Copy the file
Use the following extension code to include your strings in the set of generated text:
The string is now available to the XSLT "getString" template.
You can pass parameters from the Ant build to XSLT pipeline stages, usually to have those parameters avalable as global <xsl:param> values in your XSLT overrides. Create a file insertParameters.xml which contains one or more Ant <param> elements:
Pass the value using the following extensions:
If your Ant or XSLT extensions require additional Java libraries in the classpath, you can add them to the global Ant classpath.
Plug-in specific warning and error messages can be added to the set of messages supplied by DITA-OT.
To add your own messages, create the message in an XML file
And incorporate them with the extension:
The
Prerequisite plugins are integrated before the current plugin is integrated. This does the
right thing with respect to XSLT overrides. If your plugin is a specialization of a
specialization, it should
If a prerequisite plugin is missing, a warning will be printed during integration. To
suppress this, but keep the integration order if both plugins are present, add
If your plugin can depend on any one of several optional plugins, separate the plugin ids with a vertical bar. This is most useful when combined with importance="optional":
The following extension points are used by convention to define version and support info within a plugin:
The toolkit does not currently do anything with these values, but may do so in the future.
The
The default value is
If your plugin needs to define its own extension point in an XML file, add the string
"
The following is a sample of a plugin.xml file. This file adds support for a new set of
specialized DTDs, and includes an override for the XHTML output processor. It would go into
a directory such as