1 | <?xml version="1.0"?>
|
---|
2 | <!-- This file is part of the DITA Open Toolkit project hosted on
|
---|
3 | Sourceforge.net. See the accompanying license.txt file for
|
---|
4 | applicable licenses.-->
|
---|
5 | <!--
|
---|
6 | | (C) Copyright IBM Corporation 2006. All Rights Reserved.
|
---|
7 | *-->
|
---|
8 | <!-- Need to ensure this comes out with the name "plugin.xml" rather than the default.
|
---|
9 | So: use saxon to force the plugin name. -->
|
---|
10 |
|
---|
11 | <xsl:stylesheet version="1.0"
|
---|
12 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
---|
13 |
|
---|
14 | <xsl:import href="../../../xsl/common/dita-utilities.xsl"/>
|
---|
15 | <xsl:import href="../../../xsl/common/output-message.xsl"/>
|
---|
16 | <xsl:variable name="msgprefix">DOTX</xsl:variable>
|
---|
17 |
|
---|
18 | <xsl:param name="PLUGINFILE" select="'plugin.xml'"/>
|
---|
19 | <xsl:param name="DITAMAPEXT" select="'.ditamap'"/>
|
---|
20 | <xsl:param name="indexFilename" select="'index.xml'"/>
|
---|
21 | <xsl:param name="DITAEXT" select="'.dita'"/>
|
---|
22 |
|
---|
23 |
|
---|
24 | <xsl:param name="DEFAULTINDEX" select="''"/>
|
---|
25 | <xsl:param name="fragment.country" select="''"/>
|
---|
26 | <xsl:param name="fragment.lang" select="''"/>
|
---|
27 | <xsl:param name="dita.plugin.output" />
|
---|
28 | <xsl:param name="plugin"/>
|
---|
29 |
|
---|
30 | <xsl:variable name="newline">
|
---|
31 | <xsl:text> </xsl:text></xsl:variable>
|
---|
32 |
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 | <!-- <xsl:output encoding="utf-8" indent="yes" method="xml"/> -->
|
---|
38 |
|
---|
39 | <!--<xsl:template match="*[contains(@class,' eclipsemap/plugin ')]//*"/>-->
|
---|
40 |
|
---|
41 | <xsl:template match="/">
|
---|
42 | <xsl:call-template name="eclipse.plugin.init"/>
|
---|
43 | </xsl:template>
|
---|
44 |
|
---|
45 | <xsl:template name="eclipse.plugin.init">
|
---|
46 | <xsl:if test="$dita.plugin.output !=''">
|
---|
47 | <xsl:choose>
|
---|
48 | <!--<xsl:when test="$dita.plugin.output ='dita.eclipse.fragment'">
|
---|
49 | <xsl:apply-templates mode="eclipse.fragment"/>
|
---|
50 | </xsl:when>-->
|
---|
51 | <xsl:when test="$dita.plugin.output ='dita.eclipse.properties'">
|
---|
52 | <xsl:apply-templates mode="eclipse.properties"/>
|
---|
53 | </xsl:when>
|
---|
54 | <xsl:when test="$dita.plugin.output ='dita.eclipse.manifest'">
|
---|
55 | <xsl:apply-templates mode="eclipse.manifest"/>
|
---|
56 | </xsl:when>
|
---|
57 | <xsl:when test="$dita.plugin.output ='dita.eclipse.plugin'">
|
---|
58 | <xsl:apply-templates mode="eclipse.plugin"/>
|
---|
59 | </xsl:when>
|
---|
60 | <!-- XSLT 2.0 param value used to generate all eclipse plugin related files.-->
|
---|
61 | <xsl:when test="$dita.plugin.output ='dita.eclipse.all'">
|
---|
62 |
|
---|
63 | </xsl:when>
|
---|
64 | <!-- Produce the content for the plugin.xml file -->
|
---|
65 | <xsl:otherwise>
|
---|
66 | <xsl:apply-templates />
|
---|
67 | </xsl:otherwise>
|
---|
68 | </xsl:choose>
|
---|
69 | </xsl:if>
|
---|
70 |
|
---|
71 | <xsl:if test="$dita.plugin.output =''">
|
---|
72 | <xsl:apply-templates />
|
---|
73 | </xsl:if>
|
---|
74 |
|
---|
75 | </xsl:template>
|
---|
76 |
|
---|
77 | <xsl:template match="*[contains(@class,' eclipsemap/plugin ')]" mode="eclipse.plugin">
|
---|
78 | <xsl:value-of select="$newline"/>
|
---|
79 | <plugin>
|
---|
80 | <!--
|
---|
81 | <xsl:apply-templates select="@id"/>
|
---|
82 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' eclipsemap/pluginname ')]" mode="plugin"/>
|
---|
83 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/providerName ')]" mode="plugin"/>
|
---|
84 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' topic/vrmlist ')]" mode="plugin"/>
|
---|
85 | -->
|
---|
86 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/controllingPlugin ')]" mode="plugin"/>
|
---|
87 | <xsl:if test="*[contains(@class,' eclipsemap/tocref ')][not(@toc='no')]|*[contains(@class,' eclipsemap/primarytocref ')][not(@toc='no')]">
|
---|
88 |
|
---|
89 | <xsl:value-of select="$newline"/>
|
---|
90 | <extension point="org.eclipse.help.toc">
|
---|
91 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/primarytocref ')][not(@toc='no')]"/>
|
---|
92 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/tocref ')][not(@toc='no')]"/>
|
---|
93 | </extension>
|
---|
94 | </xsl:if>
|
---|
95 | <xsl:if test="$DEFAULTINDEX!=''">
|
---|
96 | <extension point="org.eclipse.help.index">
|
---|
97 | <index file="{$DEFAULTINDEX}"/>
|
---|
98 | </extension>
|
---|
99 | </xsl:if>
|
---|
100 | <xsl:call-template name="indexExtension"/>
|
---|
101 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/contextExtension ')] |
|
---|
102 | *[contains(@class,' eclipsemap/contentExtension ')] |
|
---|
103 | *[contains(@class,' eclipsemap/extension ')]"/>
|
---|
104 | </plugin>
|
---|
105 | </xsl:template>
|
---|
106 |
|
---|
107 | <xsl:template match="*[contains(@class,' eclipsemap/plugin ')]/@id">
|
---|
108 | <xsl:copy-of select="."/>
|
---|
109 | </xsl:template>
|
---|
110 |
|
---|
111 | <xsl:template match="*[contains(@class,' eclipsemap/pluginname ')]" mode="plugin">
|
---|
112 | <xsl:attribute name="name"><xsl:value-of select="."/></xsl:attribute>
|
---|
113 | </xsl:template>
|
---|
114 | <xsl:template match="*[contains(@class,' eclipsemap/providerName ')]" mode="plugin">
|
---|
115 | <xsl:attribute name="provider-name"><xsl:value-of select="."/></xsl:attribute>
|
---|
116 | </xsl:template>
|
---|
117 | <xsl:template match="*[contains(@class,' topic/vrmlist ')]" mode="plugin">
|
---|
118 | <xsl:apply-templates select="*[contains(@class,' topic/vrm ')][last()]" mode="plugin"/>
|
---|
119 | </xsl:template>
|
---|
120 | <xsl:template match="*[contains(@class,' topic/vrm ')]" mode="plugin">
|
---|
121 | <xsl:attribute name="version"><xsl:value-of select="@version"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/><xsl:apply-templates select="../../*[contains(@class,' eclipsemap/pluginQualifier ')]"/></xsl:attribute>
|
---|
122 | </xsl:template>
|
---|
123 |
|
---|
124 | <xsl:template match="*[contains(@class,' eclipsemap/primarytocref ')][@href]">
|
---|
125 | <xsl:variable name="tocname">
|
---|
126 | <xsl:choose>
|
---|
127 | <xsl:when test="@format = 'ditamap'">
|
---|
128 | <xsl:call-template name="replace-extension">
|
---|
129 | <xsl:with-param name="filename" select="@href"/>
|
---|
130 | <xsl:with-param name="extension" select="'.xml'"/>
|
---|
131 | </xsl:call-template>
|
---|
132 | </xsl:when>
|
---|
133 | <xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
|
---|
134 | </xsl:choose>
|
---|
135 | </xsl:variable>
|
---|
136 | <xsl:value-of select="$newline"/>
|
---|
137 | <toc file="{$tocname}" primary="true">
|
---|
138 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/tocrefmeta ')]/*[contains(@class,' eclipsemap/extradir ')]"/>
|
---|
139 | </toc>
|
---|
140 | </xsl:template>
|
---|
141 |
|
---|
142 | <xsl:template match="*[contains(@class,' eclipsemap/tocref ')][@href]">
|
---|
143 | <xsl:variable name="tocname">
|
---|
144 | <xsl:choose>
|
---|
145 | <xsl:when test="@format = 'ditamap'">
|
---|
146 | <xsl:call-template name="replace-extension">
|
---|
147 | <xsl:with-param name="filename" select="@href"/>
|
---|
148 | <xsl:with-param name="extension" select="'.xml'"/>
|
---|
149 | </xsl:call-template>
|
---|
150 | </xsl:when>
|
---|
151 | <xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
|
---|
152 | </xsl:choose>
|
---|
153 | </xsl:variable>
|
---|
154 | <xsl:value-of select="$newline"/>
|
---|
155 | <toc file="{$tocname}">
|
---|
156 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/tocrefmeta ')]/*[contains(@class,' eclipsemap/extradir ')]"/>
|
---|
157 | </toc>
|
---|
158 | </xsl:template>
|
---|
159 |
|
---|
160 | <xsl:template match="*[contains(@class,' eclipsemap/extradir ')]">
|
---|
161 | <xsl:attribute name="extradir"><xsl:value-of select="@content"/></xsl:attribute>
|
---|
162 | </xsl:template>
|
---|
163 |
|
---|
164 | <xsl:template name="indexExtension" match="*[contains(@class,' eclipsemap/indexExtension ')][@href]">
|
---|
165 | <xsl:variable name="indexname">
|
---|
166 | <xsl:choose>
|
---|
167 | <xsl:when test="not(@format) or @format = 'dita' or @format = 'ditamap'">
|
---|
168 | <xsl:call-template name="replace-extension">
|
---|
169 | <xsl:with-param name="filename" select="@href"/>
|
---|
170 | <xsl:with-param name="extension" select="'.xml'"/>
|
---|
171 | </xsl:call-template>
|
---|
172 | </xsl:when>
|
---|
173 | <xsl:otherwise><xsl:value-of select="@href"/></xsl:otherwise>
|
---|
174 | </xsl:choose>
|
---|
175 | </xsl:variable>
|
---|
176 | <xsl:value-of select="$newline"/>
|
---|
177 | <extension point="org.eclipse.help.index">
|
---|
178 | <index file="{$indexFilename}"/>
|
---|
179 | </extension>
|
---|
180 | </xsl:template>
|
---|
181 |
|
---|
182 | <xsl:template match="*[contains(@class,' eclipsemap/contextExtension ')]">
|
---|
183 | <xsl:value-of select="$newline"/>
|
---|
184 | <extension point="org.eclipse.help.contexts">
|
---|
185 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/contextInfo ')]/*[contains(@class,' eclipsemap/extensionName ')]"/>
|
---|
186 | <xsl:value-of select="$newline"/>
|
---|
187 | <contexts file="{@href}">
|
---|
188 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/contextInfo ')]/*[contains(@class,' eclipsemap/contextPlugin ')]"/>
|
---|
189 | </contexts>
|
---|
190 | </extension>
|
---|
191 | </xsl:template>
|
---|
192 |
|
---|
193 | <xsl:template match="*[contains(@class,' eclipsemap/extensionName ')]">
|
---|
194 | <xsl:attribute name="name"><xsl:value-of select="@content"/></xsl:attribute>
|
---|
195 | </xsl:template>
|
---|
196 |
|
---|
197 | <xsl:template match="*[contains(@class,' eclipsemap/contextPlugin ')]">
|
---|
198 | <xsl:attribute name="plugin"><xsl:value-of select="@content"/></xsl:attribute>
|
---|
199 | </xsl:template>
|
---|
200 |
|
---|
201 | <xsl:template match="*[contains(@class,' eclipsemap/contentExtension ')]">
|
---|
202 | <xsl:value-of select="$newline"/>
|
---|
203 | <extension point="org.eclipse.help.contentProducer">
|
---|
204 | <xsl:apply-templates select="*"/>
|
---|
205 | </extension>
|
---|
206 | </xsl:template>
|
---|
207 |
|
---|
208 | <xsl:template match="*[contains(@class,' eclipsemap/contentProducer ')]">
|
---|
209 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/extensionName ')]"/>
|
---|
210 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/producerClass ')]"/>
|
---|
211 | </xsl:template>
|
---|
212 |
|
---|
213 | <xsl:template match="*[contains(@class,' eclipsemap/producerClass ')]">
|
---|
214 | <xsl:value-of select="$newline"/>
|
---|
215 | <contentProducer producer="{@content}">
|
---|
216 | <xsl:apply-templates select="following-sibling::*[contains(@class,' eclipsemap/parameter ')]"/>
|
---|
217 | </contentProducer>
|
---|
218 | </xsl:template>
|
---|
219 |
|
---|
220 | <xsl:template match="*[contains(@class,' eclipsemap/parameter ')]">
|
---|
221 | <xsl:value-of select="$newline"/>
|
---|
222 | <parameter name="{@name}" value="{@content}"/>
|
---|
223 | </xsl:template>
|
---|
224 |
|
---|
225 | <xsl:template match="*[contains(@class,' eclipsemap/extension ')]">
|
---|
226 | <xsl:value-of select="$newline"/>
|
---|
227 | <extension>
|
---|
228 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/extensionMeta ')]/*[contains(@class,' eclipsemap/extensionPoint ')]"/>
|
---|
229 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/extensionMeta ')]/*[contains(@class,' eclipsemap/extensionName ')]"/>
|
---|
230 |
|
---|
231 | </extension>
|
---|
232 | </xsl:template>
|
---|
233 |
|
---|
234 | <xsl:template match="*[contains(@class,' eclipsemap/extensionPoint ')]">
|
---|
235 | <xsl:attribute name="point"><xsl:value-of select="@content"/></xsl:attribute>
|
---|
236 | </xsl:template>
|
---|
237 |
|
---|
238 | <xsl:template match="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/controllingPlugin ')]" mode="plugin">
|
---|
239 | <xsl:value-of select="$newline"/>
|
---|
240 | <xsl:element name="extension" >
|
---|
241 | <xsl:attribute name="point"><xsl:text>org.eclipse.core.runtime.products</xsl:text></xsl:attribute>
|
---|
242 | <xsl:choose>
|
---|
243 | <xsl:when test="*[contains(@class,' eclipsemap/productId ')]">
|
---|
244 | <xsl:attribute name="id"><xsl:value-of select="*[contains(@class,' eclipsemap/productId ')]" /></xsl:attribute>
|
---|
245 | </xsl:when>
|
---|
246 | <xsl:otherwise>
|
---|
247 | <xsl:attribute name="id"><xsl:text>helpProduct</xsl:text></xsl:attribute>
|
---|
248 | </xsl:otherwise>
|
---|
249 | </xsl:choose>
|
---|
250 | <xsl:element name="product">
|
---|
251 | <xsl:choose>
|
---|
252 | <xsl:when test="*[contains(@class,' eclipsemap/productName ')]">
|
---|
253 | <xsl:attribute name="name"><xsl:text>%productName</xsl:text></xsl:attribute>
|
---|
254 | <xsl:attribute name="application"/>
|
---|
255 | </xsl:when>
|
---|
256 | <xsl:otherwise>
|
---|
257 | <xsl:attribute name="name"><xsl:text>%name</xsl:text></xsl:attribute>
|
---|
258 | <xsl:attribute name="application"/>
|
---|
259 | </xsl:otherwise>
|
---|
260 | </xsl:choose>
|
---|
261 | </xsl:element>
|
---|
262 |
|
---|
263 | </xsl:element>
|
---|
264 | </xsl:template>
|
---|
265 |
|
---|
266 | <!--
|
---|
267 | ======================================================================
|
---|
268 | Eclipse Map Fragment Output
|
---|
269 | ======================================================================
|
---|
270 | -->
|
---|
271 | <!--
|
---|
272 | <xsl:template match="*[contains(@class,' eclipsemap/plugin ')]" priority="2" mode="eclipse.fragment">
|
---|
273 |
|
---|
274 | <xsl:element name="fragment">
|
---|
275 | <xsl:call-template name="eclipse.fragment.id"></xsl:call-template>
|
---|
276 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.fragment"/>
|
---|
277 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/providerName ')]" mode="eclipse.fragment"/>
|
---|
278 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' topic/vrmlist ')]" mode="eclipse.fragment"/>
|
---|
279 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' eclipsemap/fragmentMatch ')]" mode="eclipse.fragment"/>
|
---|
280 | </xsl:element>
|
---|
281 | </xsl:template>
|
---|
282 |
|
---|
283 | <xsl:template name="eclipse.fragment.id" mode="eclipse.fragment">
|
---|
284 | <xsl:attribute name="plugin-id"><xsl:value-of select="@id"/></xsl:attribute>
|
---|
285 | <xsl:choose>
|
---|
286 | <xsl:when test="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' eclipsemap/fragmentId ')]">
|
---|
287 | <xsl:attribute name="id"><xsl:value-of select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' eclipsemap/fragmentId ')]"/></xsl:attribute>
|
---|
288 | </xsl:when>
|
---|
289 | <xsl:otherwise>
|
---|
290 | <xsl:if test="$fragment.lang!=''">
|
---|
291 | <xsl:choose>
|
---|
292 | <xsl:when test="$fragment.country!=''">
|
---|
293 | <xsl:attribute name="id"><xsl:value-of select="@id"/>.<xsl:value-of select="$fragment.lang"/>.<xsl:value-of select="$fragment.country"/></xsl:attribute>
|
---|
294 | </xsl:when>
|
---|
295 | <xsl:otherwise>
|
---|
296 | <xsl:attribute name="id"><xsl:value-of select="@id"/>.<xsl:value-of select="$fragment.lang"/></xsl:attribute>
|
---|
297 | </xsl:otherwise>
|
---|
298 | </xsl:choose>
|
---|
299 | </xsl:if>
|
---|
300 | </xsl:otherwise>
|
---|
301 | </xsl:choose>
|
---|
302 | </xsl:template>
|
---|
303 |
|
---|
304 | <xsl:template match="*[contains(@class,' eclipsemap/fragmentMatch ')]" mode="eclipse.fragment">
|
---|
305 | <xsl:attribute name="match">
|
---|
306 | <xsl:choose>
|
---|
307 | <xsl:when test=".='perfect'">
|
---|
308 | <xsl:value-of select="."/>
|
---|
309 | </xsl:when>
|
---|
310 | <xsl:when test=".='equivalent'">
|
---|
311 | <xsl:value-of select="."/>
|
---|
312 | </xsl:when>
|
---|
313 | <xsl:when test=".='greaterOrEqual'">
|
---|
314 | <xsl:value-of select="."/>
|
---|
315 | </xsl:when>
|
---|
316 | <xsl:when test=".='compatible'">
|
---|
317 | <xsl:value-of select="."/>
|
---|
318 | </xsl:when>
|
---|
319 | <xsl:otherwise>
|
---|
320 | <xsl:text>compatible</xsl:text>
|
---|
321 | </xsl:otherwise>
|
---|
322 | </xsl:choose>
|
---|
323 | </xsl:attribute>
|
---|
324 | </xsl:template>
|
---|
325 |
|
---|
326 | <xsl:template match="*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.fragment">
|
---|
327 | <xsl:attribute name="name">%name</xsl:attribute>
|
---|
328 | </xsl:template>
|
---|
329 |
|
---|
330 | <xsl:template match="*[contains(@class,' eclipsemap/providerName ')]" mode="eclipse.fragment">
|
---|
331 | <xsl:attribute name="provider-name">
|
---|
332 |
|
---|
333 | <xsl:text>%providerName</xsl:text>
|
---|
334 | </xsl:attribute>
|
---|
335 | </xsl:template>
|
---|
336 |
|
---|
337 | <xsl:template match="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' topic/vrmlist ')]" mode="eclipse.fragment">
|
---|
338 | <xsl:attribute name="plugin-version">
|
---|
339 | <xsl:apply-templates select="*[contains(@class,' topic/vrm ')][last()]" mode="eclipse.fragment"/>
|
---|
340 | </xsl:attribute>
|
---|
341 | <xsl:choose>
|
---|
342 | <xsl:when test="../../*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' topic/vrmlist ')]">
|
---|
343 | <xsl:attribute name="version">
|
---|
344 | <xsl:apply-templates select="../../*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' topic/vrmlist ')]/*[contains(@class,' topic/vrm ')][last()]" mode="eclipse.fragment"/>
|
---|
345 | </xsl:attribute>
|
---|
346 | </xsl:when>
|
---|
347 | <xsl:otherwise>
|
---|
348 | <xsl:attribute name="version">
|
---|
349 | <xsl:apply-templates select="*[contains(@class,' topic/vrm ')][last()]" mode="eclipse.fragment"/>
|
---|
350 | </xsl:attribute>
|
---|
351 | </xsl:otherwise>
|
---|
352 | </xsl:choose>
|
---|
353 |
|
---|
354 | </xsl:template>
|
---|
355 |
|
---|
356 | <xsl:template match="*[contains(@class,' topic/vrm ')]" mode="eclipse.fragment">
|
---|
357 | <xsl:value-of select="@version"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/><xsl:apply-templates select="../../*[contains(@class,' eclipsemap/pluginQualifier ')]" mode="eclipse.manifest"/>
|
---|
358 | </xsl:template>
|
---|
359 |
|
---|
360 | -->
|
---|
361 |
|
---|
362 | <!--
|
---|
363 | ======================================================================
|
---|
364 | Eclipse Map OSGI Manifest Output
|
---|
365 | ======================================================================
|
---|
366 | -->
|
---|
367 |
|
---|
368 | <xsl:template match= "*[contains(@class,' eclipsemap/plugin ')]" priority="2" mode="eclipse.manifest">
|
---|
369 | <xsl:call-template name="eclipse.manifest.init"/>
|
---|
370 |
|
---|
371 |
|
---|
372 | </xsl:template>
|
---|
373 |
|
---|
374 | <xsl:template name="eclipse.manifest.init">
|
---|
375 | <xsl:text>Manifest-Version: 1.0</xsl:text><xsl:value-of select="$newline"/>
|
---|
376 | <xsl:text>Bundle-ManifestVersion: 2</xsl:text><xsl:value-of select="$newline"/>
|
---|
377 | <xsl:text>Bundle-Localization: plugin</xsl:text><xsl:value-of select="$newline"/>
|
---|
378 | <xsl:text>Bundle-Name: %name</xsl:text><xsl:value-of select="$newline"/>
|
---|
379 |
|
---|
380 |
|
---|
381 | <xsl:text>Bundle-Vendor: %providerName</xsl:text><xsl:value-of select="$newline"/>
|
---|
382 | <xsl:choose>
|
---|
383 | <xsl:when test="$plugin='true'">
|
---|
384 | <xsl:text>Eclipse-LazyStart: true</xsl:text><xsl:value-of select="$newline"/>
|
---|
385 | <xsl:choose>
|
---|
386 | <xsl:when test="@id">
|
---|
387 | <xsl:text>Bundle-SymbolicName: </xsl:text><xsl:value-of select="@id"/>;<xsl:text> singleton:=true</xsl:text><xsl:value-of select="$newline"/>
|
---|
388 | </xsl:when>
|
---|
389 | <xsl:otherwise>
|
---|
390 | <xsl:text>Bundle-SymbolicName: org.sample.help.doc; singleton:=true</xsl:text><xsl:value-of select="$newline"/>
|
---|
391 | <xsl:call-template name="output-message">
|
---|
392 | <xsl:with-param name="msgnum">050</xsl:with-param>
|
---|
393 | <xsl:with-param name="msgsev">W</xsl:with-param>
|
---|
394 | </xsl:call-template>
|
---|
395 | </xsl:otherwise>
|
---|
396 | </xsl:choose>
|
---|
397 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' topic/vrmlist ')]" mode="eclipse.manifest"/>
|
---|
398 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/osgiManifest ')]/*[contains(@class,' eclipsemap/manifestMeta ')]" mode="eclipse.manifest"/>
|
---|
399 | </xsl:when>
|
---|
400 | <xsl:otherwise>
|
---|
401 | <xsl:choose>
|
---|
402 | <xsl:when test="@id">
|
---|
403 | <xsl:if test="$fragment.lang!=''">
|
---|
404 | <xsl:text>Fragment-Host: </xsl:text><xsl:value-of select="@id"/>;<xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' eclipsemap/fragmentVersionInfo ')]" mode="eclipse.manifest"/>
|
---|
405 | <xsl:value-of select="$newline"/>
|
---|
406 |
|
---|
407 | <xsl:text>Bundle-SymbolicName: </xsl:text><xsl:value-of select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]/*[contains(@class,' eclipsemap/fragmentName ')]"/><xsl:value-of select="$newline"/>
|
---|
408 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/fragmentInfo ')]" mode="eclipse.manifest"/>
|
---|
409 | </xsl:if>
|
---|
410 | </xsl:when>
|
---|
411 | <xsl:otherwise>
|
---|
412 |
|
---|
413 | <!-- <xsl:text>Bundle-SymbolicName: org.sample.help.doc.</xsl:text> -->
|
---|
414 | <xsl:text>Bundle-SymbolicName: org.sample.help.doc</xsl:text>
|
---|
415 | <!-- <xsl:choose>
|
---|
416 | <xsl:when test="$fragment.lang!=''">
|
---|
417 | <xsl:choose>
|
---|
418 | <xsl:when test="$fragment.country!=''">
|
---|
419 | <xsl:value-of select="$fragment.lang"/>.<xsl:value-of select="$fragment.country"/>;<xsl:text/>
|
---|
420 | </xsl:when>
|
---|
421 | <xsl:otherwise>
|
---|
422 | <xsl:value-of select="$fragment.lang"/>;<xsl:text/>
|
---|
423 | </xsl:otherwise>
|
---|
424 | </xsl:choose>
|
---|
425 | </xsl:when>
|
---|
426 | <xsl:otherwise>
|
---|
427 | <xsl:text>lang; </xsl:text>
|
---|
428 | </xsl:otherwise>
|
---|
429 | </xsl:choose> -->
|
---|
430 | <xsl:value-of select="$newline"/>
|
---|
431 | <xsl:text>Fragment-Host: org.sample.help.doc.</xsl:text>
|
---|
432 | <xsl:choose>
|
---|
433 | <xsl:when test="$fragment.lang!=''">
|
---|
434 | <xsl:choose>
|
---|
435 | <xsl:when test="$fragment.country!=''">
|
---|
436 | <xsl:value-of select="$fragment.lang"/>.<xsl:value-of select="$fragment.country"/>;<xsl:text/>
|
---|
437 | </xsl:when>
|
---|
438 | <xsl:otherwise>
|
---|
439 | <xsl:value-of select="$fragment.lang"/>;<xsl:text/>
|
---|
440 | </xsl:otherwise>
|
---|
441 | </xsl:choose>
|
---|
442 | </xsl:when>
|
---|
443 | <!-- We shouldn' t be getting here, but just in case -->
|
---|
444 | <xsl:otherwise>
|
---|
445 | <xsl:text>lang; </xsl:text>
|
---|
446 | </xsl:otherwise>
|
---|
447 | </xsl:choose>
|
---|
448 | <xsl:value-of select="$newline"/>
|
---|
449 | <xsl:call-template name="output-message">
|
---|
450 | <xsl:with-param name="msgnum">050</xsl:with-param>
|
---|
451 | <xsl:with-param name="msgsev">W</xsl:with-param>
|
---|
452 | </xsl:call-template>
|
---|
453 | </xsl:otherwise>
|
---|
454 | </xsl:choose>
|
---|
455 | </xsl:otherwise>
|
---|
456 | </xsl:choose>
|
---|
457 | </xsl:template>
|
---|
458 |
|
---|
459 | <xsl:template match="*[contains(@class,' eclipsemap/otherBundleHeaders ')]" mode="eclipse.manifest" >
|
---|
460 | <xsl:value-of select="@name"/>: <xsl:value-of select="@content"/>
|
---|
461 | </xsl:template>
|
---|
462 |
|
---|
463 |
|
---|
464 | <xsl:template match="*[contains(@class,' eclipsemap/fragmentInfo ')]" mode="eclipse.manifest" priority="2">
|
---|
465 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/fragmentVersionInfo ')]/*[contains(@class,' topic/vrm ')][position()=1]" mode="eclipse.manifest"/>
|
---|
466 | </xsl:template>
|
---|
467 |
|
---|
468 | <xsl:template match="*[contains(@class,' eclipsemap/fragmentVersionInfo ')]" mode="eclipse.manifest" priority="2">
|
---|
469 | <xsl:text> bundle-version="</xsl:text>
|
---|
470 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionMin ')]" mode="eclipse.manifest"/>
|
---|
471 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionGreaterThanMin ')]" mode="eclipse.manifest"/>
|
---|
472 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionMax ')]" mode="eclipse.manifest"/>
|
---|
473 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionLessThanMax ')]" mode="eclipse.manifest"/>
|
---|
474 | <xsl:text>"</xsl:text>
|
---|
475 | </xsl:template>
|
---|
476 |
|
---|
477 | <xsl:template match="*[contains(@class,' topic/vrmlist ')]" mode="eclipse.manifest">
|
---|
478 | <xsl:apply-templates select="*[contains(@class,' topic/vrm ')][position()=1]" mode="eclipse.manifest"/>
|
---|
479 | </xsl:template>
|
---|
480 |
|
---|
481 | <xsl:template match="*[contains(@class,' topic/vrm ')]" mode="eclipse.manifest">
|
---|
482 | <xsl:text>Bundle-Version: </xsl:text><xsl:apply-templates select="@version" mode="eclipse.manifest"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/><xsl:apply-templates select="../../*[contains(@class,' eclipsemap/qualifier ')]" mode="eclipse.manifest"/><xsl:value-of select="$newline"/>
|
---|
483 | </xsl:template>
|
---|
484 |
|
---|
485 | <xsl:template match="@version" mode="eclipse.manifest">
|
---|
486 | <xsl:choose>
|
---|
487 | <xsl:when test="(string(number(.)) < 0) or (string(number(.)) = 'NaN') or (normalize-space(.)='') ">
|
---|
488 | <xsl:text>0</xsl:text>
|
---|
489 | </xsl:when>
|
---|
490 | <xsl:otherwise>
|
---|
491 | <xsl:value-of select="floor(.)"/>
|
---|
492 | </xsl:otherwise>
|
---|
493 | </xsl:choose>
|
---|
494 | </xsl:template>
|
---|
495 |
|
---|
496 | <xsl:template match="@release" mode="eclipse.manifest">
|
---|
497 | <xsl:choose>
|
---|
498 | <xsl:when test="(string(number(.)) < 0) or (string(number(.)) = 'NaN') or (normalize-space(.)='') ">
|
---|
499 | <xsl:text>.</xsl:text><xsl:text>0</xsl:text>
|
---|
500 | </xsl:when>
|
---|
501 | <xsl:otherwise>
|
---|
502 | <xsl:text>.</xsl:text><xsl:value-of select="floor(.)"/>
|
---|
503 | </xsl:otherwise>
|
---|
504 | </xsl:choose>
|
---|
505 | </xsl:template>
|
---|
506 |
|
---|
507 | <xsl:template match="@modification" mode="eclipse.manifest">
|
---|
508 | <xsl:choose>
|
---|
509 | <xsl:when test="(string(number(.)) < 0) or (string(number(.)) = 'NaN') or (normalize-space(.)='') ">
|
---|
510 | <xsl:text>.</xsl:text><xsl:text>0</xsl:text>
|
---|
511 | </xsl:when>
|
---|
512 | <xsl:otherwise>
|
---|
513 | <xsl:text>.</xsl:text><xsl:value-of select="floor(.)"/>
|
---|
514 | </xsl:otherwise>
|
---|
515 | </xsl:choose>
|
---|
516 | </xsl:template>
|
---|
517 | <xsl:template match="*[contains(@class,' eclipsemap/qualifier ')]" mode="eclipse.manifest">
|
---|
518 | <xsl:text>.</xsl:text><xsl:value-of select="."/>
|
---|
519 | </xsl:template>
|
---|
520 |
|
---|
521 | <xsl:template match="*[contains(@class,' eclipsemap/osgiManifest ')]/*[contains(@class,' eclipsemap/manifestMeta ')]" mode="eclipse.manifest">
|
---|
522 | <xsl:if test="*[contains(@class,' eclipsemap/requiresPlugin ')]">
|
---|
523 | <xsl:text>Require-Bundle: </xsl:text>
|
---|
524 | </xsl:if>
|
---|
525 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/requiresPlugin ')]" mode="eclipse.manifest"/>
|
---|
526 | <xsl:value-of select="$newline"/>
|
---|
527 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/otherBundleHeaders ')]" mode="eclipse.manifest"/>
|
---|
528 | </xsl:template>
|
---|
529 |
|
---|
530 | <!--
|
---|
531 | Require-Bundle: org.eclipse.help;bundle-version="[3.2.0,4.0.0)",com.ibm.help.doc;bundle-version="[7.0.0,8.0.0)"
|
---|
532 | -->
|
---|
533 | <xsl:template match="*[contains(@class,' eclipsemap/requiresPlugin ')]" mode="eclipse.manifest">
|
---|
534 | <xsl:if test="position() != 1">
|
---|
535 | <xsl:text>, </xsl:text>
|
---|
536 | </xsl:if>
|
---|
537 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.manifest"/>
|
---|
538 | <xsl:text>"</xsl:text>
|
---|
539 | </xsl:template>
|
---|
540 |
|
---|
541 | <xsl:template match="*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.manifest">
|
---|
542 | <xsl:value-of select="."/><xsl:text>; bundle-version="</xsl:text>
|
---|
543 | <xsl:apply-templates select="following-sibling::*[contains(@class,' eclipsemap/versionRange ')]" mode="eclipse.manifest"/>
|
---|
544 | </xsl:template>
|
---|
545 |
|
---|
546 | <xsl:template match="*[contains(@class,' eclipsemap/versionRange ')]" mode="eclipse.manifest" priority="2">
|
---|
547 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionMin ')]" mode="eclipse.manifest"/>
|
---|
548 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionGreaterThanMin ')]" mode="eclipse.manifest"/>
|
---|
549 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionMax ')]" mode="eclipse.manifest"/>
|
---|
550 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/versionLessThanMax ')]" mode="eclipse.manifest"/>
|
---|
551 | </xsl:template>
|
---|
552 |
|
---|
553 | <xsl:template match="*[contains(@class,' eclipsemap/versionMin ')]" mode="eclipse.manifest" priority="2">
|
---|
554 | <xsl:if test="following-sibling::*[contains(@class,' eclipsemap/versionMax ')] or following-sibling::*[contains(@class,' eclipsemap/versionLessThanMax ')]">
|
---|
555 | <xsl:text>[</xsl:text>
|
---|
556 | </xsl:if>
|
---|
557 | <xsl:apply-templates select="@version" mode="eclipse.manifest"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/>
|
---|
558 | </xsl:template>
|
---|
559 |
|
---|
560 | <xsl:template match="*[contains(@class,' eclipsemap/versionGreaterThanMin ')]" mode="eclipse.manifest" priority="2">
|
---|
561 | <xsl:text>(</xsl:text>
|
---|
562 | <xsl:apply-templates select="@version" mode="eclipse.manifest"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/>
|
---|
563 | </xsl:template>
|
---|
564 |
|
---|
565 | <xsl:template match="*[contains(@class,' eclipsemap/versionMax ')]" mode="eclipse.manifest" priority="2">
|
---|
566 | <xsl:text>, </xsl:text>
|
---|
567 | <xsl:apply-templates select="@version" mode="eclipse.manifest"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/>
|
---|
568 | <xsl:text>]</xsl:text>
|
---|
569 | </xsl:template>
|
---|
570 |
|
---|
571 | <xsl:template match="*[contains(@class,' eclipsemap/versionLessThanMax ')]" mode="eclipse.manifest" priority="2">
|
---|
572 | <xsl:text>, </xsl:text>
|
---|
573 | <xsl:apply-templates select="@version" mode="eclipse.manifest"/><xsl:apply-templates select="@release" mode="eclipse.manifest"/><xsl:apply-templates select="@modification" mode="eclipse.manifest"/>
|
---|
574 | <xsl:text>)</xsl:text>
|
---|
575 | </xsl:template>
|
---|
576 |
|
---|
577 | <!--
|
---|
578 | ======================================================================
|
---|
579 | Eclipse Map Plugin Properties Output
|
---|
580 | ======================================================================
|
---|
581 | -->
|
---|
582 |
|
---|
583 | <xsl:template match="*[contains(@class,' eclipsemap/plugin ')]" priority="2" mode="eclipse.properties">
|
---|
584 | <xsl:text># NLS_MESSAGEFORMAT_NONE</xsl:text><xsl:value-of select="$newline"/>
|
---|
585 | <xsl:text># NLS_ENCODING=UTF-8</xsl:text><xsl:value-of select="$newline"/>
|
---|
586 |
|
---|
587 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/plugininfo ')]/*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.properties"/>
|
---|
588 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/providerName ')]" mode="eclipse.properties"/>
|
---|
589 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/controllingPlugin ')]/*[contains(@class,' eclipsemap/productName ')]" mode="eclipse.properties"/>
|
---|
590 | <xsl:apply-templates select="*[contains(@class,' eclipsemap/pluginmeta ')]/*[contains(@class,' eclipsemap/pluginProperties ')]" mode="eclipse.properties"/>
|
---|
591 | </xsl:template>
|
---|
592 |
|
---|
593 | <xsl:template match="*[contains(@class,' eclipsemap/pluginname ')]" mode="eclipse.properties">
|
---|
594 | <xsl:text>name=</xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:value-of select="$newline"/>
|
---|
595 | </xsl:template>
|
---|
596 | <xsl:template match="*[contains(@class,' eclipsemap/providerName ')]" mode="eclipse.properties">
|
---|
597 | <xsl:text>providerName=</xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:value-of select="$newline"/>
|
---|
598 | </xsl:template>
|
---|
599 | <xsl:template match="*[contains(@class,' eclipsemap/productName ')]" mode="eclipse.properties">
|
---|
600 | <xsl:text>productName=</xsl:text><xsl:value-of select="normalize-space(.)"/><xsl:value-of select="$newline"/>
|
---|
601 | </xsl:template>
|
---|
602 |
|
---|
603 | <xsl:template match="*[contains(@class,' eclipsemap/pluginProperties ')]" mode="eclipse.properties">
|
---|
604 | <xsl:value-of select="@name"/><xsl:text>=</xsl:text><xsl:value-of select="@content"/><xsl:value-of select="$newline"/>
|
---|
605 | </xsl:template>
|
---|
606 |
|
---|
607 | </xsl:stylesheet>
|
---|
608 |
|
---|
609 |
|
---|
610 |
|
---|
611 |
|
---|
612 |
|
---|