]> granicus.if.org Git - docbook-dsssl/commitdiff
Added "wrapper-name" param to inline.charseq named template,
authorMichael Smith <xmldoc@users.sourceforge.net>
Tue, 27 Sep 2005 04:37:56 +0000 (04:37 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Tue, 27 Sep 2005 04:37:56 +0000 (04:37 +0000)
enabling it to output inlines other than just "span". Acronym and
Abbrev templates now use inline.charseq to output HTML "acronym"
and "abbr" elements (instead of "span"). Closes #1305468. Thanks
to Sam Steingold for suggesting the change.

xsl/html/inline.xsl

index 1467d6ab6e7b5f4e087f819881937a7a2618a2cd..989d01cf7c2263213fa2102430805ff96a3e9215 100644 (file)
       </xsl:with-param>
     </xsl:call-template>
   </xsl:param>
-  <span class="{local-name(.)}">
+  <!-- * if you want output from the inline.charseq template wrapped in -->
+  <!-- * something other than a Span, call the template with some value -->
+  <!-- * for the 'wrapper-name' param -->
+  <xsl:param name="wrapper-name">span</xsl:param>
+  <xsl:element name="{$wrapper-name}">
+    <xsl:attribute name="class">
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:attribute>
     <xsl:call-template name="dir"/>
     <xsl:call-template name="generate.html.title"/>
     <xsl:copy-of select="$content"/>
     <xsl:call-template name="apply-annotations"/>
-  </span>
+  </xsl:element>
 </xsl:template>
 
 <xsl:template name="inline.monoseq">
 </xsl:template>
 
 <xsl:template match="abbrev">
-  <xsl:call-template name="inline.charseq"/>
+  <xsl:call-template name="inline.charseq">
+    <xsl:with-param name="wrapper-name">abbr</xsl:with-param>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="acronym">
-  <xsl:call-template name="inline.charseq"/>
+  <xsl:call-template name="inline.charseq">
+    <xsl:with-param name="wrapper-name">acronym</xsl:with-param>
+  </xsl:call-template>
 </xsl:template>
 
 <xsl:template match="citerefentry">