plugin-extension-points-xslt-import.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2019"><meta name="DC.rights.owner" content="(C) Copyright 2019"><meta name="DC.type" content="reference"><meta name="description" content="You can use these extension points to override XSLT processing steps in pre-processing and certain transformation types. The value of the file attribute in the feature 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."><meta name="DC.subject" content=", xref, file, XSLT, extension points, preprocessing, extension points, XSLT"><meta name="keywords" content=", xref, file, XSLT, extension points, preprocessing, extension points, XSLT"><meta name="DC.relation" scheme="URI" content="../extension-points/plugin-extension-points.html"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="plugin-extension-points-xslt-import"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>XSLT-import extension points</title></head><body id="plugin-extension-points-xslt-import"><header role="banner"><div class="header">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.3</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../topics/installing-client.html">Installing DITA-OT</a></li><li><a href="../topics/alternative-input-formats.html">Authoring formats</a></li><li><a href="../topics/building-output.html">Building output</a></li><li><a href="../parameters/index.html">Setting parameters</a></li><li><a href="../topics/customizing.html">Customizing DITA-OT</a><ul><li><a href="../topics/html-customization.html">Customizing HTML</a></li><li><a href="../topics/pdf-customization.html">Customizing PDF</a></li><li><a href="../topics/custom-plugins.html">Working with plug-ins</a></li><li><a href="../extension-points/plugin-extension-points.html">Extension points</a><ul><li><a href="../extension-points/all-extension-points.html">All extension points</a></li><li><a href="../extension-points/plugin-extension-points-general.html">General extension points</a></li><li><a href="../extension-points/plugin-extension-points-pre-processing.html">Pre-processing extension points</a></li><li class="active"><a href="../extension-points/plugin-extension-points-xslt-import.html">XSLT-import extension points</a></li><li><a href="../extension-points/plugin-extension-points-xslt-parameters.html">XSLT-parameter extension points</a></li><li><a href="../extension-points/plugin-extension-points-support.html">Version and support information</a></li><li><a href="../extension-points/extension-points-by-plugin.html">Plug-in extension points</a></li></ul></li><li><a href="../topics/migration.html">Migrating customizations</a></li><li><a href="../topics/globalization.html">Globalizing DITA content</a></li><li><a href="../topics/rebuilding-docs.html">Rebuilding documentation</a></li></ul></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a></li><li><a href="../reference/index.html">Reference</a></li><li><a href="../topics/dita-and-dita-ot-resources.html">Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
  7. <h1 class="title topictitle1" id="ariaid-title1">XSLT-import extension points</h1>
  8. <div class="body refbody"><p class="shortdesc">You can use these extension points to override XSLT processing steps in pre-processing and certain
  9. transformation types. The value of the <code class="keyword markupname xmlatt">@file</code> attribute in the <code class="keyword markupname xmlelement">&lt;feature&gt;</code>
  10. element specifies a relative path to an XSL file in the current plug-in. The plug-in installer adds a XSL import
  11. statement to the default DITA-OT code, so that the XSL override becomes part of the normal build.</p>
  12. <section class="section"><h2 class="title sectiontitle">Pre-processing</h2>
  13. <p class="p">You can use the following extension points to add XSLT processing to modules in the pre-processing
  14. pipeline:</p>
  15. <dl class="dl">
  16. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.conref</span></dt>
  17. <dd class="dd">Overrides the pre-processing step that resolves conref.</dd>
  18. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.maplink</span></dt>
  19. <dd class="dd">Overrides the <code class="ph codeph">maplink</code> step in the pre-processing pipeline. This is the step that
  20. generates map-based links.</dd>
  21. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.mappull</span></dt>
  22. <dd class="dd">Overrides the <code class="ph codeph">mappull</code> step in the pre-processing pipeline. This is the step that updates
  23. navigation titles in maps and causes attributes to cascade.</dd>
  24. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.mapref</span></dt>
  25. <dd class="dd">Overrides the <code class="ph codeph">mapref</code> step in the pre-processing pipeline. This is the step that resolves
  26. references to other maps.</dd>
  27. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.topicpull</span></dt>
  28. <dd class="dd">Overrides the <code class="ph codeph">topicpull</code> step in the pre-processing pipeline. This is the step that pulls
  29. text into <code class="keyword markupname xmlelement">&lt;xref&gt;</code> elements, as well as performing other tasks.</dd>
  30. </dl>
  31. </section>
  32. <section class="section"><h2 class="title sectiontitle">Transformations</h2>
  33. <p class="p">You can use the following extension points to add XSLT processing to modules in DITA-OT transformations:</p>
  34. <dl class="dl">
  35. <dt class="dt dlterm"><span class="keyword parmname">dita.map.eclipse.index.pre</span></dt>
  36. <dd class="dd">Runs an Ant target before the Eclipse index extraction process.</dd>
  37. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.eclipse.plugin</span></dt>
  38. <dd class="dd">Overrides the default XSLT step that generates the <span class="ph filepath">plugin.xml</span> file for Eclipse
  39. Help.</dd>
  40. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.eclipse.toc</span></dt>
  41. <dd class="dd">Overrides the default XSLT step that generates the Eclipse Help table of contents (TOC).</dd>
  42. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.html.cover</span></dt>
  43. <dd class="dd">Overrides the
  44. default HTML cover page generation process.</dd>
  45. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.htmltoc</span></dt>
  46. <dd class="dd">Overrides the
  47. default XSLT step that generates the HTML table of contents (TOC).</dd>
  48. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.html5</span></dt>
  49. <dd class="dd">Overrides the
  50. default HTML5 transformation. The referenced file is integrated directly into the XSLT step that generates
  51. HTML5.</dd>
  52. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.html5.cover</span></dt>
  53. <dd class="dd">Overrides the
  54. default HTML5 cover page generation process.</dd>
  55. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.html5.toc</span></dt>
  56. <dd class="dd">Overrides the
  57. default XSLT step that generates the HTML5 table of contents (TOC).</dd>
  58. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.htmlhelp.map2hhc</span></dt>
  59. <dd class="dd">Overrides the default XSLT step that generates the HTML Help contents (<span class="ph filepath">.hhc</span>)
  60. file.</dd>
  61. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.htmlhelp.map2hhp</span></dt>
  62. <dd class="dd">Overrides the default XSLT step that generates the HTML Help project (<span class="ph filepath">.hhp</span>) file.</dd>
  63. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.troff-ast</span></dt>
  64. <dd class="dd">Overrides the
  65. intermediate block-and-phrase format that is generated as input to troff processing.</dd>
  66. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.troff</span></dt>
  67. <dd class="dd">Overrides the XSL
  68. that converts block-and-phrase intermediate markup into troff.</dd>
  69. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.xhtml</span></dt>
  70. <dd class="dd">Overrides the
  71. default HTML or XHTML transformation, including HTML Help and Eclipse Help. The referenced file is
  72. integrated directly into the XSLT step that generates XHTML.</dd>
  73. <dt class="dt dlterm"><span class="keyword parmname">dita.xsl.xslfo</span></dt>
  74. <dd class="dd">Overrides the default
  75. PDF transformation. The referenced XSL file is integrated directly into the XSLT step that generates the
  76. XSL-FO.</dd>
  77. </dl>
  78. </section>
  79. <div class="example"><h2 class="title sectiontitle">Example</h2>
  80. <p class="p">The following two files represent a complete (albeit simple) plug-in that adds a company banner to the XHTML
  81. output. The <span class="ph filepath">plugin.xml</span> file declares an XSLT file that extends the XHTML processing; the
  82. <span class="ph filepath">xsl/header.xsl</span> file overrides the default header processing to provide a company
  83. banner.</p>
  84. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 1. </span>Contents of the <span class="ph filepath">plugin.xml</span> file</figcaption>
  85. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  86. &lt;plugin id="com.example.brandheader"&gt;
  87. &lt;feature extension="dita.xsl.xhtml" file="xsl/header.xsl"/&gt;
  88. &lt;/plugin&gt;</code></pre>
  89. </figure>
  90. <figure class="fig fignone"><figcaption><span class="fig--title-label">Figure 2. </span>Contents of the <span class="ph filepath">xsl/header.xsl</span> file</figcaption>
  91. <pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  92. &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  93. &lt;xsl:template name="gen-user-header"&gt;
  94. &lt;div&gt;
  95. &lt;img src="http://www.example.com/company_banner.jpg"
  96. alt="Example Company Banner"/&gt;
  97. &lt;/div&gt;
  98. &lt;/xsl:template&gt;
  99. &lt;/xsl:stylesheet&gt;</code></pre>
  100. </figure>
  101. </div>
  102. </div>
  103. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../extension-points/plugin-extension-points.html" title="DITA Open Toolkit provides a series of extension points that can be used to integrate changes into the core code. Extension points are defined in the plugin.xml file for each plug-in. When plug-ins are installed, DITA-OT makes each extension visible to the rest of the toolkit.">Extension points</a></div></div></nav></article></main></body></html>