]> granicus.if.org Git - docbook-dsssl/commitdiff
Improved simple.xlink to support link and xref.
authorBob Stayton <bobs@sagehill.net>
Fri, 17 Nov 2006 08:21:22 +0000 (08:21 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 17 Nov 2006 08:21:22 +0000 (08:21 +0000)
xsl/html/inline.xsl

index b1b03411ec81c88ecebae56243262c5e1ebef129..c2d0ec319a4079f110fe709d797b7e5780bd8fc2 100644 (file)
@@ -32,8 +32,9 @@
   <xsl:param name="content">
     <xsl:apply-templates/>
   </xsl:param>
-
-  <xsl:variable name="xhref" select="$node/@xlink:href"/>
+  <xsl:param name="a.target"/>
+  <xsl:param name="linkend" select="$node/@linkend"/>
+  <xsl:param name="xhref" select="$node/@xlink:href"/>
 
   <xsl:variable name="link">
     <xsl:choose>
                     </xsl:when>
                     <xsl:otherwise>
                       <xsl:apply-templates select="$target"
-                                           mode="link.title.attribute"/>
+                                           mode="html.title.attribute"/>
                     </xsl:otherwise>
                   </xsl:choose>
+
+                  <xsl:if test="$a.target">
+                    <xsl:attribute name="target">
+                      <xsl:value-of select="$a.target"/>
+                    </xsl:attribute>
+                  </xsl:if>
+
                   <xsl:copy-of select="$content"/>
+
                 </a>
               </xsl:otherwise>
             </xsl:choose>
         </xsl:choose>
       </xsl:when>
 
-      <xsl:when test="$node/@linkend">
-        <xsl:variable name="linkend" select="$node/@linkend"/>
+      <xsl:when test="$linkend">
         <xsl:variable name="targets" select="key('id',$linkend)"/>
         <xsl:variable name="target" select="$targets[1]"/>
 
             </xsl:call-template>
           </xsl:attribute>
 
-          <xsl:apply-templates select="$target" mode="link.title.attribute"/>
+          <xsl:apply-templates select="$target" mode="html.title.attribute"/>
 
           <xsl:copy-of select="$content"/>