/
plugin-xsltparams.dita
79 lines (79 loc) · 3.78 KB
/
plugin-xsltparams.dita
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
<task id="plugin-xsltparams">
<title>Adding parameters to existing XSLT steps</title>
<titlealts>
<navtitle>Adding new parameters</navtitle>
</titlealts>
<shortdesc>You can pass parameters from the Ant build to existing XSLT steps in both the pre-processing pipeline and
certain DITA-OT transformations. This can be useful if you want to make the parameters available as global
<xmlelement>xsl:param</xmlelement> values within XSLT overrides.</shortdesc>
<prolog>
<metadata>
<keywords>
<indexterm><xmlelement>xsl:param</xmlelement></indexterm>
<indexterm><xmlelement>param</xmlelement></indexterm>
<indexterm><xmlelement>dummy</xmlelement></indexterm>
<indexterm>plug-ins
<indexterm>parameters</indexterm></indexterm>
<indexterm>parameters
<indexterm>adding</indexterm></indexterm>
<indexterm>plug-ins
<indexterm>XSLT</indexterm></indexterm>
<indexterm>XSLT
<indexterm>parameters</indexterm></indexterm>
</keywords>
</metadata>
</prolog>
<taskbody>
<steps>
<step id="create-xml-file">
<cmd>Create an XML file that contains one or more Ant <xmlelement>param</xmlelement> elements nested within a
<xmlelement>dummy</xmlelement> wrapper element.</cmd>
<stepxmp>
<codeblock outputclass="language-xml normalize-space show-line-numbers show-whitespace"><dummy>
<i><!-- Any Ant code allowed in xslt task is possible. Example: --></i>
<param name="paramNameinXSLT" expression="${antProperty}"
if="antProperty"/>
</dummy></codeblock>
</stepxmp>
</step>
<step>
<cmd>Construct a <filepath>plugin.xml</filepath> file that contains the following content:</cmd>
<info><codeblock
outputclass="language-xml normalize-space show-line-numbers show-whitespace"
><plugin id="<varname>plugin-id</varname>">
<feature extension="<varname>extension-point</varname>" file="<varname>file</varname>"/>
</plugin></codeblock>where:
<ul>
<li><varname>plugin-id</varname> is the plug-in identifier, for example,
<codeph>com.example.newparam</codeph>.</li>
<li><varname>extension-point</varname> is the DITA-OT extension point, for example,<codeph>
dita.conductor.xhtml.param</codeph>. This indicates the DITA-OT processing step where the parameters
will be available.</li>
<li><varname>file</varname> is the name of the XML file that you created in step
<xref href="#./create-xml-file" format="dita"/>, for example, <filepath>insertParameters.xml</filepath>.
</li>
</ul></info>
</step>
<step conkeyref="conref-task/install-plugin">
<cmd/>
</step>
</steps>
<result>The <filepath>plugin.xml</filepath> file passes the parameters to the specified transformation or
pre-processing module.</result>
<example>
<title>Example</title>
<p>The following plug-in passes the parameters defined in the <filepath>insertParameters.xml</filepath> file as
input to the XHTML process. Generally, an additional XSLT override will make use of the parameters to do
something new with the generated content.</p>
<codeblock
outputclass="language-xml normalize-space show-line-numbers show-whitespace"
><plugin id="com.example.newparam">
<feature extension="dita.conductor.xhtml.param"
file="insertParameters.xml"/>
</plugin></codeblock>
</example>
</taskbody>
</task>