]> granicus.if.org Git - docbook-dsssl/commitdiff
Made the dbcmdlist work the way it appears to have been intended
authorMichael Smith <xmldoc@users.sourceforge.net>
Wed, 4 Jul 2007 13:48:48 +0000 (13:48 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Wed, 4 Jul 2007 13:48:48 +0000 (13:48 +0000)
to work. Restored dbhtml-dir template back to pi.xsl.

xsl/html/pi.xsl
xsl/html/synop.xsl

index 83be138fc4918fbd6d6bc47283252d209c1f1e1c..aaffeaff58e988d7e1087b6d83ca6aeea5b524fc 100644 (file)
 </xsl:template>
 
 <xsl:template name="pi.dbhtml_img.src.path">
+  <xsl:param name="node" select="."/>
   <!-- * called on parent of graphic, inlinegraphic, imagedata, or videodata -->
   <xsl:call-template name="dbhtml-attribute">
     <xsl:with-param name="pis" select="$node/processing-instruction('dbhtml')"/>
        <dt>
        <a>
          <xsl:attribute name="href">
+           <xsl:text>#</xsl:text>
            <xsl:call-template name="object.id">
              <xsl:with-param name="object" select="$cmdsyn"/>
            </xsl:call-template>
   </xsl:choose>
 </xsl:template>
 
+<!-- ==================================================================== -->
+
+<xsl:template name="dbhtml-dir">
+  <xsl:param name="context" select="."/>
+  <!-- directories are now inherited from previous levels -->
+  <xsl:variable name="ppath">
+    <xsl:if test="$context/parent::*">
+      <xsl:call-template name="dbhtml-dir">
+        <xsl:with-param name="context" select="$context/parent::*"/>
+      </xsl:call-template>
+    </xsl:if>
+  </xsl:variable>
+  <xsl:variable name="path">
+    <xsl:call-template name="pi.dbhtml_dir">
+      <xsl:with-param name="node" select="$context"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:choose>
+    <xsl:when test="$path = ''">
+      <xsl:if test="$ppath != ''">
+        <xsl:value-of select="$ppath"/>
+      </xsl:if>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="$ppath != ''">
+        <xsl:value-of select="$ppath"/>
+        <xsl:if test="substring($ppath, string-length($ppath), 1) != '/'">
+          <xsl:text>/</xsl:text>
+        </xsl:if>
+      </xsl:if>
+      <xsl:value-of select="$path"/>
+      <xsl:text>/</xsl:text>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 </xsl:stylesheet>
index 291cd138f961095eebc45ba3aeba49d4c813f793..3ce59965cee162a8e548dbbb173bf63c088c788f 100644 (file)
@@ -25,7 +25,9 @@
   <div>
     <xsl:apply-templates select="." mode="class.attribute"/>
     <p>
-      <xsl:call-template name="anchor"/>
+      <xsl:call-template name="anchor">
+        <xsl:with-param name="conditional" select="0"/>
+      </xsl:call-template>
       <xsl:apply-templates/>
     </p>
   </div>