blob: c3e2bd7eea111ee8d4e7bcb7b5247f0347ec2f66 [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" />
5 <xsl:template match="@range[../@name='org.eclipse.jdt.feature.group']">
6 <xsl:choose>
7 <!-- cannot use "concat('[',$version)" inside match predicate, so choose now: -->
8 <xsl:when test="starts-with(.,concat('[',$version))">
9 <xsl:attribute name="range"><xsl:value-of select="concat('[',$version,',',$versionnext,')')" /></xsl:attribute>
10 </xsl:when>
11 <xsl:otherwise>
12 <xsl:attribute name="range"><xsl:value-of select="."/></xsl:attribute>
13 </xsl:otherwise>
14 </xsl:choose>
Stephan Herrmanndcd87c12010-04-25 10:59:27 +000015 </xsl:template>
16 <!-- Whenever you match any node or any attribute -->
17 <xsl:template match="node()|@*">
18 <!-- Copy the current node -->
19 <xsl:copy>
20 <!-- Including any attributes it has and any child nodes -->
21 <xsl:apply-templates select="@*|node()"/>
22 </xsl:copy>
23 </xsl:template>
24</xsl:stylesheet>