]> granicus.if.org Git - docbook-dsssl/commitdiff
Fixed bug [ 1212159 ] Missing navigational links with XHTML chunking
authorBob Stayton <bobs@sagehill.net>
Fri, 3 Jun 2005 17:22:31 +0000 (17:22 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 3 Jun 2005 17:22:31 +0000 (17:22 +0000)
which was caused by the following:

1.  When chunk.hierarchy is created, it is a collection of
div elements in a variable, and then that is converted to a
node-set by exlt.

2.  In HTML, there is no namespace, so the div elements are in
no namespace and they work.

3.  In XHTML, the div elements are in the xhtml namespace because
it is the default namespace.  So they cannot be addressed as
just "div", they must have a namespace prefix.

4.  I added an explicit chunkfast namespace to avoid conflict
with the default namespace.

xsl/html/chunk-code.xsl
xsl/html/chunkfast.xsl

index 280b00cd781af02159b3cfdc02aaff8b4d4205ea..bce27d1555dc9d32d6ef14310a62b1ef0b7985e5 100644 (file)
@@ -1,5 +1,6 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:exsl="http://exslt.org/common"
+                xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
                 version="1.0"
                 exclude-result-prefixes="exsl">
 
@@ -47,9 +48,9 @@
 
   <xsl:choose>
     <xsl:when test="$chunk != 0">
-      <div class="{local-name(.)}" id="{generate-id()}">
+      <cf:div class="{local-name(.)}" id="{generate-id()}">
         <xsl:apply-templates select="*" mode="find.chunks"/>
-      </div>
+      </cf:div>
     </xsl:when>
     <xsl:otherwise>
       <xsl:apply-templates select="*" mode="find.chunks"/>
 
   <xsl:choose>
     <xsl:when test="$chunk.fast != 0 and function-available('exsl:node-set')">
-      <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//div"/>
+      <xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
       <xsl:variable name="genid" select="generate-id()"/>
 
       <xsl:variable name="div" select="$chunks[@id=$genid]"/>
 
       <xsl:variable name="prevdiv"
-                    select="($div/preceding-sibling::div|$div/preceding::div|$div/parent::div)[last()]"/>
+                    select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
       <xsl:variable name="prev" select="key('genid', $prevdiv/@id)"/>
 
       <xsl:variable name="nextdiv"
-                    select="($div/following-sibling::div|$div/following::div|$div/div)[1]"/>
+                    select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
       <xsl:variable name="next" select="key('genid', $nextdiv/@id)"/>
 
       <xsl:choose>
index bd49ac843387935d766135815d35062d86720cb5..48258b302da8608b073456be248263a987b1f28d 100644 (file)
@@ -1,5 +1,6 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:exsl="http://exslt.org/common"
+                xmlns:cf="http://docbook.sourceforge.net/xmlns/chunkfast/1.0"
                version="1.0"
                 exclude-result-prefixes="exsl">
 
@@ -18,7 +19,7 @@
 <xsl:import href="chunk.xsl"/>
 <xsl:param name="chunk.fast" select="1"/>
 
-<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//div"/>
+<xsl:variable name="chunks" select="exsl:node-set($chunk.hierarchy)//cf:div"/>
 
 <!-- ==================================================================== -->
 
       <xsl:variable name="div" select="$chunks[@id=$genid]"/>
 
       <xsl:variable name="prevdiv"
-                    select="($div/preceding-sibling::div|$div/preceding::div|$div/parent::div)[last()]"/>
+                    select="($div/preceding-sibling::cf:div|$div/preceding::cf:div|$div/parent::cf:div)[last()]"/>
       <xsl:variable name="prev" select="key('genid', $prevdiv/@id)"/>
 
       <xsl:variable name="nextdiv"
-                    select="($div/following-sibling::div|$div/following::div|$div/div)[1]"/>
+                    select="($div/following-sibling::cf:div|$div/following::cf:div|$div/cf:div)[1]"/>
       <xsl:variable name="next" select="key('genid', $nextdiv/@id)"/>
 
       <xsl:choose>