Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
Stephan Herrmann | cb0d3da | 2010-06-12 00:14:28 +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= |
| 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 Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 17 | </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> |