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

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