Presentation material for DITABUG / DITA RTP, December 7 2011
NOTE: while this material remains here as an archive, for the latest sample plug-ins, please check the new toolkit samples page.
The following plug-ins may prove useful starting points when trying to make use
of the DITA-OT plug-in extension points described in the presentation. Each of the plug-ins
should be unzipped into the DITA-OT/demo/ directory, though they could just as easily
be placed in the DITA-OT/plugins/ directory.
If you don't have it already, the DITA-OT can be found here:
http://sourceforge.net/projects/dita-ot/
The presentation that went along with these samples is now posted at dita.xml.org: Overriding the DITA Open Toolkit with Plug-ins
Documentation for the extension points can be found here: DITA-OT landing page. Look in
the documentation for release 1.5.4 or later, under Developer Reference -> Creating DITA-OT plug-ins.
Overview of available samples; details are below the table
| Plug-in ID |
What does it extend? |
| XHTML style |
PDF style |
New XSLT parameter |
XML Catalog (Specialization) |
New Ant code |
Extend Ant pre-process |
New transform type |
Add generated text |
Add error messages |
Add Java library |
New extension point |
Builds on pre-requisite |
| org.metadita.xsl.xhtmlbrand |
Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- |
| org.metadita.specialization.cmdref |
Yes | -- | -- | Yes | -- | -- | -- | -- | -- | -- | -- | -- |
| Music |
Yes | Yes | -- | Yes | -- | -- | -- | -- | -- | -- | -- | -- |
| org.metadita.transtype.faketxt |
-- | -- | -- | -- | Yes | -- | Yes | -- | -- | -- | -- | -- |
| org.metadita.xslparam |
Yes | -- | Yes | -- | Yes | -- | -- | -- | -- | -- | -- | -- |
| org.metadita.strings |
-- | -- | -- | -- | -- | -- | -- | Yes | -- | -- | -- | -- |
| org.metadita.strings |
-- | -- | -- | -- | -- | -- | -- | Yes | -- | -- | -- | -- |
| org.metadita.xsl.puffinbrand |
Yes | -- | -- | -- | -- | -- | -- | -- | -- | -- | -- | strings |
| org.metadita.bundle-gentext (zip file) |
Bundles org.metadita.strings and org.metadita.xsl.puffinbrand into a single install package. |
| org.metadita.errors |
-- | -- | -- | -- | -- | -- | -- | -- | Yes | -- | -- | -- |
| org.metadita.xsl.validation |
-- | -- | -- | -- | -- | -- | -- | -- | Yes | -- | -- | errors |
| org.metadita.run.validation |
-- | -- | -- | -- | Yes | Yes | -- | -- | Yes | -- | -- | errors; xsl.validation |
| org.metadita.bundle-validation (zip file) |
Bundles org.metadita.errors, org.metadita.xsl.validation, and org.metadita.run.validation into a single install package. |
| org.metadita.samplejava |
-- | -- | -- | -- | Yes | Yes | -- | -- | Yes | Yes | -- | -- |
| org.metadita.fullbundle (zip file) |
Bundles all of the previous plug-ins into a single install package. |
- org.metadita.xsl.xhtmlbrand.zip:
Sample XHTML Branding plug-in; overrides the XHTML transform to add a
Puffin image to the top of every output file.
- org.metadita.specialization.cmdref.zip:
Sample specialization plug-in; also includes very simple corresponding XHTML XSLT override.
- Music plug-in:
Plug-in to integrate a more complex specialization, override XHTML XSLT, and override PDF XSLT code:
Use the latest version of the music plug-in. It includes support for a specialization of reference topics,
primarily a specialized simpletable with columns for artist name, album, and related info. It also includes
XHTML and PDF overrides that add default headers to the tables.
- org.metadita.transtype.faketxt.zip:
Sample new transform; defines "faketxt" transform type, with XSLT processing to create fake text
output (basically, just concatenates the content of all topics as a single text file).
- org.metadita.xslparam.zip:
Sample "new XSLT parameter" plug-in; defines a new parameter $DAY that is passed in to XHTML processing. Default value is WEDNESDAY;
builds may change this by setting the Ant parameter ${org.metadita.xslparam.day} to something else. When $DAY='WEDNESDAY'
is passed to the XHTML process, the included XSLT override causes all text to come out in reverse.
NOTE: the default with this plug-in is for DAY=WEDNESDAY. It does not actually
set the current day dynamically. If you set ${org.metadita.xslparam.day} to anything else in your Ant build file,
the output will be normal; if you set that to WEDNESDAY, or leave it unspecified, the output is reversed.
- Set of two plug-ins that build on each other:
- org.metadita.strings.zip:
Plug-in that defines new strings for XSLT processing; specifically, it translates
the string "Puffin" to English, Russian, Swedish, and Icelandic.
- org.metadita.xsl.puffinbrand.zip:
Plug-in that overrides XHTML to create a footer; the footer retrieves the string "Puffin"
from the definitions in the previous plug-in. This plug-in will only be integrated if the
previous plug-in is also available.
- org.metadita.bundle-gentext.zip:
These plug-ins really work together, and can be distributed as a unit. Us this zip to install both at once.
- Set of three plug-ins that build on each other:
- org.metadita.errors.zip:
Defines two new error messages for user by XSLT code.
The first message is silly (warn when there are no links to topics about puffins). The second
message is a real-world sample, warning about topics that do not contain a short description.
- org.metadita.xsl.validation.zip:
This plug-in does not actually integrate into
anything; instead, it provides code that others may use, taking advantage of the previously
defined error messages. Often this code would be bundled with the plug-in that actually calls it,
except in cases where many plug-ins all want access to this validation code.
- org.metadita.run.validation.zip:
This plug-in hooks into the
Ant preprocess routine and adds a new dependency that will always run after the other pre-processing.
This new target runs the validation code supplied by the previous step.
- org.metadita.bundle-validation.zip:
These plug-ins really work together, and can be distributed as a unit. Use this zip to install all three at once.
- org.metadita.samplejava.zip:
Sample Java library integration. The new Java class is added to the OT's classpath (dost.class.path).
The code does nothing but put out a fake info message for the log (essentially, a Hello World program).
Ant code is then added which calls this new Java class before running the conref step; the new message
(for no real purpose) is also integrated in the message list.