source: stylesheets/wget-list.xsl@ eede1a3

11.0 11.1 11.2 11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since eede1a3 was ccded7e, checked in by Xi Ruoyao <xry111@…>, 3 years ago

clean up unused SVN prop entries

  • Property mode set to 100644
File size: 3.6 KB
RevLine 
[8e1efd0]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
[7818e780]11 <!-- Define the generated wget file type:
12 ftpmirror - the one used to check FTP mirrors (default)
13 full - the one used to test all download links found in the book
14 -->
15 <xsl:param name="list_mode" select="ftpmirror"/>
16
[8e1efd0]17 <xsl:template match="/">
[7818e780]18 <xsl:choose>
19 <xsl:when test="$list_mode = 'full'">
20 <xsl:apply-templates select="//ulink" mode="full"/>
21 </xsl:when>
22 <xsl:otherwise>
23 <xsl:apply-templates select="//itemizedlist"/>
24 </xsl:otherwise>
25 </xsl:choose>
[8e1efd0]26 </xsl:template>
27
28 <xsl:template match="itemizedlist">
29 <xsl:choose>
30 <!-- If both http and ftp URLs are available, output the ftp one if not empty,
31 otherwise output the http URL.-->
32 <xsl:when test="contains(listitem[1]/para,'(HTTP)')
33 and contains(listitem[2]/para,'(FTP)')">
34 <xsl:choose>
[725d5f8]35 <xsl:when test="string-length(listitem[2]/para/ulink/@url) &gt; '10'">
36 <xsl:apply-templates select="listitem[2]/para/ulink"/>
[8e1efd0]37 </xsl:when>
38 <xsl:otherwise>
[725d5f8]39 <xsl:apply-templates select="listitem[1]/para/ulink"/>
[8e1efd0]40 </xsl:otherwise>
41 </xsl:choose>
42 </xsl:when>
43 <!-- Additional packages and patches.-->
44 <xsl:otherwise>
45 <xsl:apply-templates select="listitem/para/ulink"/>
46 </xsl:otherwise>
47 </xsl:choose>
48 </xsl:template>
49
50 <xsl:template match="listitem/para/ulink">
[7818e780]51 <!-- The next strings need be revised periodically to add missing
52 files or to skip false positives. Skip also possible
53 duplicated URLs that may be splitted for PDF output -->
54 <xsl:if test="(contains(@url, '.gz') or contains(@url, '.bz2')
55 or contains(@url, '.tgz') or contains(@url, '.tar')
56 or contains(@url, 'patch.txt') or contains(@url, '.zip')
57 or contains(@url, '.patch') or contains(@url, '/patch.'))
58 and not(ancestor-or-self::*/@condition = 'pdf')">
[8e1efd0]59 <xsl:choose>
60 <!-- Fix SourceForge links-->
61 <xsl:when test="contains(@url,'?download')">
62 <xsl:value-of select="substring-before(@url,'?download')"/>
63 </xsl:when>
64 <xsl:otherwise>
65 <xsl:value-of select="@url"/>
66 </xsl:otherwise>
67 </xsl:choose>
68 <xsl:text>&#x0a;</xsl:text>
69 </xsl:if>
70 </xsl:template>
71
[7818e780]72 <xsl:template match="ulink" mode="full">
73 <!-- The next strings need be revised periodically to add missing
74 files or to skip false positives. Skip also possible
75 duplicated URLs that may be splitted for PDF output -->
76 <xsl:if test="(contains(@url, '.gz') or contains(@url, '.bz2')
77 or contains(@url, '.tgz') or contains(@url, '.tar')
78 or contains(@url, '.txt') or contains(@url, 'compressdoc')
79 or contains(@url, '.zip') or contains(@url, '.patch')
80 or contains(@url, '/patch.') or contains(@url, 'md5sums')
81 or contains(@url, 'mozconfig'))
82 and not(contains(@url, '?url'))
83 and not(ancestor-or-self::*/@condition = 'pdf')">
84 <!-- To list all URls, included html files, wiki pages, home pages, and
85 mailto: links, comment-out the above xsl:if and uncomment the next one. -->
86 <!--
87 <xsl:if test="not(ancestor-or-self::*/@condition = 'pdf')">
88 -->
89 <xsl:value-of select="@url"/>
90 <xsl:text>&#x0a;</xsl:text>
91 </xsl:if>
92 </xsl:template>
[8e1efd0]93
[7818e780]94</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.