Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
Stephan Herrmann | 9c5f7ae | 2010-07-18 19:48:32 +0000 | [diff] [blame] | 2 | <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 Herrmann | cb0d3da | 2010-06-12 00:14:28 +0000 | [diff] [blame] | 3 | <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 Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 15 | </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> |