XSL-为内容设置字体 /字体大小的最佳方法



我正在处理XSL/XSL-FO版本1.0应用程序,我发现字体和字体大小都在其中。有什么方法可以将字体/字体大小从例如根?

团结起来?

我在xsl-fo中做到了: <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:fox="http://xml.apache.org/fop/extensions" font-family="{$g_fontFamily}" font-size="11pt">

任何人都可以建议如何从XSL <xsl:template match="/">做同样的事情现在,它将字体/字体大小放在<css class>中,或直接包装<font size="0.5em">Real Contents which need the font and font-size customized</font>

使用属性集。这与CSS样式一样起作用。

      <xsl:attribute-set name="smallerFont">
        <xsl:attribute name="font-size">14pt</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>
    <xsl:attribute-set name="largerFont">
        <xsl:attribute name="font-size">40pt</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>
...
                            <fo:table-row border-after-style="solid"
                                border-after-width="0.01mm">
                                <fo:table-cell column-number="1"
                                    number-columns-spanned="2">
                                    <fo:block xsl:use-attribute-sets="largerFont"> 
                                        <xsl:value-of select="txtEarmarkedMaterial" />
                                    </fo:block>
                                </fo:table-cell>
                            </fo:table-row>
...

最新更新