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" /> |
Stephan Herrmann | 15dea1e | 2014-04-17 14:03:06 +0200 | [diff] [blame] | 5 | <xsl:template match="lifeCycle/required[@name='org.eclipse.jdt.feature.group' and @greedy='false']"> |
| 6 | <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> |
| 9 | <xsl:attribute name="range"><xsl:value-of select="@range" /></xsl:attribute> |
| 10 | <xsl:attribute name="greedy"><xsl:value-of select="@greedy" /></xsl:attribute> |
| 11 | </xsl:copy> |
| 12 | </xsl:template> |
Stephan Herrmann | cb0d3da | 2010-06-12 00:14:28 +0000 | [diff] [blame] | 13 | <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 Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 23 | </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> |