changeset 373:e179a6487bbd

Regenerated.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 30 Jan 2012 09:55:08 +0000
parents 978b9e3897f7
children a413dffb0557
files xslt/link.xslt
diffstat 1 files changed, 13 insertions(+), 55 deletions(-) [+]
line wrap: on
line diff
--- a/xslt/link.xslt	Mon Jan 30 09:54:25 2012 +0000
+++ b/xslt/link.xslt	Mon Jan 30 09:55:08 2012 +0000
@@ -1,60 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
 
-   <xsl:template match="a[starts-with(@href, '/')                 and string() = ''                 and contains(@href, '.xml')]">
-
-      <a>
-
-         <xsl:attribute name="href">
-            <xsl:choose>
-
-               <xsl:when test="starts-with(@href, $DIRNAME)">
-
-                  <xsl:value-of select=" substring-after(document(concat($XML, @href))/article/@link                               |document(concat($XML, @href))/module/@link,                               $DIRNAME)"/>
-               </xsl:when>
-
-               <xsl:otherwise>
-
-                  <xsl:value-of select=" concat($ROOT, document(concat($XML, @href))/article/@link                             |document(concat($XML, @href))/module/@link)"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:attribute>
-
-         <xsl:value-of select="  document(concat($XML, @href))/article/@name        |document(concat($XML, @href))/module/@name"/>
-
-      </a>
-   </xsl:template>
-
-   <xsl:template match="a[starts-with(@href, '/')                 and string()                 and contains(@href, '.xml')]">
-
-      <a>
-
-         <xsl:attribute name="href">
-            <xsl:choose>
-
-               <xsl:when test="starts-with(@href, $DIRNAME)">
-
-                  <xsl:value-of select=" substring-after(document(concat($XML, @href))/article/@link                               |document(concat($XML, @href))/module/@link,                               $DIRNAME)"/>
-               </xsl:when>
-
-               <xsl:otherwise>
-
-                  <xsl:value-of select=" concat($ROOT, document(concat($XML, @href))/article/@link                             |document(concat($XML, @href))/module/@link)"/>
-               </xsl:otherwise>
-            </xsl:choose>
-         </xsl:attribute>
-
-         <xsl:apply-templates/>
-
-      </a>
-   </xsl:template>
-
-   <xsl:template match="a"> 
-      <a href="{@href}">
-         <xsl:apply-templates/>
-      </a>
-   </xsl:template>
-
    <xsl:template match="img"> 
       <img src="{@href}">
          <xsl:apply-templates/>
@@ -86,7 +32,19 @@
    <xsl:template match="link[@doc and not(@id)]">
 
       <a href="{substring-before(@doc, '.xml')}.html">
-         <xsl:apply-templates/>
+         <xsl:choose>
+
+            <xsl:when test="count(node()) != 0">
+
+               <xsl:apply-templates/>
+            </xsl:when>
+
+            <xsl:otherwise>
+
+               <xsl:value-of select=" document(@doc)/article/@name | document(@doc)/module/@name"/>
+            </xsl:otherwise>
+         </xsl:choose>
+
       </a>
    </xsl:template>