diff options
Diffstat (limited to 'stylesheets/wget-list.xsl')
-rw-r--r-- | stylesheets/wget-list.xsl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/stylesheets/wget-list.xsl b/stylesheets/wget-list.xsl new file mode 100644 index 0000000..0b9da99 --- /dev/null +++ b/stylesheets/wget-list.xsl @@ -0,0 +1,35 @@ +<?xml version='1.0' encoding='ISO-8859-1'?> + +<!-- Create a list of upstream URLs for packages and patches to be used + with wget. --> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:output method="text"/> + + <xsl:template match="/"> + <xsl:apply-templates select="//ulink"/> + </xsl:template> + + <xsl:template match="ulink"> + <!-- If some package don't have the predefined strings in their + name, the next test must be fixed to match it also. Skip possible + duplicated URLs due that may be splitted for PDF output --> + <xsl:if test="(contains(@url, '.tar.') or contains(@url, '.tgz') + or contains(@url, '.patch')) and + not(ancestor-or-self::*/@condition = 'pdf')"> + <xsl:choose> + <xsl:when test="contains(@url,'?download')"> + <xsl:value-of select="substring-before(@url,'?download')"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="@url"/> + </xsl:otherwise> + </xsl:choose> + <xsl:text>
</xsl:text> + </xsl:if> + </xsl:template> + +</xsl:stylesheet> + |