blob: 5efd50e997d153265559087173160cd25fb8427d [file] [log] [blame]
Stephan Herrmanndcd87c12010-04-25 10:59:27 +00001<?xml version="1.0"?>
Stephan Herrmanncb0d3da2010-06-12 00:14:28 +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=
3"http://www.w3.org/2004/07/xpath-functions" xmlns:xdt="http://www.w3.org/2004/07/xpath-datatypes" exclude-result-prefixes="xs fn xdt
4">
5 <xsl:param name="version"/>
6 <xsl:param name="versionnext" />
7 <xsl:template match="@range[../@name='org.eclipse.jdt.feature.group']">
8 <xsl:choose>
9 <!-- cannot use "concat('[',$version)" inside match predicate, so choose now: -->
10 <xsl:when test="starts-with(.,concat('[',$version))">
11 <xsl:attribute name="range"><xsl:value-of select="concat('[',$version,',',$versionnext,')')" /></xsl:attribute>
12 </xsl:when>
13 <xsl:otherwise>
14 <xsl:attribute name="range"><xsl:value-of select="."/></xsl:attribute>
15 </xsl:otherwise>
16 </xsl:choose>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000017 </xsl:template>
18 <!-- Whenever you match any node or any attribute -->
19 <xsl:template match="node()|@*">
20 <!-- Copy the current node -->
21 <xsl:copy>
22 <!-- Including any attributes it has and any child nodes -->
23 <xsl:apply-templates select="@*|node()"/>
24 </xsl:copy>
25 </xsl:template>
26</xsl:stylesheet>