changeset 728:d900707102c6

Regenerated.
author Ruslan Ermilov <ru@nginx.com>
date Sat, 13 Oct 2012 18:16:23 +0000
parents b2b10d564893
children 024fdcdc3574
files xslt/download.xslt xslt/version.xslt xslt/versions.xslt
diffstat 3 files changed, 40 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/xslt/download.xslt	Sat Oct 13 18:15:55 2012 +0000
+++ b/xslt/download.xslt	Sat Oct 13 18:16:23 2012 +0000
@@ -1,13 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
-   <xsl:template match="download"> 
-      <table width="100%">
-         <xsl:apply-templates select="item"/>
-      </table>
+   <xsl:template match="download">
+
+      <xsl:variable select="@last" name="last"/>
+
+      <xsl:for-each select="document(concat($XML, '/versions.xml'))                 /versions/download[@tag = current()/@tag]">
+
+         <table width="100%">
+
+            <xsl:apply-templates select="item[position() &lt;= $last]"/>
+
+         </table>
+      </xsl:for-each>
    </xsl:template>
 
-   <xsl:template match="download/item[position() &lt;= ../@last]">
+   <xsl:template match="download/item">
 
       <tr>
 
@@ -18,13 +26,33 @@
                <a>
 
                   <xsl:attribute name="href">
+
                      <xsl:text>/</xsl:text>
-                     <xsl:value-of select="/article/@lang"/>
-                     <xsl:text>/</xsl:text>
-                     <xsl:value-of select="../@changes"/>
+                     <xsl:value-of select="$LANG"/>
+                     <xsl:text>/CHANGES</xsl:text>
+
+                     <xsl:if test="$LANG != 'en'">
+                        <xsl:text>.</xsl:text>
+                        <xsl:value-of select="$LANG"/>
+                     </xsl:if>
+
+                     <xsl:if test="../@changes != ''">
+                        <xsl:text>-</xsl:text>
+                        <xsl:value-of select="../@changes"/>
+                     </xsl:if>
                   </xsl:attribute>
 
-                  <xsl:value-of select="../@changes"/>
+                  <xsl:text>CHANGES</xsl:text>
+
+                  <xsl:if test="$LANG != 'en'">
+                     <xsl:text>.</xsl:text>
+                     <xsl:value-of select="$LANG"/>
+                  </xsl:if>
+
+                  <xsl:if test="../@changes != ''">
+                     <xsl:text>-</xsl:text>
+                     <xsl:value-of select="../@changes"/>
+                  </xsl:if>
 
                </a>
             </xsl:if>
@@ -109,6 +137,4 @@
       </tr>
    </xsl:template>
 
-   <xsl:template match="download/item[position() &gt; ../@last]"/>
-
 </xsl:stylesheet>
--- a/xslt/version.xslt	Sat Oct 13 18:15:55 2012 +0000
+++ b/xslt/version.xslt	Sat Oct 13 18:16:23 2012 +0000
@@ -6,7 +6,7 @@
    <xsl:output method="text"/>
 
    <xsl:template match="/versions">
-      <xsl:value-of select=" normalize-space(*[local-name() = $VERSION])"/>
+      <xsl:apply-templates select="download[@tag=$VERSION][1]/item[1]/@ver"/>
    </xsl:template>
 
 </xsl:stylesheet>
--- a/xslt/versions.xslt	Sat Oct 13 18:15:55 2012 +0000
+++ b/xslt/versions.xslt	Sat Oct 13 18:16:23 2012 +0000
@@ -3,12 +3,12 @@
 
    <xsl:template match="development_version">
 
-      <xsl:value-of select=" normalize-space(document(concat($XML, '/versions.xml'))                       /versions/development)"/>
+      <xsl:apply-templates select="document(concat($XML, '/versions.xml'))                 /versions/download[@tag='development'][1]/item[1]/@ver"/>
    </xsl:template>
 
    <xsl:template match="stable_version">
 
-      <xsl:value-of select=" normalize-space(document(concat($XML, '/versions.xml'))                       /versions/stable)"/>
+      <xsl:apply-templates select="document(concat($XML, '/versions.xml'))                 /versions/download[@tag='stable'][1]/item[1]/@ver"/>
    </xsl:template>
 
 </xsl:stylesheet>