2

これは私の前の質問に関連する問題です。

見出しの下にある p タグを変更するために、序文の見出しに提案されたコードを変更しました。

<xsl:template match="topic[title='Preface']/body/section/p">
        <fo:block xsl:use-attribute-sets="preface.p">
            <xsl:apply-imports/>
        </fo:block>
    </xsl:template>

<xsl:attribute-set name="preface.p">
        <xsl:attribute name="font-family">Helvetica</xsl:attribute>
        <xsl:attribute name="color">red</xsl:attribute>
        <xsl:attribute name="font-size">8pt</xsl:attribute>
    </xsl:attribute-set>

色は目的のテキストを変更し、目的のテキストのみを変更するため、正しいノードを取得していることがわかります。ただし、フォント ファミリとサイズは影響しません。

コードをオーバーライドしている可能性があることを確認できることを知っている人はいますか?

4

1 に答える 1

1

HTMLには属性がありません。font-familyまたはfont-sizeCSSプロパティです。これを試してください。

<xsl:attribute-set name="preface.p">
    <xsl:attribute name="style">font-family: Helvetica; color: red; font-size: 8pt;</xsl:attribute>
</xsl:attribute-set>
于 2010-05-24T14:26:44.080 に答える