lfs-ru/stylesheets/wget-list.xsl

37 lines
1.1 KiB
XML
Raw Normal View History

2024-01-28 20:34:52 +03:00
<?xml version='1.0' encoding='UTF-8'?>
2022-06-01 23:43:00 +03:00
<!-- 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"
2024-02-01 20:22:41 +03:00
version="1.0">
2022-06-01 23:43:00 +03:00
<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 split for PDF output -->
2022-06-01 23:43:00 +03:00
<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>
2024-02-01 20:22:41 +03:00
<xsl:text>&#xA;</xsl:text>
2022-06-01 23:43:00 +03:00
</xsl:if>
</xsl:template>
</xsl:stylesheet>