<?xml version="1.0" encoding="utf-8"?>

<!--
list.xsl

Based on Mandriva list.xsl, which is:

Copyright (c) 2006 Mandriva
Author: Florent Villard <warly@mandriva.com>
Published under the GPL license.
-->

<xsl:stylesheet version="1.0"
         xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:output method="text" omit-xml-declaration="yes" indent="no" encoding="utf-8"/>
  <xsl:output doctype-public="-//W3C//DTD HTML 4.0//EN"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
          <xsl:apply-templates select="mirrors"/>
  </xsl:template>

  <xsl:template name="newLine">
<xsl:text>
</xsl:text>
  </xsl:template>

  <xsl:template name="nNewLine">
    <xsl:param name="n" select="0"/>
    <xsl:if test="$n &gt; 0">
    <xsl:call-template name="newLine"/>
    <xsl:call-template name="nNewLine">
      <xsl:with-param name="n" select="$n - 1" />
    </xsl:call-template>
    </xsl:if>
  </xsl:template>

<xsl:template match="mirrors">
        <xsl:apply-templates select="mirror"/>
</xsl:template>

<xsl:template match="mirror">
	<xsl:apply-templates select="ftp"/>
	<xsl:apply-templates select="http"/>
	<xsl:apply-templates select="rsync"/>
</xsl:template>

<xsl:template match="ftp">
	<xsl:call-template name="address"/>
</xsl:template>
<xsl:template match="http">
	<xsl:call-template name="address"/>
</xsl:template>
<xsl:template match="rsync">
	<xsl:call-template name="address"/>
</xsl:template>

<xsl:template name="address">
        <xsl:apply-templates select="../location"/>
	<xsl:text>,check=</xsl:text><xsl:value-of select="../@check"/><xsl:text>,restricted=</xsl:text><xsl:value-of select="../@restricted"/><xsl:text>,bw=</xsl:text><xsl:value-of select="../bw"/><xsl:text>,url=</xsl:text><xsl:value-of select="."/>
        <xsl:call-template name="newLine"/>
</xsl:template>

<xsl:template match="location">
        <xsl:text>country=</xsl:text><xsl:value-of select="."/>
</xsl:template>

</xsl:stylesheet>


