gnome-doc-utils r1106 - in trunk: . xslt/docbook/common xslt/docbook/html



Author: shaunm
Date: Fri Jun 27 16:24:06 2008
New Revision: 1106
URL: http://svn.gnome.org/viewvc/gnome-doc-utils?rev=1106&view=rev

Log:
* xslt/docbook/common/db-title.xsl:
* xslt/docbook/common/db-xref.xsl:
- Correctly handle content and tooltips for links to anchor elements

* xslt/docbook/html/db2html-division.xsl:
- Don't reprocess book titles when title and bookinfo/title exist


Modified:
   trunk/ChangeLog
   trunk/xslt/docbook/common/db-title.xsl
   trunk/xslt/docbook/common/db-xref.xsl
   trunk/xslt/docbook/html/db2html-division.xsl

Modified: trunk/xslt/docbook/common/db-title.xsl
==============================================================================
--- trunk/xslt/docbook/common/db-title.xsl	(original)
+++ trunk/xslt/docbook/common/db-title.xsl	Fri Jun 27 16:24:06 2008
@@ -22,7 +22,7 @@
 
 <!--!!==========================================================================
 DocBook Titles
-:Requires: gettext
+:Requires: db-chunk gettext
 -->
 
 
@@ -87,6 +87,21 @@
 </xsl:template>
 
 <!-- = db.title.mode % appendix = -->
+<xsl:template mode="db.title.mode" match="anchor">
+  <xsl:variable name="target_chunk_id">
+    <xsl:call-template name="db.chunk.chunk-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="target_chunk" select="key('idkey', $target_chunk_id)"/>
+  <xsl:choose>
+    <xsl:when test="$target_chunk">
+      <xsl:apply-templates mode="db.title.mode" select="$target_chunk"/>
+    </xsl:when>
+  </xsl:choose>
+</xsl:template>
+
+<!-- = db.title.mode % appendix = -->
 <xsl:template mode="db.title.mode" match="appendix">
   <xsl:choose>
     <xsl:when test="title">

Modified: trunk/xslt/docbook/common/db-xref.xsl
==============================================================================
--- trunk/xslt/docbook/common/db-xref.xsl	(original)
+++ trunk/xslt/docbook/common/db-xref.xsl	Fri Jun 27 16:24:06 2008
@@ -116,12 +116,35 @@
 REMARK: Document this mode
 -->
 <xsl:template mode="db.xref.content.mode" match="*">
-  <xsl:message>
-    <xsl:text>No cross reference formatter found for </xsl:text>
-    <xsl:value-of select="local-name(.)"/>
-    <xsl:text> elements</xsl:text>
-  </xsl:message>
-  <xsl:call-template name="db.title"/>
+  <xsl:variable name="target_chunk_id">
+    <xsl:call-template name="db.chunk.chunk-id">
+      <xsl:with-param name="node" select="."/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="target_chunk" select="key('idkey', $target_chunk_id)"/>
+  <xsl:choose>
+    <xsl:when test="$target_chunk">
+      <xsl:apply-templates mode="db.xref.content.mode" select="$target_chunk"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:message>
+        <xsl:text>No cross reference formatter found for </xsl:text>
+        <xsl:value-of select="local-name(.)"/>
+        <xsl:text> elements</xsl:text>
+      </xsl:message>
+      <xsl:variable name="title">
+        <xsl:call-template name="db.title"/>
+      </xsl:variable>
+      <xsl:choose>
+        <xsl:when test="string($title) != ''">
+          <xsl:copy-of select="$title"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="@id"/>
+        </xsl:otherwise>
+      </xsl:choose>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <!-- = db.xref.content.mode % appendix = -->

Modified: trunk/xslt/docbook/html/db2html-division.xsl
==============================================================================
--- trunk/xslt/docbook/html/db2html-division.xsl	(original)
+++ trunk/xslt/docbook/html/db2html-division.xsl	Fri Jun 27 16:24:06 2008
@@ -1094,6 +1094,11 @@
                     lot      | part       | preface      | reference |
                     setindex | toc        "/>
     <xsl:with-param name="info" select="bookinfo"/>
+    <!-- Unlike other elements in DocBook, title comes before bookinfo -->
+    <xsl:with-param name="title_node"
+                    select="(title | bookinfo/title)[1]"/>
+    <xsl:with-param name="subtitle_node"
+                    select="(subtitle | bookinfo/subtitle)[1]"/>
     <xsl:with-param name="depth_in_chunk" select="$depth_in_chunk"/>
     <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
     <xsl:with-param name="autotoc_depth" select="2"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]