Diff for DITA-OT Plug-in Extension Points

Mon, 2009-04-06 03:20 by debbiepMon, 2009-04-06 03:21 by debbiep

Update to state in DITA-OT 1.4.3 (part 1)

Changes to Body
Line 8Line 8
 
<p>
 
<p>
 
Any extension that is not recognized by the DITA-OT is ignored; all elements other than &lt;plugin&gt; are optional.
 
Any extension that is not recognized by the DITA-OT is ignored; all elements other than &lt;plugin&gt; are optional.
  +
</p>
  +
<h2>XML catalogs <br />
  +
</h2>
  +
<p>
  +
The &lt;feature&gt; element may be used to update the XML Catalogs used to resolve DTD or Schema document types. To do this, first create a catalog with only your new values, using the OASIS Catalog format, and place that in your plugin. Next create a &lt;feature&gt; element, with the extension attribute set to &quot;dita.specialization.catalog.relative&quot;, the value attribute set to the name of your local catalog file, and the type attribute set to &quot;file&quot;. For example:
  +
</p>
  +
<pre>
  +
&lt;feature extension=&quot;dita.specialization.catalog.relative&quot; value=&quot;catalog-dita.xml&quot; type=&quot;file&quot; /&gt;
  +
</pre>
  +
<ul>
  +
</ul>
  +
<p>
  +
(Note that the <strong>dita.specialization.catalog</strong> extension is deprecated.  Use <strong>dita.specialization.catalog.relative</strong> instead.)
 
</p>
 
</p>
 
<ul>
 
<ul>
-
<li>The &lt;feature&gt; element may be used to update the XML Catalogs used to resolve DTD or Schema document types. To do this, first create a catalog with only your new values, using the OASIS Catalog format, and place that in your plugin. Next create a &lt;feature&gt; element, with the extension attribute set to &quot;dita.specialization.catalog.relative&quot;, the value attribute set to the name of your local catalog file, and the type attribute set to &quot;file&quot;. For example:
  
-
<pre>
  
-
&lt;feature extension=&quot;dita.specialization.catalog.relative&quot; value=&quot;catalog-dita.xml&quot; type=&quot;file&quot; /&gt;
  
-
</pre>
  
-
<ul>
  
-
</ul>
  
-
(Note that the <strong>dita.specialization.catalog</strong> extension is deprecated.  Use <strong>dita.specialization.catalog.relative</strong> instead.)
  
-
</li>
  
 
<li>The &lt;feature&gt; element may be used to make new targets available to Ant processing. To do this, first place your extensions in an Ant project file within your plugin, such as myAntStuff.xml. Create a small wrapper file myAntStuffWrapper.xml in the same directory:
 
<li>The &lt;feature&gt; element may be used to make new targets available to Ant processing. To do this, first place your extensions in an Ant project file within your plugin, such as myAntStuff.xml. Create a small wrapper file myAntStuffWrapper.xml in the same directory:
 
<pre>
 
<pre>
-
&lt;dummy&gt;
+
&lt;dummy&gt;
-
&lt;import file=&quot;myAntStuff.xml&quot;/&gt;<br />
+
&lt;import file=&quot;myAntStuff.xml&quot;/&gt;
 
&lt;/dummy&gt;
 
&lt;/dummy&gt;
 
</pre>
 
</pre>
Line 27Line 32
 
<br />
 
<br />
 
<pre>
 
<pre>
-
&lt;feature extension=&quot;dita.conductor.target.relative&quot; value=&quot;myAntStuffWrapper.xml&quot; type=&quot;file&quot; /&gt;
+
&lt;feature extension=&quot;dita.conductor.target.relative&quot; value=&quot;myAntStuffWrapper.xml&quot; type=&quot;file&quot; /&gt;
 
</pre>
 
</pre>
 
<ul>
 
<ul>
Line 35Line 40
 
<br />
 
<br />
 
<pre>
 
<pre>
-
&lt;feature extension=&quot;dita.conductor.transtype.check&quot; value=&quot;newtext&quot; type=&quot;txt&quot; /&gt;
+
&lt;feature extension=&quot;dita.conductor.transtype.check&quot; value=&quot;newtext&quot; type=&quot;txt&quot; /&gt;
 
