]> granicus.if.org Git - docbook-dsssl/commitdiff
Bug #503271: output biblioentry.item.separator after citetitle
authorNorman Walsh <ndw@nwalsh.com>
Mon, 28 Jan 2002 12:05:17 +0000 (12:05 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Mon, 28 Jan 2002 12:05:17 +0000 (12:05 +0000)
xsl/html/biblio.xsl
xsl/html/block.xsl
xsl/html/docbook.xsl
xsl/html/footnote.xsl

index efba264d7cf90671a8d5a7da14f9992ee0160e72..829b179a188759649475317c7dd9d9329abe7111 100644 (file)
         <xsl:call-template name="inline.italicseq"/>
       </xsl:otherwise>
     </xsl:choose>
+    <xsl:value-of select="$biblioentry.item.separator"/>
   </span>
 </xsl:template>
 
index 399fb0176a6a6829344244b1b608dadf958aec58..b29a0a66ae52868df3ede5b894830a9c5fcc6f50 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="exsl"
                 version='1.0'>
 
 <!-- ********************************************************************
@@ -24,6 +26,7 @@
 <!-- ==================================================================== -->
 
 <xsl:template match="para">
+  <xsl:variable name="the-p">
   <p>
     <xsl:if test="position() = 1 and parent::listitem">
       <xsl:call-template name="anchor">
     <xsl:call-template name="anchor"/>
     <xsl:apply-templates/>
   </p>
+  </xsl:variable>
+
+  <xsl:copy-of select="$the-p"/>
+<!--
+  <xsl:apply-templates select="exsl:node-set($the-p)" mode="unwrap.p"/>
+-->
 </xsl:template>
 
 <xsl:template match="simpara">
index 70809608a4c88ae3c16a2c4f86878e0c9895512b..7e9900818bf1601a07df1e4d611a7193bf340521 100644 (file)
@@ -61,6 +61,7 @@
 <xsl:include href="pi.xsl"/>
 <xsl:include href="ebnf.xsl"/>
 <xsl:include href="chunker.xsl"/>
+<xsl:include href="html-rtf.xsl"/>
 
 <!-- ==================================================================== -->
 
index c22d4b53cf9a9b5f83627f541e25280f0a8d6ac4..4cb169c672e02915629583e9424c069af88ed256 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version='1.0'?>
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:exsl="http://exslt.org/common"
+                exclude-result-prefixes="exsl"
                 version='1.0'>
 
 <!-- ********************************************************************
 
 <!-- ==================================================================== -->
 
+<xsl:template match="para|simpara" mode="footnote.body">
+  <!-- this only works if the first thing in a footnote is a para, -->
+  <!-- which is ok, because it usually is. -->
+  <xsl:variable name="name">
+    <xsl:text>ftn.</xsl:text>
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="ancestor::footnote"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="href">
+    <xsl:text>#</xsl:text>
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="ancestor::footnote"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <p>
+    <sup>
+      <xsl:text>[</xsl:text>
+      <a name="{$name}" href="{$href}">
+        <xsl:apply-templates select="ancestor::footnote"
+                             mode="footnote.number"/>
+      </a>
+      <xsl:text>] </xsl:text>
+    </sup>
+    <xsl:apply-templates/>
+  </p>
+</xsl:template>
+
+<xsl:template match="*" mode="footnote.body">
+  <xsl:variable name="name">
+    <xsl:text>ftn.</xsl:text>
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="ancestor::footnote"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="href">
+    <xsl:text>#</xsl:text>
+    <xsl:call-template name="object.id">
+      <xsl:with-param name="object" select="ancestor::footnote"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="footnote.mark">
+    <sup>
+      <xsl:text>[</xsl:text>
+      <a name="{$name}" href="{$href}">
+        <xsl:apply-templates select="ancestor::footnote"
+                             mode="footnote.number"/>
+      </a>
+      <xsl:text>] </xsl:text>
+    </sup>
+  </xsl:variable>
+
+  <xsl:variable name="html">
+    <xsl:apply-templates select="."/>
+  </xsl:variable>
+  <xsl:variable name="html-nodes" select="exsl:node-set($html)"/>
+
+  <xsl:choose>
+    <xsl:when test="$html-nodes//p">
+      <xsl:apply-templates select="$html-nodes" mode="insert.html.p">
+        <xsl:with-param name="mark" select="$footnote.mark"/>
+      </xsl:apply-templates>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:apply-templates select="$html-nodes" mode="insert.html.text">
+        <xsl:with-param name="mark" select="$footnote.mark"/>
+      </xsl:apply-templates>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
+<!-- ==================================================================== -->
+
+<!--
+<xsl:template name="count-element-from">
+  <xsl:param name="from" select=".."/>
+  <xsl:param name="to" select="."/>
+  <xsl:param name="count" select="0"/>
+  <xsl:param name="list" select="$from/following::*[name(.)=name($to)]
+                                 |$from/descendant-or-self::*[name(.)=name($to)]"/>
+
+  <xsl:choose>
+    <xsl:when test="not($list)">
+      <xsl:text>-1</xsl:text>
+    </xsl:when>
+    <xsl:when test="$list[1] = $to">
+      <xsl:value-of select="$count + 1"/>
+    </xsl:when>
+    <xsl:otherwise>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+-->
+
+<!-- ==================================================================== -->
+
 <xsl:template name="process.footnotes">
   <xsl:variable name="footnotes" select=".//footnote"/>
   <xsl:variable name="table.footnotes"
 </xsl:template>
 
 <xsl:template match="footnote" mode="process.footnote.mode">
-  <xsl:if test="local-name(*[1]) != 'para'
-                and local-name(*[1]) != 'simpara'">
-    <xsl:message>
-      <xsl:text>Warning: footnote number may not be generated </xsl:text>
-      <xsl:text>correctly; </xsl:text>
-      <xsl:value-of select="local-name(*[1])"/>
-      <xsl:text> unexpected as first child of footnote.</xsl:text>
-    </xsl:message>
-  </xsl:if>
-  <div class="{name(.)}">
-    <xsl:apply-templates/>
-  </div>
+  <xsl:choose>
+    <xsl:when test="function-available('exsl:node-set')">
+      <div class="{name(.)}">
+        <xsl:apply-templates select="*[1]" mode="footnote.body"/>
+        <xsl:apply-templates select="*[position() &gt; 1]"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="local-name(*[1]) != 'para' and local-name(*[1]) != 'simpara'">
+        <xsl:message>
+          <xsl:text>Warning: footnote number may not be generated </xsl:text>
+          <xsl:text>correctly; </xsl:text>
+          <xsl:value-of select="local-name(*[1])"/>
+          <xsl:text> unexpected as first child of footnote.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+      <div class="{name(.)}">
+        <xsl:apply-templates/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="informaltable//footnote|table//footnote" 
 </xsl:template>
 
 <xsl:template match="footnote" mode="table.footnote.mode">
-  <xsl:if test="local-name(*[1]) != 'para'
-                and local-name(*[1]) != 'simpara'">
-    <xsl:message>
-      <xsl:text>Warning: footnote number may not be generated </xsl:text>
-      <xsl:text>correctly; </xsl:text>
-      <xsl:value-of select="local-name(*[1])"/>
-      <xsl:text> unexpected as first child of footnote.</xsl:text>
-    </xsl:message>
-  </xsl:if>
-  <div class="{name(.)}">
-    <xsl:apply-templates/>
-  </div>
+  <xsl:choose>
+    <xsl:when test="function-available('exsl:node-set')">
+      <div class="{name(.)}">
+        <xsl:apply-templates select="*[1]" mode="footnote.body"/>
+        <xsl:apply-templates select="*[position() &gt; 1]"/>
+      </div>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:if test="local-name(*[1]) != 'para'
+                    and local-name(*[1]) != 'simpara'">
+        <xsl:message>
+          <xsl:text>Warning: footnote number may not be generated </xsl:text>
+          <xsl:text>correctly; </xsl:text>
+          <xsl:value-of select="local-name(*[1])"/>
+          <xsl:text> unexpected as first child of footnote.</xsl:text>
+        </xsl:message>
+      </xsl:if>
+      <div class="{name(.)}">
+        <xsl:apply-templates/>
+      </div>
+    </xsl:otherwise>
+  </xsl:choose>
 </xsl:template>
 
 </xsl:stylesheet>