code-srv-test/dita-ot-3.6/docsrc/extension-points/plugin-extension-points-xslt-import.dita
2021-03-23 22:38:58 +00:00

189 lines
8.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
<reference id="plugin-extension-points-xslt-import">
<title>XSLT-import extension points</title>
<shortdesc>You can use these extension points to override XSLT processing steps in pre-processing and certain
transformation types. The value of the <xmlatt>file</xmlatt> attribute in the <xmlelement>feature</xmlelement>
element specifies a relative path to an XSL file in the current plug-in. The plug-in installer adds a XSL import
statement to the default DITA-OT code, so that the XSL override becomes part of the normal build.</shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm><xmlelement>xref</xmlelement></indexterm>
<indexterm><xmlatt>file</xmlatt></indexterm>
<indexterm>XSLT
<indexterm>extension points</indexterm></indexterm>
<indexterm>extension points
<indexterm>XSLT</indexterm></indexterm>
<indexterm>preprocessing
<indexterm>extension points, XSLT</indexterm></indexterm>
</keywords>
</metadata>
</prolog>
<refbody>
<section>
<title>Pre-processing</title>
<p>You can use the following extension points to add XSLT processing to modules in the pre-processing
pipeline:</p>
<dl>
<dlentry>
<dt><parmname>dita.xsl.conref</parmname></dt>
<dd>Overrides the pre-processing step that resolves conref.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.maplink</parmname></dt>
<dd>Overrides the <codeph>maplink</codeph> step in the pre-processing pipeline. This is the step that
generates map-based links.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.mappull</parmname></dt>
<dd>Overrides the <codeph>mappull</codeph> step in the pre-processing pipeline. This is the step that updates
navigation titles in maps and causes attributes to cascade.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.mapref</parmname></dt>
<dd>Overrides the <codeph>mapref</codeph> step in the pre-processing pipeline. This is the step that resolves
references to other maps.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.topicpull</parmname></dt>
<dd>Overrides the <codeph>topicpull</codeph> step in the pre-processing pipeline. This is the step that pulls
text into <xmlelement>xref</xmlelement> elements, as well as performing other tasks.</dd>
</dlentry>
</dl>
</section>
<section>
<title>Transformations</title>
<p>You can use the following extension points to add XSLT processing to modules in DITA-OT transformations:</p>
<dl>
<dlentry>
<dt><parmname>dita.map.eclipse.index.pre</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.map.eclipse.index.pre.desc"
>Runs an Ant target before the Eclipse index extraction process.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.eclipse.plugin</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.xsl.eclipse.plugin.desc"
>Overrides the default XSLT step that generates the <filepath>plugin.xml</filepath> file for Eclipse
Help.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.eclipse.toc</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.xsl.eclipse.toc.desc"
>Overrides the default XSLT step that generates the Eclipse Help table of contents (TOC).</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.html.cover</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.html.cover.desc"
>Overrides the
default HTML cover page generation process.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.htmltoc</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.htmltoc.desc"
>Overrides the
default XSLT step that generates the HTML table of contents (TOC).</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.html5</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.desc"
>Overrides the
default HTML5 transformation. The referenced file is integrated directly into the XSLT step that generates
HTML5.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.html5.cover</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.cover.desc"
>Overrides the
default HTML5 cover page generation process.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.html5.toc</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.toc.desc"
>Overrides the
default XSLT step that generates the HTML5 table of contents (TOC).</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.htmlhelp.map2hhc</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.htmlhelp.dita#org.dita.htmlhelp-ext/dita.xsl.htmlhelp.map2hhc.desc"
>Overrides the default XSLT step that generates the HTML Help contents (<filepath>.hhc</filepath>)
file.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.htmlhelp.map2hhp</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.htmlhelp.dita#org.dita.htmlhelp-ext/dita.xsl.htmlhelp.map2hhp.desc"
>Overrides the default XSLT step that generates the HTML Help project (<filepath>.hhp</filepath>) file.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.xhtml</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.xhtml.desc"
>Overrides the
default HTML or XHTML transformation, including HTML Help and Eclipse Help. The referenced file is
integrated directly into the XSLT step that generates XHTML.</dd>
</dlentry>
<dlentry>
<dt><parmname>dita.xsl.xslfo</parmname></dt>
<dd
conaction="pushreplace"
conref="extension-points-in-org.dita.pdf2.dita#org.dita.pdf2-ext/dita.xsl.xslfo.desc"
>Overrides the default
PDF transformation. The referenced XSL file is integrated directly into the XSLT step that generates the
XSL-FO.</dd>
</dlentry>
</dl>
</section>
<example>
<title>Example</title>
<p>The following two files represent a complete (albeit simple) plug-in that adds a company banner to the XHTML
output. The <filepath>plugin.xml</filepath> file declares an XSLT file that extends the XHTML processing; the
<filepath>xsl/header.xsl</filepath> file overrides the default header processing to provide a company
banner.</p>
<fig>
<title>Contents of the <filepath>plugin.xml</filepath> file</title>
<codeblock
outputclass="language-xml normalize-space show-line-numbers show-whitespace"
>&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;plugin id="com.example.brandheader">
&lt;feature extension="dita.xsl.xhtml" file="xsl/header.xsl"/>
&lt;/plugin></codeblock>
</fig>
<fig>
<title>Contents of the <filepath>xsl/header.xsl</filepath> file</title>
<codeblock
outputclass="language-xml normalize-space show-line-numbers show-whitespace"
>&lt;?xml version="1.0" encoding="UTF-8"?>
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
&lt;xsl:template name="gen-user-header">
&lt;div>
&lt;img src="http://www.example.com/company_banner.jpg"
alt="Example Company Banner"/>
&lt;/div>
&lt;/xsl:template>
&lt;/xsl:stylesheet></codeblock>
</fig>
</example>
</refbody>
</reference>