]> granicus.if.org Git - docbook-dsssl/commitdiff
Feature req #525507: support xref to para by using the nearest containing section...
authorNorman Walsh <ndw@nwalsh.com>
Thu, 4 Jul 2002 15:12:12 +0000 (15:12 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Thu, 4 Jul 2002 15:12:12 +0000 (15:12 +0000)
xsl/fo/block.xsl
xsl/fo/xref.xsl
xsl/html/xref.xsl

index 7680d51209b446822a7904c05781a29c08139fa4..9aee590dc0d36d8f4febfdc6a276016a1811d978 100644 (file)
@@ -25,6 +25,7 @@
 
 <xsl:template match="para">
   <fo:block xsl:use-attribute-sets="normal.para.spacing">
+    <xsl:call-template name="anchor"/>
     <xsl:apply-templates/>
   </fo:block>
 </xsl:template>
index e0b96111f501d073e7222b96c8b4f7b351d7f525..1d8b1774bb015f5273958abf7f2c126981938801 100644 (file)
@@ -90,7 +90,7 @@
     </xsl:otherwise>
   </xsl:choose>
 
-  <xsl:if test="$insert.xref.page.number != 0">
+  <xsl:if test="$insert.xref.page.number != 0 or local-name($target) = 'para'">
     <xsl:apply-templates select="$target" mode="page.citation">
       <xsl:with-param name="id" select="@linkend"/>
     </xsl:apply-templates>
   </xsl:apply-templates>
 </xsl:template>
 
+<xsl:template match="para" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+
+  <xsl:variable name="context" select="(ancestor::simplesect
+                                       |ancestor::section
+                                       |ancestor::sect1
+                                       |ancestor::sect2
+                                       |ancestor::sect3
+                                       |ancestor::sect4
+                                       |ancestor::sect5
+                                       |ancestor::refsection
+                                       |ancestor::refsect1
+                                       |ancestor::refsect2
+                                       |ancestor::refsect3
+                                       |ancestor::chapter
+                                       |ancestor::appendix
+                                       |ancestor::preface
+                                       |ancestor::partintro
+                                       |ancestor::dedication
+                                       |ancestor::colophon
+                                       |ancestor::bibliography
+                                       |ancestor::index
+                                       |ancestor::glossary
+                                       |ancestor::glossentry
+                                       |ancestor::listitem
+                                       |ancestor::varlistentry)[last()]"/>
+
+  <xsl:apply-templates select="$context" mode="xref-to"/>
+<!--
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+  </xsl:apply-templates>
+-->
+</xsl:template>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="link" name="link">
index c0ad04969c14bb958fc15dd921a132a99fb5df6f..3c52ac5d634da43e5b7c7c33147ab7d6eb6df290 100644 (file)
   </xsl:apply-templates>
 </xsl:template>
 
+<xsl:template match="para" mode="xref-to">
+  <xsl:param name="referrer"/>
+  <xsl:param name="xrefstyle"/>
+
+  <xsl:variable name="context" select="(ancestor::simplesect
+                                       |ancestor::section
+                                       |ancestor::sect1
+                                       |ancestor::sect2
+                                       |ancestor::sect3
+                                       |ancestor::sect4
+                                       |ancestor::sect5
+                                       |ancestor::refsection
+                                       |ancestor::refsect1
+                                       |ancestor::refsect2
+                                       |ancestor::refsect3
+                                       |ancestor::chapter
+                                       |ancestor::appendix
+                                       |ancestor::preface
+                                       |ancestor::partintro
+                                       |ancestor::dedication
+                                       |ancestor::colophon
+                                       |ancestor::bibliography
+                                       |ancestor::index
+                                       |ancestor::glossary
+                                       |ancestor::glossentry
+                                       |ancestor::listitem
+                                       |ancestor::varlistentry)[last()]"/>
+
+  <xsl:apply-templates select="$context" mode="xref-to"/>
+<!--
+  <xsl:apply-templates select="." mode="object.xref.markup">
+    <xsl:with-param name="purpose" select="'xref'"/>
+    <xsl:with-param name="xrefstyle" select="$xrefstyle"/>
+    <xsl:with-param name="referrer" select="$referrer"/>
+  </xsl:apply-templates>
+-->
+</xsl:template>
+
 <!-- ==================================================================== -->
 
 <xsl:template match="*" mode="xref-title">
               </xsl:otherwise>
             </xsl:choose>
           </xsl:when>
-        
+
           <xsl:otherwise>
             <xsl:message>
               <xsl:text>Link element has no content and no Endterm. </xsl:text>