Extending the DITA for Publishers Transformations

All the DITA for Publishers transformation plugins can be extended using normal Open Toolkit plugin extension techniques.

The DITA for Publishers plugins provide the following extension points for use by customizing plugins. See the DITA Open Toolkit documentation for general information about using plugin-provided extension points.

HTML2 Plugin

d4p.html2.xslt.param
Extension point for adding addition Ant <param> elements to the XSLT transformation process. Works the same way as the XHTML dita.conductor.xhtml.param extension point.
To use the extension point you create an XML file in your plugin with the <param> elements you want to add, e.g., insertParameters.xml:
<?xml version="1.0" encoding="UTF-8"?>
<dummy>
  <param name="paramNameinXSLT" expression="'some-param-value'"/>
</dummy>
In your plugin.xml file you bind the insertParameters.xml file to the d4p.html2.xslt.param parameter:
<plugin ...>
  ...
  <feature extension="d4p.html2.xslt.param" file="insertParameters.xml"/>
</plugin>
The HTML2 transform reports its parameters to the processing log. Your plugin can report its parameters by implementing a template in the mode "extension-report-parameters":
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  exclude-result-prefixes="xs"
  version="2.0">
  
  <xsl:param name="paramNameinXSLT" as="xs:string" select="'not-set'"/>
  
  <!-- Report our custom parameters: -->

  <xsl:template match="*" mode="extension-report-parameters">
    <xsl:message>      
      My Custom Parameters:
      
      paramNameinXSLT  = "<xsl:value-of select="$paramNameinXSLT"/>"
    </xsl:message>
  </xsl:template>
  
</xsl:stylesheet>

EPUB Plugin

d4p.epub.xslt.param
Extension point for adding addition Ant <param> elements to the XSLT transformation process. Works the same way as the XHTML dita.conductor.xhtml.param extension point. See the description of d4p.html2.xslt.param for usage details.

HTML5 Plugin

d4p.html5.xslt.param
Extension point for adding addition Ant <param> elements to the XSLT transformation process. Works the same way as the XHTML dita.conductor.xhtml.param extension point. See the description of d4p.html2.xslt.param for usage details.