]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed bug #851598 links to legalnotice in html are broken.
authorBob Stayton <bobs@sagehill.net>
Thu, 26 May 2005 07:27:34 +0000 (07:27 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 26 May 2005 07:27:34 +0000 (07:27 +0000)
xsl/html/chunk-common.xsl
xsl/html/manifest.xsl
xsl/html/titlepage.xsl

index e89a5cc94bb3b81e68e0908b24dde66938f263c6..340f403e10b281ea223b80f68bda1278a1026c8b 100644 (file)
       </xsl:call-template>
     </xsl:when>
 
-    <xsl:when test="name($node)='preface'">1</xsl:when>
-    <xsl:when test="name($node)='chapter'">1</xsl:when>
-    <xsl:when test="name($node)='appendix'">1</xsl:when>
-    <xsl:when test="name($node)='article'">1</xsl:when>
-    <xsl:when test="name($node)='part'">1</xsl:when>
-    <xsl:when test="name($node)='reference'">1</xsl:when>
-    <xsl:when test="name($node)='refentry'">1</xsl:when>
-    <xsl:when test="name($node)='index' and $generate.index != 0
-                    and (name($node/parent::*) = 'article'
-                    or name($node/parent::*) = 'book'
-                    or name($node/parent::*) = 'part'
+    <xsl:when test="local-name($node)='preface'">1</xsl:when>
+    <xsl:when test="local-name($node)='chapter'">1</xsl:when>
+    <xsl:when test="local-name($node)='appendix'">1</xsl:when>
+    <xsl:when test="local-name($node)='article'">1</xsl:when>
+    <xsl:when test="local-name($node)='part'">1</xsl:when>
+    <xsl:when test="local-name($node)='reference'">1</xsl:when>
+    <xsl:when test="local-name($node)='refentry'">1</xsl:when>
+    <xsl:when test="local-name($node)='index' and $generate.index != 0
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
                     )">1</xsl:when>
-    <xsl:when test="name($node)='bibliography'
-                    and (name($node/parent::*) = 'article'
-                    or name($node/parent::*) = 'book'
-                    or name($node/parent::*) = 'part'
+    <xsl:when test="local-name($node)='bibliography'
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
                     )">1</xsl:when>
-    <xsl:when test="name($node)='glossary'
-                    and (name($node/parent::*) = 'article'
-                    or name($node/parent::*) = 'book'
-                    or name($node/parent::*) = 'part'
+    <xsl:when test="local-name($node)='glossary'
+                    and (local-name($node/parent::*) = 'article'
+                    or local-name($node/parent::*) = 'book'
+                    or local-name($node/parent::*) = 'part'
                     )">1</xsl:when>
-    <xsl:when test="name($node)='colophon'">1</xsl:when>
-    <xsl:when test="name($node)='book'">1</xsl:when>
-    <xsl:when test="name($node)='set'">1</xsl:when>
-    <xsl:when test="name($node)='setindex'">1</xsl:when>
+    <xsl:when test="local-name($node)='colophon'">1</xsl:when>
+    <xsl:when test="local-name($node)='book'">1</xsl:when>
+    <xsl:when test="local-name($node)='set'">1</xsl:when>
+    <xsl:when test="local-name($node)='setindex'">1</xsl:when>
+    <xsl:when test="local-name($node)='legalnotice'
+                    and $generate.legalnotice.link != 0">1</xsl:when>
     <xsl:otherwise>0</xsl:otherwise>
   </xsl:choose>
 </xsl:template>
         <xsl:value-of select="$root.filename"/>
         <xsl:value-of select="$html.ext"/>
       </xsl:when>
+      <!-- Special case -->
+      <xsl:when test="self::legalnotice and $generate.legalnotice.link != 0">
+        <xsl:variable name="id">
+          <xsl:call-template name="object.id"/>
+        </xsl:variable>
+        <xsl:value-of select="concat('ln-',$id,$html.ext)"/>
+      </xsl:when>
       <!-- if there's no dbhtml filename, and if we're to use IDs as -->
       <!-- filenames, then use the ID to generate the filename. -->
       <xsl:when test="@id and $use.id.as.filename != 0">
   <xsl:variable name="row1" select="$navig.showtitles != 0"/>
   <xsl:variable name="row2" select="count($prev) &gt; 0
                                     or (count($up) &gt; 0 
-                                       and generate-id($up) != generate-id($home)
+                                        and generate-id($up) != generate-id($home)
                                         and $navig.showtitles != 0)
                                     or count($next) &gt; 0"/>
 
               <th width="60%" align="center">
                 <xsl:choose>
                   <xsl:when test="count($up) > 0
-                                 and generate-id($up) != generate-id($home)
+                                  and generate-id($up) != generate-id($home)
                                   and $navig.showtitles != 0">
                     <xsl:apply-templates select="$up" mode="object.title.markup"/>
                   </xsl:when>
               <td width="20%" align="center">
                 <xsl:choose>
                   <xsl:when test="count($up)&gt;0
-                                 and generate-id($up) != generate-id($home)">
-                   <a accesskey="u">
+                                  and generate-id($up) != generate-id($home)">
+                    <a accesskey="u">
                       <xsl:attribute name="href">
                         <xsl:call-template name="href.target">
                           <xsl:with-param name="object" select="$up"/>
     <xsl:param name="direction" select="next"/>
     <xsl:variable name="navtext">
         <xsl:choose>
-           <xsl:when test="$direction = 'prev'">
-               <xsl:call-template name="gentext.nav.prev"/>
-           </xsl:when>
-           <xsl:when test="$direction = 'next'">
-               <xsl:call-template name="gentext.nav.next"/>
-           </xsl:when>
-           <xsl:when test="$direction = 'up'">
-               <xsl:call-template name="gentext.nav.up"/>
-           </xsl:when>
-           <xsl:when test="$direction = 'home'">
-               <xsl:call-template name="gentext.nav.home"/>
-           </xsl:when>
-           <xsl:otherwise>
-               <xsl:text>xxx</xsl:text>
-           </xsl:otherwise>
-       </xsl:choose>
+            <xsl:when test="$direction = 'prev'">
+                <xsl:call-template name="gentext.nav.prev"/>
+            </xsl:when>
+            <xsl:when test="$direction = 'next'">
+                <xsl:call-template name="gentext.nav.next"/>
+            </xsl:when>
+            <xsl:when test="$direction = 'up'">
+                <xsl:call-template name="gentext.nav.up"/>
+            </xsl:when>
+            <xsl:when test="$direction = 'home'">
+                <xsl:call-template name="gentext.nav.home"/>
+            </xsl:when>
+            <xsl:otherwise>
+                <xsl:text>xxx</xsl:text>
+            </xsl:otherwise>
+        </xsl:choose>
     </xsl:variable>
 
     <xsl:choose>
-       <xsl:when test="$navig.graphics != 0">
-           <img>
-               <xsl:attribute name="src">
-                   <xsl:value-of select="$navig.graphics.path"/>
-                   <xsl:value-of select="$direction"/>
-                   <xsl:value-of select="$navig.graphics.extension"/>
-               </xsl:attribute>
-               <xsl:attribute name="alt">
-                   <xsl:value-of select="$navtext"/>
-               </xsl:attribute>
-           </img>
-       </xsl:when>
-       <xsl:otherwise>
-           <xsl:value-of select="$navtext"/>
-       </xsl:otherwise>
+        <xsl:when test="$navig.graphics != 0">
+            <img>
+                <xsl:attribute name="src">
+                    <xsl:value-of select="$navig.graphics.path"/>
+                    <xsl:value-of select="$direction"/>
+                    <xsl:value-of select="$navig.graphics.extension"/>
+                </xsl:attribute>
+                <xsl:attribute name="alt">
+                    <xsl:value-of select="$navtext"/>
+                </xsl:attribute>
+            </img>
+        </xsl:when>
+        <xsl:otherwise>
+            <xsl:value-of select="$navtext"/>
+        </xsl:otherwise>
     </xsl:choose>
 </xsl:template>
 
       <xsl:call-template name="user.header.navigation"/>
 
       <xsl:call-template name="header.navigation">
-       <xsl:with-param name="prev" select="$prev"/>
-       <xsl:with-param name="next" select="$next"/>
-       <xsl:with-param name="nav.context" select="$nav.context"/>
+        <xsl:with-param name="prev" select="$prev"/>
+        <xsl:with-param name="next" select="$next"/>
+        <xsl:with-param name="nav.context" select="$nav.context"/>
       </xsl:call-template>
 
       <xsl:call-template name="user.header.content"/>
       <xsl:call-template name="user.footer.content"/>
 
       <xsl:call-template name="footer.navigation">
-       <xsl:with-param name="prev" select="$prev"/>
-       <xsl:with-param name="next" select="$next"/>
-       <xsl:with-param name="nav.context" select="$nav.context"/>
+        <xsl:with-param name="prev" select="$prev"/>
+        <xsl:with-param name="next" select="$next"/>
+        <xsl:with-param name="nav.context" select="$nav.context"/>
       </xsl:call-template>
 
       <xsl:call-template name="user.footer.navigation"/>
index a546a0ea6b2b7a8ceef8767e1d5a2a9dd6da4c24..42a5080cc91414618729c89f15acb855ee662908 100644 (file)
@@ -1,6 +1,6 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
-               version="1.0"
+                version="1.0"
                 exclude-result-prefixes="doc">
 
 <!-- ********************************************************************
@@ -91,7 +91,9 @@
           <xsl:value-of select="$base.dir"/>
         </xsl:if>
       </xsl:with-param>
-      <xsl:with-param name="base.name" select="concat('ln-',$id,$html.ext)"/>
+      <xsl:with-param name="base.name">
+        <xsl:apply-templates mode="chunk-filename" select="."/>
+      </xsl:with-param>
     </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
   </xsl:if>
index 0ba0c2d3ce2ad7fc659d11a202302c4e085897ba..b6d890623414bf61a4107954b88ad335a417af76 100644 (file)
       <xsl:variable name="filename">
         <xsl:call-template name="make-relative-filename">
           <xsl:with-param name="base.dir" select="$base.dir"/>
-          <xsl:with-param name="base.name" select="concat('ln-',$id,$html.ext)"/>
+         <xsl:with-param name="base.name">
+            <xsl:apply-templates mode="chunk-filename" select="."/>
+         </xsl:with-param>
         </xsl:call-template>
       </xsl:variable>
 
         <xsl:apply-templates select="." mode="title.markup"/>
       </xsl:variable>
 
-      <a href="{concat('ln-',$id,$html.ext)}">
+      <xsl:variable name="href">
+        <xsl:apply-templates mode="chunk-filename" select="."/>
+      </xsl:variable>
+
+      <a href="{$href}">
         <xsl:copy-of select="$title"/>
       </a>