</pre>
 
</pre>
 
<ul>
 
<ul>
Revision of Mon, 2009-04-06 03:21:

DITA-OT Plug-in Extension Points

Extension points for plug-ins to the DITA Open Toolkit

Extensions to the DITA Open Toolkit are supported through a plug-in extension mechanism. 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 with a file named plugin.xml, located in the plug-in's root directory. This document describes all recognized extension points in the plugin.xml file.

The root  element of the file is <plugin>, and must specify an id attribute. The id attribute is used to identify the plugin, as well as to identify whether pre-requisite plugins are available.

Any extension that is not recognized by the DITA-OT is ignored; all elements other than <plugin> are optional.

XML catalogs

The <feature> element may be used to update the XML Catalogs used to resolve DTD or Schema document types. To do this, first create a catalog with only your new values, using the OASIS Catalog format, and place that in your plugin. Next create a <feature> element, with the extension attribute set to "dita.specialization.catalog.relative", the value attribute set to the name of your local catalog file, and the type attribute set to "file". For example:

<feature extension="dita.specialization.catalog.relative" value="catalog-dita.xml" type="file" />

(Note that the dita.specialization.catalog extension is deprecated.  Use dita.specialization.catalog.relative instead.)

  • The <feature> element may be used to make new targets available to Ant processing. To do this, first place your extensions in an Ant project file within your plugin, such as myAntStuff.xml. Create a small wrapper file myAntStuffWrapper.xml in the same directory: <dummy> <import file="myAntStuff.xml"/> </dummy> Then create the following feature:
    <feature extension="dita.conductor.target.relative" value="myAntStuffWrapper.xml" type="file" />
    (Note that the dita.conductor.target extension is deprecated.  Use dita.conductor.target.relative instead.)
  • The <feature> element may be used to define a new "transtype", or transform type, which makes use of targets in your Ant extensions. The following feature defines a transform type of "newtext"; using this transform type will cause the build to look for a target dita2newtext, defined previously in your Ant extension:
    <feature extension="dita.conductor.transtype.check" value="newtext" type="txt" />
  • The <feature> element may be 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:
    • Override default XHTML output with the following: <feature extension="dita.xsl.xhtml" value="xsl/modifyXhtml.xsl" type="file"/>

    • Override default DocBook output with the following: <feature extension="dita.xsl.docbook" value="xsl/sample.xsl" type="file"/>

    • Override default RTF output with the following: <feature extension="dita.xsl.rtf" value="xsl/sample.xsl" type="file"/>
    • Override the step that generates plugin.xml for Eclipse with the following: <feature extension="dita.xsl.eclipse.plugin" value="xsl/sample.xsl" type="file"/>
    • Override conref processing: <feature extension="dita.xsl.conref" value="xsl/sample.xsl" type="file"/>
    • Override topicpull processing (the step that pulls text into <xref> elements, among other things): <feature extension="dita.xsl.topicpull" value="xsl/sample.xsl" type="file"/>
    • Override mapref processing (the step that resolves references to other maps): <feature extension="dita.xsl.mapref" value="xsl/sample.xsl" type="file"/>
    • Override mappull processing (the step that updates navtitles in maps and causes attributes to cascade): <feature extension="dita.xsl.mappull" value="xsl/sample.xsl" type="file"/>
    • Override maplink processing (the step that generates map-based links): <feature extension="dita.xsl.maplink" value="xsl/sample.xsl" type="file"/>
    • Override the (now deprecated) original PDF output with the following: <feature extension="dita.xsl.fo" value="xsl/modifyXhtml.xsl" type="file"/>
  • The <feature> element may be used to add new strings to the default set of Generated Text (more info coming).
  • The <require> element requires the plugin attribute. It is used to identify pre-requisite plug-ins. If the current plugin requires a plugin with id="plugin-id" before it can be installed, it would include the following:
    • <require plugin="plugin-id">
XML.org Focus Areas: BPEL | DITA | ebXML | IDtrust | OpenDocument | SAML | UBL | UDDI
OASIS sites: OASIS | Cover Pages | XML.org | AMQP | CGM Open | eGov | Emergency | IDtrust | LegalXML | Open CSA | OSLC | WS-I