| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA General Task//EN" "generalTask.dtd">
- <task id="using-plugin-URI-extension">
- <title>Referencing files from other plug-ins</title>
- <shortdesc>Starting with DITA-OT 1.5.4, you can use the <filepath id="plugin-uri-ext"
- >plugin:<varname>plugin-id</varname></filepath> URI extension and the <filepath id="antvar"
- >${dita.plugin.<varname>plugin-id</varname>.dir}</filepath> Ant variable to reference the
- base path of another installed DITA-OT plug-in.</shortdesc>
- <prolog>
- <metadata>
- <keywords>
- <indexterm><xmlelement>xsl:import</xmlelement></indexterm>
- <indexterm><xmlelement>xmlcatalog</xmlelement></indexterm>
- <indexterm><xmlelement>xslt</xmlelement></indexterm>
- <indexterm>plug-ins<indexterm>using file in another plug-in</indexterm></indexterm>
- <indexterm>XSLT<indexterm>using another plug-in</indexterm></indexterm>
- <indexterm>preprocessing<indexterm>XSLT</indexterm></indexterm>
- <indexterm>catalog<indexterm>referencing</indexterm></indexterm>
- <indexterm>CSS<indexterm>HTML5</indexterm></indexterm>
- <indexterm>HTML5<indexterm>CSS</indexterm></indexterm>
- </keywords>
- </metadata>
- </prolog>
- <taskbody>
- <section>
- <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 <filepath
- conref="#using-plugin-URI-extension/plugin-uri-ext"/> URI extension and <filepath
- conref="#using-plugin-URI-extension/antvar"/> Ant variable are provided so your build and XSLT files always
- use the correct path to the plug-in.</p>
- <p>Within a single plug-in, you can safely use relative path references, for example,
- <filepath>xsl/my.xsl</filepath> without specifying the path to the plug-in itself.</p>
- </section>
- <steps-unordered>
- <step>
- <cmd>Use <filepath conref="#using-plugin-URI-extension/antvar"/> in Ant build files.</cmd>
- <info>
- <p>Use the Ant variable <filepath conref="#using-plugin-URI-extension/antvar"/> anywhere
- in your build file or template to point to the base path of an installed DITA-OT
- plug-in.</p>
- </info>
- <stepxmp>
- <p>The following example copies CSS files from the HTML5 plug-in:</p>
- <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace"><copy todir="${dita.temp.dir}/css">
- <fileset dir="${dita.plugin.org.dita.html5.dir}/css"
- includes="*.css"/>
- </copy></codeblock>
- </stepxmp>
- </step>
- <step>
- <cmd>Use <filepath conref="#using-plugin-URI-extension/plugin-uri-ext"/> in XSLT
- files.</cmd>
- <info>
- <p>Use the URI extension <filepath conref="#using-plugin-URI-extension/plugin-uri-ext"/>
- at the beginning of a file reference—usually in <xmlelement>xsl:import</xmlelement>—to
- point to the base path of an installed DITA-OT plug-in.</p>
- </info>
- <stepxmp>
- <p>The following example imports the base output-message.xsl processing:</p>
- <codeblock outputclass="language-xml"><xsl:import href="plugin:org.dita.base:xsl/common/output-message.xsl"/></codeblock>
- </stepxmp>
- <info>
- <p>To use the URI extension, your plug-in must reference the DITA-OT catalog file. In your
- Ant build file, add an <xmlelement>xmlcatalog</xmlelement> element referencing the
- DITA-OT catalog file as a child of the <xmlelement>xslt</xmlelement> element.</p>
- </info>
- <stepxmp>
- <codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace"><xslt style="xsl/my.xsl"
- in="${dita.temp.dir}/input.file"
- out="${dita.temp.dir}/output.file">
- <xmlcatalog refid="dita.catalog"/>
- </xslt></codeblock>
- </stepxmp>
- </step>
- </steps-unordered>
- <tasktroubleshooting>
- <p>For both of these methods, make sure you use the plug-in ID (defined in the
- <filepath>plugin.xml</filepath> 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>
- </tasktroubleshooting>
- </taskbody>
- </task>
|