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

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