This repository has been archived on 2024-10-17. You can view files and clone it, but cannot push or open issues or pull requests.
MahiroOS-jhalfs/BLFS/xsl/get_version.xsl
Pierre Labastie 1fc36f5654 [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)
2021-12-12 18:33:20 +01:00

31 lines
739 B
XML

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:param name="package" select="'gcc'"/>
<xsl:key name="depnode"
match="package|module"
use="name"/>
<xsl:template match="/">
<xsl:apply-templates select="key('depnode',$package)"/>
</xsl:template>
<xsl:template match="package|module">
<xsl:value-of select="./version"/>
<xsl:text>&#xA;</xsl:text>
<xsl:choose>
<xsl:when test="./inst-version">
<xsl:value-of select="./inst-version"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>0</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>