]> granicus.if.org Git - docbook-dsssl/commitdiff
Only count regular <emphasis> elements (without @role="bold", etc) when determining
authorAlexey Neyman <stilor@att.net>
Thu, 29 May 2014 21:04:33 +0000 (21:04 +0000)
committerAlexey Neyman <stilor@att.net>
Thu, 29 May 2014 21:04:33 +0000 (21:04 +0000)
whether nested emphasis needs to be displayed in italics or in regular; otherwise,
the order of nesting in <emphasis role="bold"> and <emphasis> affects the font
used.

xsl/fo/inline.xsl

index 3b426b41b913b34c0ba9c6ad3253a967e102a95d..3539d8a4adad7c650de75d4ef1d9ba6509a1fec3 100644 (file)
 </xsl:template>
 
 <xsl:template match="emphasis">
-  <xsl:variable name="depth">
-    <xsl:call-template name="dot.count">
-      <xsl:with-param name="string">
-        <xsl:number level="multiple"/>
-      </xsl:with-param>
-    </xsl:call-template>
-  </xsl:variable>
-
   <xsl:choose>
     <xsl:when test="@role='bold' or @role='strong'">
       <xsl:call-template name="inline.boldseq"/>
       </fo:inline>
     </xsl:when>
     <xsl:otherwise>
+      <!-- How many regular emphasis ancestors does this element have -->
+      <xsl:variable name="depth" select="count(ancestor::emphasis
+       [not(contains(' bold strong underline strikethrough ', concat(' ', @role, ' ')))]
+       )"/>
+
       <xsl:choose>
         <xsl:when test="$depth mod 2 = 1">
           <fo:inline font-style="normal">