2 つの異なる強調の間の間隔の値に関して問題があります。以下の xslt の現在の出力はまだ問題ありませんが、2 つのタグの間にスペースがありません。変形についてよくわからないので教えてください。詳細な問題は以下で見ることができます。
入力 XML は次のとおりです。
<caption>
<content>Box</content>
<number>1</number>
<description>
<em type="bold">Some text with scientic name: </em>
<em type="bolditalic">fhadinistis</em>
</description>
</caption>
出力は次のとおりです。
<cap>
<text>Box</text>
<num>1</num>
<content>
<b>Some text with scientic name:</b><b>
<i>fhadinistis</i>
</b>
</content>
</cap>
目的の出力は次のようになります:(太字の終了タグと開始タグの間にスペースがあることに注意してください)
<cap>
<text>Box</text>
<num>1</num>
<content>
<b>Some text with scientic name:</b> <b>
<i>fhadinistis</i>
</b>
</content>
</cap>
私のXSLTは次のとおりです。
<xsl:template match="em">
<xsl:choose>
<xsl:when test="@type='bolditalic'">
<b>
<it>
<xsl:apply-templates/>
</it>
</b>
</xsl:when>
<xsl:when test="@type='boldunderline'">
<b>
<ul>
<xsl:apply-templates/>
</ul>
</b>
</xsl:when>
<xsl:when test="@type='italicunderline'">
<it>
<ul>
<xsl:apply-templates/>
</ul>
</it>
</xsl:when>
</xsl:choose>
</xsl:template>