Fix gen-special when an entity is commented out:
[automated_linux_from_scratch.git] / branches / 2.3.x / common / packages.xsl
blob5eab0a77dbcf0c93a4318596a99e783be77b8f50
1 <?xml version='1.0' encoding='ISO-8859-1'?>
3 <!-- $Id$ -->
5 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6 version="1.0">
8 <xsl:output method="text"/>
10 <!-- The libc model used for HLFS -->
11 <xsl:param name="model" select="glibc"/>
13 <!-- The kernel series used for HLFS -->
14 <xsl:param name="kernel" select="2.6"/>
16 <xsl:template match="/">
17 <xsl:apply-templates select="//para"/>
18 </xsl:template>
20 <xsl:template match="para">
21 <xsl:if test="contains(string(),'Download:') and
22 (ancestor::varlistentry[@condition=$model]
23 or not(ancestor::varlistentry[@condition])) and
24 (ancestor::varlistentry[@vendor=$kernel]
25 or not(ancestor::varlistentry[@vendor]))">
26 <xsl:call-template name="package_name">
27 <xsl:with-param name="url" select="ulink/@url"/>
28 </xsl:call-template>
29 <xsl:text>&#xA;</xsl:text>
30 </xsl:if>
31 </xsl:template>
33 <xsl:template name="package_name">
34 <xsl:param name="url" select="foo"/>
35 <xsl:param name="sub-url" select="substring-after($url,'/')"/>
36 <xsl:choose>
37 <xsl:when test="contains($sub-url,'/')">
38 <xsl:call-template name="package_name">
39 <xsl:with-param name="url" select="$sub-url"/>
40 </xsl:call-template>
41 </xsl:when>
42 <xsl:otherwise>
43 <xsl:choose>
44 <xsl:when test="contains($sub-url,'.patch')"/>
45 <xsl:when test="contains($sub-url,'?')">
46 <xsl:value-of select="substring-before($sub-url,'?')"/>
47 </xsl:when>
48 <xsl:otherwise>
49 <xsl:value-of select="$sub-url"/>
50 </xsl:otherwise>
51 </xsl:choose>
52 </xsl:otherwise>
53 </xsl:choose>
54 </xsl:template>
56 </xsl:stylesheet>