62 lines
No EOL
8 KiB
HTML
62 lines
No EOL
8 KiB
HTML
<!DOCTYPE html
|
|
SYSTEM "about:legacy-compat">
|
|
<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 2020"><meta name="generator" content="DITA-OT"><meta name="description" content="Starting with DITA-OT 1.5.4, you can use the plugin:plugin-id URI extension and the ${dita.plugin.plugin-id.dir} Ant variable to reference the base path of another installed DITA-OT plug-in."><meta name="keywords" content=", xsl:import, xmlcatalog, xslt, plug-ins, using file in another plug-in, XSLT, using another plug-in, preprocessing, XSLT, catalog, referencing, CSS, HTML5, HTML5, CSS"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Referencing files from other plug-ins</title></head><body id="using-plugin-URI-extension"><header role="banner"><div class="header">
|
|
<p>DITA Open Toolkit</p>
|
|
<hr>
|
|
</div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.6</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/building-output.html">Building output</a></li><li><a href="../topics/input-formats.html">Authoring formats</a></li><li><a href="../topics/output-formats.html">Output formats</a></li><li><a href="../parameters/index.html">Parameters</a></li><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/adding-plugins.html">Adding plug-ins</a></li><li><a href="../topics/custom-plugins.html">Creating plug-ins</a><ul><li><a href="../topics/plugin-benefits.html">Plug-in benefits</a></li><li><a href="../topics/plugin-configfile.html">Plug-in descriptor file</a></li><li><a href="../topics/plugin-coding-conventions.html">Coding conventions</a></li><li><a href="../topics/plugin-dependencies.html">Plug-in dependencies</a><ul><li class="active"><a href="../topics/referencing-other-plugins.html">Referencing files from other plug-ins</a></li></ul></li><li><a href="../topics/plugin-use-cases.html">Plug-in use cases</a></li><li><a href="../topics/html-customization-plugins.html">Custom HTML plug-ins</a></li><li><a href="../topics/pdf-customization-plugins.html">Custom PDF plug-ins</a></li><li><a href="../topics/globalization.html">Globalizing DITA content</a></li><li><a href="../topics/migration.html">Migrating customizations</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">
|
|
<h1 class="title topictitle1" id="ariaid-title1">Referencing files from other plug-ins</h1>
|
|
|
|
|
|
<div class="body taskbody"><p class="shortdesc">Starting with DITA-OT 1.5.4, you can use the <span class="ph filepath" id="using-plugin-URI-extension__plugin-uri-ext">plugin:<var class="keyword varname">plugin-id</var></span> URI extension and the <span class="ph filepath" id="using-plugin-URI-extension__antvar">${dita.plugin.<var class="keyword varname">plugin-id</var>.dir}</span> Ant variable to reference the base path of another
|
|
installed DITA-OT plug-in.</p>
|
|
<section class="section">
|
|
<p class="p">Sometimes you need to reference content in another DITA-OT plug-in. However, the path to an installed plug-in
|
|
is not guaranteed to be the same between different installed instances of DITA-OT. The <span class="ph filepath">plugin:<var class="keyword varname">plugin-id</var></span> URI extension and <span class="ph filepath">${dita.plugin.<var class="keyword varname">plugin-id</var>.dir}</span> Ant variable are provided so your build and XSLT files always
|
|
use the correct path to the plug-in.</p>
|
|
<p class="p">Within a single plug-in, you can safely use relative path references, for example,
|
|
<span class="ph filepath">xsl/my.xsl</span> without specifying the path to the plug-in itself.</p>
|
|
</section>
|
|
<section><div class="tasklabel"><h2 class="sectiontitle tasklabel">Procedure</h2></div><ul class="ul steps-unordered"><li class="li step stepexpand">
|
|
<span class="ph cmd">Use <span class="ph filepath">${dita.plugin.<var class="keyword varname">plugin-id</var>.dir}</span> in Ant build files.</span>
|
|
<div class="itemgroup info">
|
|
<p class="p">Use the Ant variable <span class="ph filepath">${dita.plugin.<var class="keyword varname">plugin-id</var>.dir}</span> anywhere in your build file or
|
|
template to point to the base path of an installed DITA-OT plug-in.</p>
|
|
</div>
|
|
<div class="itemgroup stepxmp">
|
|
<p class="p">The following example copies CSS files from the HTML5 plug-in:</p>
|
|
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code><copy todir="${dita.temp.dir}/css">
|
|
<fileset dir="${dita.plugin.org.dita.html5.dir}/css"
|
|
includes="*.css"/>
|
|
</copy></code></pre>
|
|
</div>
|
|
</li><li class="li step stepexpand">
|
|
<span class="ph cmd">Use <span class="ph filepath">plugin:<var class="keyword varname">plugin-id</var></span> in XSLT files.</span>
|
|
<div class="itemgroup info">
|
|
<p class="p">Use the URI extension <span class="ph filepath">plugin:<var class="keyword varname">plugin-id</var></span> at the beginning of a
|
|
file reference—usually in <code class="keyword markupname xmlelement"><xsl:import></code>—to point to the base path of an installed
|
|
DITA-OT plug-in.</p>
|
|
</div>
|
|
<div class="itemgroup stepxmp">
|
|
<p class="p">The following example imports the base output-message.xsl processing:</p>
|
|
<pre class="pre codeblock language-xml"><code><xsl:import href="plugin:org.dita.base:xsl/common/output-message.xsl"/></code></pre>
|
|
</div>
|
|
<div class="itemgroup info">
|
|
<p class="p">To use the URI extension, your plug-in must reference the DITA-OT catalog file. In your Ant build file, add
|
|
an <code class="keyword markupname xmlelement"><xmlcatalog></code> element referencing the DITA-OT catalog file as a child of the
|
|
<code class="keyword markupname xmlelement"><xslt></code> element.</p>
|
|
</div>
|
|
<div class="itemgroup stepxmp">
|
|
<pre class="pre codeblock language-xml normalize-space show-line-numbers show-whitespace"><code><xslt style="xsl/my.xsl"
|
|
in="${dita.temp.dir}/input.file"
|
|
out="${dita.temp.dir}/output.file">
|
|
<xmlcatalog refid="dita.catalog"/>
|
|
</xslt></code></pre>
|
|
</div>
|
|
</li></ul></section>
|
|
<section class="section tasktroubleshooting">
|
|
<p class="p">For both of these methods, make sure you use the plug-in ID (defined in the <span class="ph filepath">plugin.xml</span>
|
|
file) rather than the folder name of the plug-in. In many cases, the folder name is not the same as the plug-in
|
|
ID.</p>
|
|
</section>
|
|
</div>
|
|
<nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../topics/plugin-dependencies.html" title="A DITA-OT plug-in can be dependent on other plug-ins. Prerequisite plug-ins are installed first, which ensures that DITA-OT handles XSLT overrides correctly.">Plug-in dependencies</a></div></div><div class="linklist relconcepts"><strong>Related concepts</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../topics/plugin-coding-conventions.html" title="To ensure custom plug-ins work well with the core toolkit code and remain compatible with future releases, the DITA Open Toolkit project recommends that plug-ins use modern development practices and common coding patterns.">Plug-in coding conventions</a></li></ul></div></nav></article></main></body></html> |