source: BLFS/xsl/get_version.xsl@ 4dfe8f9

ablfs-more trunk
Last change on this file since 4dfe8f9 was 1fc36f5, checked in by Pierre Labastie <pierre.labastie@…>, 3 years ago

[BLFS] Ticket #1730: add a .xsl for returning versions

This .xsl, applied to packages.ent, takes the package name as
a string param, then returns:
"version"<nl>"installed version" if both versions are known
"version"<nl>0 if the package is known but not installed
nothing if the package does not exist (case of the groupxx ones)

  • Property mode set to 100644
File size: 739 bytes
Line 
1<?xml version="1.0"?>
2
3<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 version="1.0">
5
6 <xsl:output method="text"/>
7
8 <xsl:param name="package" select="'gcc'"/>
9
10 <xsl:key name="depnode"
11 match="package|module"
12 use="name"/>
13
14 <xsl:template match="/">
15 <xsl:apply-templates select="key('depnode',$package)"/>
16 </xsl:template>
17
18 <xsl:template match="package|module">
19 <xsl:value-of select="./version"/>
20 <xsl:text>&#xA;</xsl:text>
21 <xsl:choose>
22 <xsl:when test="./inst-version">
23 <xsl:value-of select="./inst-version"/>
24 </xsl:when>
25 <xsl:otherwise>
26 <xsl:text>0</xsl:text>
27 </xsl:otherwise>
28 </xsl:choose>
29 </xsl:template>
30
31</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.