Skip to main content
summaryrefslogtreecommitdiffstats
blob: b1c1c3bdd404350f9ca4fcb767390c776bd853ac (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
75
76
77
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:output indent="yes"/>

    <xsl:param name="version"/>

    <xsl:template match="/plugin">
        <plugin>
	    <xsl:attribute name="version">
	        <xsl:value-of select="$version"/>
	    </xsl:attribute>
	    <xsl:copy-of select="*|@*[not(name()='version')]"/>
	</plugin>
    </xsl:template>

    <xsl:template match="/fragment">
        <fragment>
	    <xsl:attribute name="version">
	        <xsl:value-of select="$version"/>
	    </xsl:attribute>
	    <xsl:attribute name="plugin-version">
	        <xsl:value-of select="$version"/>
	    </xsl:attribute>
	    <xsl:copy-of select="*|@*[not(name()='version' or name()='plugin-version')]"/>
	</fragment>
    </xsl:template>

    <xsl:template match="/feature">
        <xsl:copy>
	   <xsl:attribute name="version">
	       <xsl:value-of select="$version"/>
	   </xsl:attribute>
	   <xsl:apply-templates mode="feature" select="@*[not(name()='version')]|*|text()"/>
	</xsl:copy>
    </xsl:template>

    <xsl:template mode="feature" match="includes|plugin">
        <xsl:copy>
	    <xsl:attribute name="version">
	        <xsl:value-of select="$version"/>
	    </xsl:attribute>
	    <xsl:copy-of select="*|@*[not(name()='version')]"/>
	</xsl:copy>	
    </xsl:template>

    <xsl:template mode="feature" match="import[starts-with(@plugin,'org.eclipse.cdt')]|import[starts-with(@feature,'org.eclipse.cdt')]">
        <xsl:copy>
	    <xsl:attribute name="version">
	        <xsl:value-of select="$version"/>
	    </xsl:attribute>
	    <xsl:copy-of select="*|@*[not(name()='version')]"/>
	</xsl:copy>	
    </xsl:template>

    <xsl:template mode="feature" match="url/update">
        <xsl:copy>
	    <xsl:attribute name="url">
	        <xsl:text>http://update.eclipse.org/tools/cdt/updates/builds/2.0</xsl:text>
	    </xsl:attribute>
	    <xsl:copy-of select="*|@*[not(name()='url')]"/>
	</xsl:copy>
    </xsl:template>

    <xsl:template match="@*|*|text()">
        <xsl:copy>
	    <xsl:apply-templates select="@*|*|text()"/>
	</xsl:copy>
    </xsl:template>

    <xsl:template mode="feature" match="@*|*|text()">
        <xsl:copy>
	    <xsl:apply-templates mode="feature" select="@*|*|text()"/>
	</xsl:copy>
    </xsl:template>

</xsl:transform>

Back to the top