]> granicus.if.org Git - docbook-dsssl/commitdiff
Add id if specified from @id to output for quote and phrase so
authorBob Stayton <bobs@sagehill.net>
Fri, 13 Mar 2009 23:59:36 +0000 (23:59 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 13 Mar 2009 23:59:36 +0000 (23:59 +0000)
they can be xref'ed to.

xsl/fo/inline.xsl

index 7679af8a92fe8b191d74dfb19029c8fa21d37b10..77629dca8def88ad678efb2b5938397d4d67a98d 100644 (file)
       <!-- Is it an olink ? -->
       <xsl:variable name="is.olink">
         <xsl:choose>
-         <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
+          <!-- If xlink:role="http://docbook.org/xlink/role/olink" -->
           <!-- and if the href contains # -->
           <xsl:when test="contains($xhref,'#') and
-              @xlink:role = $xolink.role">1</xsl:when>
+               @xlink:role = $xolink.role">1</xsl:when>
           <xsl:otherwise>0</xsl:otherwise>
         </xsl:choose>
       </xsl:variable>
@@ -90,9 +90,9 @@
         </xsl:when>
 
         <xsl:when test="$is.olink = 1">
-         <xsl:call-template name="olink">
-           <xsl:with-param name="content" select="$content"/>
-         </xsl:call-template>
+          <xsl:call-template name="olink">
+            <xsl:with-param name="content" select="$content"/>
+          </xsl:call-template>
         </xsl:when>
 
         <!-- otherwise it's a URI -->
 </xsl:template>
 
 <xsl:template match="phrase">
-  <xsl:call-template name="inline.charseq"/>
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:call-template name="inline.charseq"/>
+  </fo:inline>
 </xsl:template>
 
 <xsl:template match="quote">
       <xsl:with-param name="string"><xsl:number level="multiple"/></xsl:with-param>
     </xsl:call-template>
   </xsl:variable>
-  <xsl:choose>
-    <xsl:when test="$depth mod 2 = 0">
-      <xsl:call-template name="gentext.startquote"/>
-      <xsl:call-template name="inline.charseq"/>
-      <xsl:call-template name="gentext.endquote"/>
-    </xsl:when>
-    <xsl:otherwise>
-      <xsl:call-template name="gentext.nestedstartquote"/>
-      <xsl:call-template name="inline.charseq"/>
-      <xsl:call-template name="gentext.nestedendquote"/>
-    </xsl:otherwise>
-  </xsl:choose>
+  <xsl:variable name="content">
+    <xsl:choose>
+      <xsl:when test="$depth mod 2 = 0">
+        <xsl:call-template name="gentext.startquote"/>
+        <xsl:call-template name="inline.charseq"/>
+        <xsl:call-template name="gentext.endquote"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:call-template name="gentext.nestedstartquote"/>
+        <xsl:call-template name="inline.charseq"/>
+        <xsl:call-template name="gentext.nestedendquote"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <fo:inline>
+    <xsl:call-template name="anchor"/>
+    <xsl:copy-of select="$content"/>
+  </fo:inline>
+
 </xsl:template>
 
 <xsl:template match="varname">
 
       <xsl:variable name="targets"
                     select="//glossentry[normalize-space(glossterm)=$term
-                           or normalize-space(glossterm/@baseform)=$term]"/>
+                            or normalize-space(glossterm/@baseform)=$term]"/>
 
       <xsl:variable name="target" select="$targets[1]"/>
 
           </xsl:call-template>
         </xsl:attribute>
 
-       <xsl:choose>
-         <xsl:when test="$bibliography.numbered != 0">
-           <xsl:apply-templates select="$target" mode="citation"/>
-         </xsl:when>
-         <xsl:otherwise>
-           <xsl:call-template name="inline.charseq"/>
-         </xsl:otherwise>
-       </xsl:choose>
+        <xsl:choose>
+          <xsl:when test="$bibliography.numbered != 0">
+            <xsl:apply-templates select="$target" mode="citation"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:call-template name="inline.charseq"/>
+          </xsl:otherwise>
+        </xsl:choose>
      
       </fo:basic-link>
       <xsl:text>]</xsl:text>
           </xsl:call-template>
         </xsl:attribute>
 
-       <xsl:call-template name="inline.charseq"/>
-           
+        <xsl:call-template name="inline.charseq"/>
+            
       </fo:basic-link>
       <xsl:text>]</xsl:text>
     </xsl:when>
 
 <xsl:template match="biblioentry|bibliomixed" mode="citation">
   <xsl:number from="bibliography" count="biblioentry|bibliomixed"
-             level="any" format="1"/>
+              level="any" format="1"/>
 </xsl:template>
 
 <!-- ==================================================================== -->