blob: 67d70b9f572f9f8e6ec300e2a2964b9683636c24 [file] [log] [blame]
Stephan Herrmanndcd87c12010-04-25 10:59:27 +00001<?xml version="1.0"?>
Stephan Herrmann9c5f7ae2010-07-18 19:48:32 +00002<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" exclude-result-prefixes="xs fn xdt">
Stephan Herrmanncb0d3da2010-06-12 00:14:28 +00003 <xsl:param name="version"/>
4 <xsl:param name="versionnext" />
Stephan Herrmannf4785412019-11-05 22:58:00 +01005 <xsl:template match="lifeCycle/required[@name='org.eclipse.jdt.feature.group' and @greedy='false']">
Stephan Herrmann15dea1e2014-04-17 14:03:06 +02006 <xsl:copy>
7 <xsl:attribute name="namespace"><xsl:value-of select="@namespace" /></xsl:attribute>
8 <xsl:attribute name="name">org.eclipse.jdt.core</xsl:attribute>
Stephan Herrmanna4b05082019-11-05 20:56:41 +01009 <xsl:attribute name="range">0.0.0</xsl:attribute>
Stephan Herrmann15dea1e2014-04-17 14:03:06 +020010 <xsl:attribute name="greedy"><xsl:value-of select="@greedy" /></xsl:attribute>
11 </xsl:copy>
12 </xsl:template>
Stephan Herrmanncb0d3da2010-06-12 00:14:28 +000013 <xsl:template match="@range[../@name='org.eclipse.jdt.feature.group']">
14 <xsl:choose>
15 <!-- cannot use "concat('[',$version)" inside match predicate, so choose now: -->
16 <xsl:when test="starts-with(.,concat('[',$version))">
17 <xsl:attribute name="range"><xsl:value-of select="concat('[',$version,',',$versionnext,')')" /></xsl:attribute>
18 </xsl:when>
19 <xsl:otherwise>
20 <xsl:attribute name="range"><xsl:value-of select="."/></xsl:attribute>
21 </xsl:otherwise>
22 </xsl:choose>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000023 </xsl:template>
24 <!-- Whenever you match any node or any attribute -->
25 <xsl:template match="node()|@*">
26 <!-- Copy the current node -->
27 <xsl:copy>
28 <!-- Including any attributes it has and any child nodes -->
29 <xsl:apply-templates select="@*|node()"/>
30 </xsl:copy>
31 </xsl:template>
32</xsl:stylesheet>