El Sábado, 17 de Junio de 2006 17:48, George Boudreau escribió:

>   The least intrusive method would be to produce a 'packages' file
> format. However a format with the full package name would be acceptable.
> I will look at the damage to the master.sh scripts later today if you
> want to create a XSL script.

Attached.

-- 
Manuel Canales Esparcia
Usuario de LFS nº2886:       http://www.linuxfromscratch.org
LFS en castellano: http://www.escomposlinux.org/lfs-es http://www.lfs-es.com
TLDP-ES:                           http://es.tldp.org
<?xml version='1.0' encoding='ISO-8859-1'?>

<!-- $Id: urls.xsl 2704 2006-05-23 18:31:02Z manuel $ -->

<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="//para"/>
  </xsl:template>

  <xsl:template match="para">
    <xsl:if test="contains(string(),'Download:')">
      <xsl:call-template name="package_name">
        <xsl:with-param name="url" select="ulink/@url"/>
      </xsl:call-template>
      <xsl:text>&#xA;</xsl:text>
    </xsl:if>
  </xsl:template>

  <xsl:template name="package_name">
    <xsl:param name="url" select="foo"/>
    <xsl:param name="sub-url" select="substring-after($url,'/')"/>
    <xsl:choose>
      <xsl:when test="contains($sub-url,'/')">
        <xsl:call-template name="package_name">
          <xsl:with-param name="url" select="$sub-url"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:choose>
          <xsl:when test="contains($sub-url,'.patch')"/>
          <xsl:when test="contains($sub-url,'?')">
            <xsl:value-of select="substring-before($sub-url,'?')"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$sub-url"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

</xsl:stylesheet>
-- 
http://linuxfromscratch.org/mailman/listinfo/alfs-discuss
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to