When merging styles, handle <b>, <i> in addition to <strong>,<em>

This commit is contained in:
Nathan Gray 2012-02-01 15:37:49 +00:00
parent 625a125e83
commit 3874ec6084
3 changed files with 7 additions and 7 deletions

View File

@ -86,13 +86,13 @@ Breakers
</xsl:template>
-->
<xsl:template name="apply-styles" match="w:r[descendant::strong|descendant::em|descendant::u|descendant::span]">
<xsl:template name="apply-styles" match="w:r[descendant::strong|descendant::b|descendant::i|descendant::em|descendant::u|descendant::span]">
<xsl:for-each select="node()|@*[not(w:rPr)]">
<xsl:choose>
<xsl:when test="descendant::strong|descendant::em|descendant::u|descendant::span" >
<xsl:when test="descendant::strong|descendant::b|descendant::i|descendant::em|descendant::u|descendant::span" >
<xsl:for-each select="node()|@*">
<xsl:choose>
<xsl:when test="descendant-or-self::strong|descendant-or-self::em|descendant-or-self::u|descendant-or-self::span" >
<xsl:when test="descendant-or-self::strong|descendant-or-self::b|descendant-or-self::i|descendant-or-self::em|descendant-or-self::u|descendant-or-self::span" >
<w:r>
<w:rPr>
<xsl:apply-templates select=".|child::*" />

View File

@ -211,7 +211,7 @@
</xsl:template>
<!-- Simple, use known styles -->
<xsl:template match="strong">
<xsl:template match="strong|b">
<text:span text:style-name="Tbold"><xsl:apply-templates/></text:span>
</xsl:template>
<xsl:template match="em|i">

View File

@ -87,13 +87,13 @@ Breakers
</xsl:template>
-->
<xsl:template match="w:r[descendant::strong|descendant::em|descendant::u|descendant::span]" name="apply-styles">
<xsl:template match="w:r[descendant::strong|descendant::b|descendant::em|descendant::i|descendant::u|descendant::span]" name="apply-styles">
<xsl:for-each select="node()|@*[not(w:rPr)]">
<xsl:choose>
<xsl:when test="descendant::strong|descendant::em|descendant::u|descendant::span" >
<xsl:when test="descendant::strong|descendant::b|descendant::em|descendant::i|descendant::u|descendant::span" >
<xsl:for-each select="node()|@*">
<xsl:choose>
<xsl:when test="descendant-or-self::strong|descendant-or-self::em|descendant-or-self::u|descendant-or-self::span" >
<xsl:when test="descendant-or-self::strong|descendant-or-self::b|descendant-or-self::em|descendant-or-self::i|descendant-or-self::u|descendant-or-self::span" >
<w:r>
<w:rPr>
<xsl:apply-templates select=".|child::*" />