Skip to main content
summaryrefslogtreecommitdiffstats
blob: 112838c13409b12e32526e570c7f61818d4ff542 (plain) (blame)
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
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!--  
    This transform is to work around bug 350088.
    https://bugs.eclipse.org/bugs/show_bug.cgi?id=350088
    
    The original idea of using and XSL transform for this work-around, 
    came from a message list posting in 2009 by Paul Webster, 
    https://www.eclipse.org/forums/index.php?t=msg&th=40931&start=0&
    While was referenced in a 2009 blog post by Andrew Niefer, 
    http://aniefer.blogspot.com/2009/06/patching-features-part-2.html. 
    The details here are heavily modified, just wanted to acknowledge those
    sources of inspiration. Paul also used XSLT to final form of metadata for 
    our executable feature, in current builds. 
 -->

  <xsl:param name="patchFeatureVersionRange">
    $patchFeatureVersionRange
  </xsl:param>
  <xsl:param name="patchFeatureIU">
    $patchFeatureIU
  </xsl:param>
  <!-- 
  <xsl:variable name="patchFeatureVersionRange"><xsl:value-of select="$patchFeatureVersionRange" /></xsl:variable> 
  <xsl:variable name="patchFeatureIU"><xsl:value-of select="$patchFeatureIU" /></xsl:variable>
   -->
  <xsl:variable name="quot">
    "
  </xsl:variable>
  <xsl:variable name="apos">
    '
  </xsl:variable>

  <xsl:template match="processing-instruction('metadataRepository')">
  <xsl:text>&#xa;</xsl:text>
  <xsl:copy />
  <xsl:text>&#xa;</xsl:text>
    <xsl:comment>
      This content.xml file was transformed to include "specific range match" 
      for the feature intended to be patched. 
      Feature (IU) to be patched: 
         <xsl:value-of select="$patchFeatureIU" />
      Version Range:
         <xsl:value-of select="$patchFeatureVersionRange" />   

      XSLT Version = <xsl:copy-of select="system-property('xsl:version')" />
      XSLT Vendor = <xsl:copy-of select="system-property('xsl:vendor')" />
      XSLT Vendor URL = <xsl:copy-of select="system-property('xsl:vendor-url')" />
    <xsl:text>&#xa;</xsl:text>
    </xsl:comment>
    <xsl:text>&#xa;</xsl:text>
    <xsl:apply-templates />
  </xsl:template>


	<!-- standard copy template -->
  <xsl:template match="@*|node()">

    <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates />
    </xsl:copy>
  </xsl:template>

<!--  For this awkward use of concat, see http://www.oxygenxml.com/archives/xsl-list/200811/msg00544.html 
  <xsl:template match="concat ($apos, @range [@name=, $apos, $patchFeatureIU, $apos,],$apos )">
  -->
  <xsl:template match="@range[../@name='org.eclipse.jdt.feature.group']">
    <xsl:attribute name="range"><xsl:value-of select="$patchFeatureVersionRange" /></xsl:attribute>
  </xsl:template>

</xsl:stylesheet>

Back to the top