source: common/packages.xsl@ d39252b

ablfs-more legacy trunk
Last change on this file since d39252b was c9598f2, checked in by Pierre Labastie <pierre@…>, 8 years ago

Adaptation for merged LFS books. A few typos with no consequence are corrected too.

  • Property mode set to 100644
File size: 2.5 KB
RevLine 
[a160d86]1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!-- $Id$ -->
4
5<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
7
8 <xsl:output method="text"/>
9
[139c34e]10 <!-- The libc model used for HLFS -->
[c9598f2]11 <xsl:param name="model" select="'glibc'"/>
[139c34e]12
13 <!-- The kernel series used for HLFS -->
[c9598f2]14 <xsl:param name="kernel" select="'2.6'"/>
[139c34e]15
[c9598f2]16 <!-- Should we include a package manager? -->
17 <xsl:param name="pkgmngt" select="'n'"/>
18
19 <!-- The system for LFS: sysv of systemd -->
20 <xsl:param name="revision" select="'sysv'"/>
[7072e1f]21
[a160d86]22 <xsl:template match="/">
23 <xsl:apply-templates select="//para"/>
[7072e1f]24 <xsl:if test="$pkgmngt='y'">
25 <xsl:apply-templates
26 select="document('packageManager.xml')//sect1[@id='package']//para"/>
27 </xsl:if>
[a160d86]28 </xsl:template>
29
30 <xsl:template match="para">
[139c34e]31 <xsl:if test="contains(string(),'Download:') and
32 (ancestor::varlistentry[@condition=$model]
33 or not(ancestor::varlistentry[@condition])) and
[c9598f2]34 (ancestor::varlistentry[@revision=$revision]
35 or not(ancestor::varlistentry[@revision])) and
[139c34e]36 (ancestor::varlistentry[@vendor=$kernel]
37 or not(ancestor::varlistentry[@vendor]))">
[a160d86]38 <xsl:call-template name="package_name">
39 <xsl:with-param name="url" select="ulink/@url"/>
40 </xsl:call-template>
41 </xsl:if>
42 </xsl:template>
43
44 <xsl:template name="package_name">
45 <xsl:param name="url" select="foo"/>
[7072e1f]46 <xsl:variable name="sub-url" select="substring-after($url,'/')"/>
[a160d86]47 <xsl:choose>
[ff9938f]48 <xsl:when test="contains($sub-url,'/') and
49 not(substring-after($sub-url,'/')='')">
[a160d86]50 <xsl:call-template name="package_name">
51 <xsl:with-param name="url" select="$sub-url"/>
52 </xsl:call-template>
53 </xsl:when>
54 <xsl:otherwise>
55 <xsl:choose>
56 <xsl:when test="contains($sub-url,'.patch')"/>
57 <xsl:when test="contains($sub-url,'?')">
58 <xsl:value-of select="substring-before($sub-url,'?')"/>
[7072e1f]59 <xsl:text>&#xA;</xsl:text>
[a160d86]60 </xsl:when>
[ff9938f]61 <xsl:when test="contains($sub-url,'/')">
62 <xsl:value-of select="substring-before($sub-url,'/')"/>
63 <xsl:text>&#xA;</xsl:text>
64 </xsl:when>
[a160d86]65 <xsl:otherwise>
66 <xsl:value-of select="$sub-url"/>
[7072e1f]67 <xsl:text>&#xA;</xsl:text>
[a160d86]68 </xsl:otherwise>
69 </xsl:choose>
70 </xsl:otherwise>
71 </xsl:choose>
72 </xsl:template>
73
74</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.