ablfs
Last change
on this file since c39db54 was 18a2bea, checked in by Pierre Labastie <pierre@…>, 13 years ago |
Add a "version" parameter to bump.xsl
|
-
Property mode
set to
100644
|
File size:
1.5 KB
|
Line | |
---|
1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 |
|
---|
3 | <!-- $Id: bump.xsl 21 2012-02-16 15:06:19Z labastie $ -->
|
---|
4 |
|
---|
5 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
6 | version="1.0">
|
---|
7 |
|
---|
8 | <xsl:param name="packages" select="'packages.xml'"/>
|
---|
9 | <xsl:param name="package" select="''"/>
|
---|
10 | <xsl:param name="version" select="'N'"/>
|
---|
11 |
|
---|
12 | <xsl:variable name="vers">
|
---|
13 | <xsl:choose>
|
---|
14 | <xsl:when test="$version='N'">
|
---|
15 | <xsl:value-of select=
|
---|
16 | "document($packages)//package[string(name)=$package]/version"/>
|
---|
17 | </xsl:when>
|
---|
18 | <xsl:otherwise>
|
---|
19 | <xsl:value-of select="$version"/>
|
---|
20 | </xsl:otherwise>
|
---|
21 | </xsl:choose>
|
---|
22 | </xsl:variable>
|
---|
23 |
|
---|
24 | <xsl:output
|
---|
25 | method="xml"
|
---|
26 | encoding="ISO-8859-1"
|
---|
27 | doctype-system="PACKDESC"/>
|
---|
28 |
|
---|
29 | <xsl:template match="/">
|
---|
30 | <sublist>
|
---|
31 | <xsl:copy-of select="./sublist/name"/>
|
---|
32 | <xsl:apply-templates select=".//package"/>
|
---|
33 | <xsl:if test="not(.//package[string(name)=$package])">
|
---|
34 | <package>
|
---|
35 | <name><xsl:value-of select="$package"/></name>
|
---|
36 | <version><xsl:value-of select="$vers"/></version>
|
---|
37 | </package>
|
---|
38 | </xsl:if>
|
---|
39 | </sublist>
|
---|
40 | </xsl:template>
|
---|
41 |
|
---|
42 | <xsl:template match="package">
|
---|
43 | <xsl:choose>
|
---|
44 | <xsl:when test="string(name)=$package">
|
---|
45 | <package>
|
---|
46 | <name><xsl:value-of select="name"/></name>
|
---|
47 | <version><xsl:value-of select="$vers"/></version>
|
---|
48 | </package>
|
---|
49 | </xsl:when>
|
---|
50 | <xsl:otherwise>
|
---|
51 | <xsl:copy-of select='.'/>
|
---|
52 | </xsl:otherwise>
|
---|
53 | </xsl:choose>
|
---|
54 | </xsl:template>
|
---|
55 |
|
---|
56 | </xsl:stylesheet>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.