eclipse3.xsl 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:ng="http://docbook.org/docbook-ng"
  4. xmlns:db="http://docbook.org/ns/docbook"
  5. xmlns:exsl="http://exslt.org/common" version="1.0"
  6. exclude-result-prefixes="exsl db ng">
  7. <!--
  8. ********************************************************************************
  9. $Id: eclipse3.xsl 9149 2011-11-12 00:12:07Z bobstayton $
  10. This file is part of the XSL DocBook Stylesheet distribution.
  11. See ../README or http://docbook.sf.net/release/xsl/current/ for
  12. copyright and other information.
  13. * Copyright (c) 2008 Standards for Technology in Automotive Retail and others.
  14. * All rights reserved. This program and the accompanying materials
  15. * are made available under the terms of the Eclipse Public License v1.0
  16. * which accompanies this distribution, and is available at
  17. * http://www.eclipse.org/legal/epl-v10.html
  18. *
  19. * Contributors:
  20. * David Carver - STAR - Extended existing eclipse.xsl file to produce valid
  21. * eclipse 3.3 plugin.xml with a manifest file.
  22. *******************************************************************************
  23. -->
  24. <xsl:import href="eclipse.xsl"/>
  25. <xsl:param name="eclipse.manifest">1</xsl:param>
  26. <xsl:param name="create.plugin.xml">1</xsl:param>
  27. <xsl:template name="plugin.xml">
  28. <xsl:if test="$create.plugin.xml != 0">
  29. <xsl:call-template name="write.chunk">
  30. <xsl:with-param name="filename">
  31. <xsl:if test="$manifest.in.base.dir != 0">
  32. <xsl:value-of select="$chunk.base.dir" />
  33. </xsl:if>
  34. <xsl:value-of select="'plugin.xml'" />
  35. </xsl:with-param>
  36. <xsl:with-param name="method" select="'xml'" />
  37. <xsl:with-param name="encoding" select="'utf-8'" />
  38. <xsl:with-param name="indent" select="'yes'" />
  39. <xsl:with-param name="quiet" select="$chunk.quietly"/>
  40. <xsl:with-param name="content">
  41. <xsl:choose>
  42. <xsl:when test="$eclipse.manifest = '1'">
  43. <plugin>
  44. <extension point="org.eclipse.help.toc">
  45. <toc file="toc.xml" primary="true" />
  46. </extension>
  47. <xsl:if test="$generate.index = 1">
  48. <extension point="org.eclipse.help.index">
  49. <index file="index.xml"/>
  50. </extension>
  51. </xsl:if>
  52. </plugin>
  53. <xsl:call-template name="write.chunk">
  54. <xsl:with-param name="filename">
  55. <xsl:if test="$manifest.in.base.dir != 0">
  56. <xsl:value-of select="$chunk.base.dir" />
  57. </xsl:if>
  58. <xsl:value-of select="'META-INF/'" />
  59. <xsl:value-of select="'MANIFEST.MF'" />
  60. </xsl:with-param>
  61. <xsl:with-param name="method" select="'text'" />
  62. <xsl:with-param name="encoding" select="'utf-8'" />
  63. <xsl:with-param name="quiet" select="$chunk.quietly"/>
  64. <xsl:with-param name="content">
  65. <xsl:call-template name="manifest.content"/>
  66. </xsl:with-param>
  67. </xsl:call-template>
  68. </xsl:when>
  69. <xsl:otherwise>
  70. <plugin name="{$eclipse.plugin.name}" id="{$eclipse.plugin.id}"
  71. version="1.0" provider-name="{$eclipse.plugin.provider}">
  72. <extension point="org.eclipse.help.toc">
  73. <toc file="toc.xml" primary="true" />
  74. </extension>
  75. <xsl:if test="$generate.index = 1">
  76. <extension point="org.eclipse.help.index">
  77. <index file="index.xml"/>
  78. </extension>
  79. </xsl:if>
  80. </plugin>
  81. </xsl:otherwise>
  82. </xsl:choose>
  83. </xsl:with-param>
  84. </xsl:call-template>
  85. </xsl:if>
  86. </xsl:template>
  87. <xsl:template name="manifest.content">
  88. <xsl:text>Manifest-Version: 1.0</xsl:text>
  89. <xsl:text>&#xA;</xsl:text>
  90. <xsl:text>Bundle-Version: 1.0</xsl:text>
  91. <xsl:text>&#xA;</xsl:text>
  92. <xsl:text>Bundle-Name: </xsl:text><xsl:value-of select="$eclipse.plugin.name"/>
  93. <xsl:text>&#xA;</xsl:text>
  94. <xsl:text>Bundle-SymbolicName: </xsl:text><xsl:value-of select="$eclipse.plugin.id"/>
  95. <xsl:text>&#xA;</xsl:text>
  96. <xsl:text>Bundle-Vendor: </xsl:text><xsl:value-of select="$eclipse.plugin.provider"/>
  97. <xsl:text>&#xA;</xsl:text>
  98. </xsl:template>
  99. </xsl:stylesheet>