plugin-extension-points-xslt-import.dita 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN" "reference.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <reference id="plugin-extension-points-xslt-import">
  5. <title>XSLT-import extension points</title>
  6. <shortdesc>You can use these extension points to override XSLT processing steps in pre-processing and certain
  7. transformation types. The value of the <xmlatt>file</xmlatt> attribute in the <xmlelement>feature</xmlelement>
  8. element specifies a relative path to an XSL file in the current plug-in. The plug-in installer adds a XSL import
  9. statement to the default DITA-OT code, so that the XSL override becomes part of the normal build.</shortdesc>
  10. <prolog>
  11. <metadata>
  12. <keywords>
  13. <indexterm><xmlelement>xref</xmlelement></indexterm>
  14. <indexterm><xmlatt>file</xmlatt></indexterm>
  15. <indexterm>XSLT<indexterm>extension points</indexterm></indexterm>
  16. <indexterm>extension points<indexterm>XSLT</indexterm></indexterm>
  17. <indexterm>preprocessing<indexterm>extension points, XSLT</indexterm></indexterm>
  18. </keywords>
  19. </metadata>
  20. </prolog>
  21. <refbody>
  22. <section>
  23. <title>Pre-processing</title>
  24. <p>You can use the following extension points to add XSLT processing to modules in the pre-processing
  25. pipeline:</p>
  26. <dl>
  27. <dlentry>
  28. <dt><parmname>dita.xsl.conref</parmname></dt>
  29. <dd>Overrides the pre-processing step that resolves conref.</dd>
  30. </dlentry>
  31. <dlentry>
  32. <dt><parmname>dita.xsl.maplink</parmname></dt>
  33. <dd>Overrides the <codeph>maplink</codeph> step in the pre-processing pipeline. This is the step that
  34. generates map-based links.</dd>
  35. </dlentry>
  36. <dlentry>
  37. <dt><parmname>dita.xsl.mappull</parmname></dt>
  38. <dd>Overrides the <codeph>mappull</codeph> step in the pre-processing pipeline. This is the step that updates
  39. navigation titles in maps and causes attributes to cascade.</dd>
  40. </dlentry>
  41. <dlentry>
  42. <dt><parmname>dita.xsl.mapref</parmname></dt>
  43. <dd>Overrides the <codeph>mapref</codeph> step in the pre-processing pipeline. This is the step that resolves
  44. references to other maps.</dd>
  45. </dlentry>
  46. <dlentry>
  47. <dt><parmname>dita.xsl.topicpull</parmname></dt>
  48. <dd>Overrides the <codeph>topicpull</codeph> step in the pre-processing pipeline. This is the step that pulls
  49. text into <xmlelement>xref</xmlelement> elements, as well as performing other tasks.</dd>
  50. </dlentry>
  51. </dl>
  52. </section>
  53. <section>
  54. <title>Transformations</title>
  55. <p>You can use the following extension points to add XSLT processing to modules in DITA-OT transformations:</p>
  56. <dl>
  57. <dlentry>
  58. <dt><parmname>dita.map.eclipse.index.pre</parmname></dt>
  59. <dd conaction="pushreplace"
  60. conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.map.eclipse.index.pre.desc"
  61. >Runs an Ant target before the Eclipse index extraction process.</dd>
  62. </dlentry>
  63. <dlentry>
  64. <dt><parmname>dita.xsl.eclipse.plugin</parmname></dt>
  65. <dd conaction="pushreplace"
  66. conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.xsl.eclipse.plugin.desc"
  67. >Overrides the default XSLT step that generates the <filepath>plugin.xml</filepath> file for Eclipse
  68. Help.</dd>
  69. </dlentry>
  70. <dlentry>
  71. <dt><parmname>dita.xsl.eclipse.toc</parmname></dt>
  72. <dd conaction="pushreplace"
  73. conref="extension-points-in-org.dita.eclipsehelp.dita#org.dita.eclipsehelp-ext/dita.xsl.eclipse.toc.desc"
  74. >Overrides the default XSLT step that generates the Eclipse Help table of contents (TOC).</dd>
  75. </dlentry>
  76. <dlentry>
  77. <dt><parmname>dita.xsl.html.cover</parmname></dt>
  78. <dd conaction="pushreplace"
  79. conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.html.cover.desc">Overrides the
  80. default HTML cover page generation process.</dd>
  81. </dlentry>
  82. <dlentry>
  83. <dt><parmname>dita.xsl.htmltoc</parmname></dt>
  84. <dd conaction="pushreplace"
  85. conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.htmltoc.desc">Overrides the
  86. default XSLT step that generates the HTML table of contents (TOC).</dd>
  87. </dlentry>
  88. <dlentry>
  89. <dt><parmname>dita.xsl.html5</parmname></dt>
  90. <dd conaction="pushreplace"
  91. conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.desc">Overrides the
  92. default HTML5 transformation. The referenced file is integrated directly into the XSLT step that generates
  93. HTML5.</dd>
  94. </dlentry>
  95. <dlentry>
  96. <dt><parmname>dita.xsl.html5.cover</parmname></dt>
  97. <dd conaction="pushreplace"
  98. conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.cover.desc">Overrides the
  99. default HTML5 cover page generation process.</dd>
  100. </dlentry>
  101. <dlentry>
  102. <dt><parmname>dita.xsl.html5.toc</parmname></dt>
  103. <dd conaction="pushreplace"
  104. conref="extension-points-in-org.dita.html5.dita#org.dita.html5-ext/dita.xsl.html5.toc.desc">Overrides the
  105. default XSLT step that generates the HTML5 table of contents (TOC).</dd>
  106. </dlentry>
  107. <dlentry>
  108. <dt><parmname>dita.xsl.htmlhelp.map2hhc</parmname></dt>
  109. <dd conaction="pushreplace"
  110. conref="extension-points-in-org.dita.htmlhelp.dita#org.dita.htmlhelp-ext/dita.xsl.htmlhelp.map2hhc.desc"
  111. >Overrides the default XSLT step that generates the HTML Help contents (<filepath>.hhc</filepath>)
  112. file.</dd>
  113. </dlentry>
  114. <dlentry>
  115. <dt><parmname>dita.xsl.htmlhelp.map2hhp</parmname></dt>
  116. <dd conaction="pushreplace"
  117. conref="extension-points-in-org.dita.htmlhelp.dita#org.dita.htmlhelp-ext/dita.xsl.htmlhelp.map2hhp.desc"
  118. >Overrides the default XSLT step that generates the HTML Help project (<filepath>.hhp</filepath>) file.</dd>
  119. </dlentry>
  120. <dlentry>
  121. <dt><parmname>dita.xsl.troff-ast</parmname></dt>
  122. <dd conaction="pushreplace"
  123. conref="extension-points-in-org.dita.troff.dita#org.dita.troff-ext/dita.xsl.troff-ast.desc">Overrides the
  124. intermediate block-and-phrase format that is generated as input to troff processing.</dd>
  125. </dlentry>
  126. <dlentry>
  127. <dt><parmname>dita.xsl.troff</parmname></dt>
  128. <dd conaction="pushreplace"
  129. conref="extension-points-in-org.dita.troff.dita#org.dita.troff-ext/dita.xsl.troff.desc">Overrides the XSL
  130. that converts block-and-phrase intermediate markup into troff.</dd>
  131. </dlentry>
  132. <dlentry>
  133. <dt><parmname>dita.xsl.xhtml</parmname></dt>
  134. <dd conaction="pushreplace"
  135. conref="extension-points-in-org.dita.xhtml.dita#org.dita.xhtml-ext/dita.xsl.xhtml.desc">Overrides the
  136. default HTML or XHTML transformation, including HTML Help and Eclipse Help. The referenced file is
  137. integrated directly into the XSLT step that generates XHTML.</dd>
  138. </dlentry>
  139. <dlentry>
  140. <dt><parmname>dita.xsl.xslfo</parmname></dt>
  141. <dd conaction="pushreplace"
  142. conref="extension-points-in-org.dita.pdf2.dita#org.dita.pdf2-ext/dita.xsl.xslfo.desc">Overrides the default
  143. PDF transformation. The referenced XSL file is integrated directly into the XSLT step that generates the
  144. XSL-FO.</dd>
  145. </dlentry>
  146. </dl>
  147. </section>
  148. <example>
  149. <title>Example</title>
  150. <p>The following two files represent a complete (albeit simple) plug-in that adds a company banner to the XHTML
  151. output. The <filepath>plugin.xml</filepath> file declares an XSLT file that extends the XHTML processing; the
  152. <filepath>xsl/header.xsl</filepath> file overrides the default header processing to provide a company
  153. banner.</p>
  154. <fig>
  155. <title>Contents of the <filepath>plugin.xml</filepath> file</title>
  156. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;?xml version="1.0" encoding="UTF-8"?>
  157. &lt;plugin id="com.example.brandheader">
  158. &lt;feature extension="dita.xsl.xhtml" file="xsl/header.xsl"/>
  159. &lt;/plugin></codeblock>
  160. </fig>
  161. <fig>
  162. <title>Contents of the <filepath>xsl/header.xsl</filepath> file</title>
  163. <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace">&lt;?xml version="1.0" encoding="UTF-8"?>
  164. &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  165. &lt;xsl:template name="gen-user-header">
  166. &lt;div>
  167. &lt;img src="http://www.example.com/company_banner.jpg"
  168. alt="Example Company Banner"/>
  169. &lt;/div>
  170. &lt;/xsl:template>
  171. &lt;/xsl:stylesheet></codeblock>
  172. </fig>
  173. </example>
  174. </refbody>
  175. </reference>