]> granicus.if.org Git - docbook-dsssl/commitdiff
Implemented feature request #942524 to add insert.link.page.number to
authorBob Stayton <bobs@sagehill.net>
Mon, 8 May 2006 05:24:01 +0000 (05:24 +0000)
committerBob Stayton <bobs@sagehill.net>
Mon, 8 May 2006 05:24:01 +0000 (05:24 +0000)
allow link element cross references to have a page number.

xsl/fo/xref.xsl

index d529f7b70000d730ddd7e5dbb6c8dfce15da955d..837de757592f086f2da6f8a9463a5a6183612064 100644 (file)
     <xsl:with-param name="linkend" select="@linkend"/>
   </xsl:call-template>
 
+  <xsl:variable name="xrefstyle">
+    <xsl:choose>
+      <xsl:when test="@role and not(@xrefstyle) 
+                      and $use.role.as.xrefstyle != 0">
+        <xsl:value-of select="@role"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@xrefstyle"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
   <fo:basic-link internal-destination="{@linkend}"
                  xsl:use-attribute-sets="xref.properties">
     <xsl:choose>
       </xsl:otherwise>
     </xsl:choose>
   </fo:basic-link>
+
+  <!-- Add standard page reference? -->
+  <xsl:choose>
+    <!-- negative xrefstyle in instance turns it off -->
+    <xsl:when test="starts-with(normalize-space($xrefstyle), 'select:') 
+                  and contains($xrefstyle, 'nopage')">
+    </xsl:when>
+    <xsl:when test="(starts-with(normalize-space($xrefstyle), 'select:') 
+                  and $insert.link.page.number = 'maybe'  
+                  and (contains($xrefstyle, 'page')
+                       or contains($xrefstyle, 'Page')))
+                  or ( $insert.link.page.number = 'yes' 
+                     or $insert.link.page.number = '1')
+                  or local-name($target) = 'para'">
+      <xsl:apply-templates select="$target" mode="page.citation">
+        <xsl:with-param name="id" select="@linkend"/>
+      </xsl:apply-templates>
+    </xsl:when>
+  </xsl:choose>
 </xsl:template>
 
 <xsl:template match="ulink" name="ulink">