source: stylesheets/wget-list.xsl@ 8e1efd0

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 8e1efd0 was 8e1efd0, checked in by Manuel Canales Esparcia <manuel@…>, 17 years ago

Added wget-list.xsl

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@6393 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 2.0 KB
Line 
1<?xml version='1.0' encoding='ISO-8859-1'?>
2
3<!-- Create a list of upstream URLs for packages and patches to be used
4 with wget. -->
5
6<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
7 version="1.0">
8
9 <xsl:output method="text"/>
10
11 <xsl:template match="/">
12 <xsl:apply-templates select="//itemizedlist"/>
13 </xsl:template>
14
15 <xsl:template match="itemizedlist">
16 <xsl:choose>
17 <!-- If both http and ftp URLs are available, output the ftp one if not empty,
18 otherwise output the http URL.-->
19 <xsl:when test="contains(listitem[1]/para,'(HTTP)')
20 and contains(listitem[2]/para,'(FTP)')">
21 <xsl:choose>
22 <xsl:when test="string-length(listitem[2]/para/ulink/@url) &gt; '10'">
23 <xsl:apply-templates select="listitem[2]/para/ulink"/>
24 </xsl:when>
25 <xsl:otherwise>
26 <xsl:apply-templates select="listitem[1]/para/ulink"/>
27 </xsl:otherwise>
28 </xsl:choose>
29 </xsl:when>
30 <!-- Additional packages and patches.-->
31 <xsl:otherwise>
32 <xsl:apply-templates select="listitem/para/ulink"/>
33 </xsl:otherwise>
34 </xsl:choose>
35 </xsl:template>
36
37 <xsl:template match="listitem/para/ulink">
38 <!-- If some package don't have the predefined strings in their
39 name, the next test must be fixed to match it also. Skip possible
40 duplicated URLs due that may be splitted for PDF output -->
41 <xsl:if test="(contains(@url, '.tar.') or contains(@url, '.tgz')
42 or contains(@url, '.zip') or contains(@url, '.patch')) and
43 not(ancestor-or-self::*/@condition = 'pdf')">
44 <xsl:choose>
45 <!-- Fix SourceForge links-->
46 <xsl:when test="contains(@url,'?download')">
47 <xsl:value-of select="substring-before(@url,'?download')"/>
48 </xsl:when>
49 <xsl:otherwise>
50 <xsl:value-of select="@url"/>
51 </xsl:otherwise>
52 </xsl:choose>
53 <xsl:text>&#x0a;</xsl:text>
54 </xsl:if>
55 </xsl:template>
56
57</xsl:stylesheet>
58
Note: See TracBrowser for help on using the repository browser.