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