Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xslt xsl—为内容设置字体/字体大小的最佳方法_Xslt_Xsl Fo - Fatal编程技术网

Xslt xsl—为内容设置字体/字体大小的最佳方法

Xslt xsl—为内容设置字体/字体大小的最佳方法,xslt,xsl-fo,Xslt,Xsl Fo,我正在开发一个xsl/xsl fo 1.0版应用程序,我发现字体和字体大小无处不在。有没有办法从例如root统一字体/字号 我在xsl fo中这样做: 有人能从xsl 现在,它将字体/字号放入,或者直接包装需要自定义字体和字号的实际内容使用属性集。这与CSS样式类似 <xsl:attribute-set name="smallerFont"> <xsl:attribute name="font-size"&g

我正在开发一个xsl/xsl fo 1.0版应用程序,我发现字体和字体大小无处不在。有没有办法从例如root统一字体/字号

我在xsl fo中这样做:

有人能从xsl

现在,它将字体/字号放入
,或者直接包装需要自定义字体和字号的
实际内容

使用属性集。这与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>
...

14磅
大胆的
40磅
大胆的
...
...

使用属性集。这与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>
...

14磅
大胆的
40磅
大胆的
...
...

您需要在将显示在输出中的节点上设置字体。大概,您的
模板匹配=“/”
包含一个
fo:root
,作为其输出的一部分,因此这是您可以设置字体的最高级别。或者,使用命名模板来设置文本属性,这样您就可以从任何需要具有这些属性的文本的地方调用模板。您需要在将显示在输出中的节点上设置字体。大概,您的
模板匹配=“/”
包含一个
fo:root
,作为其输出的一部分,因此这是您可以设置字体的最高级别。或者,使用命名模板设置文本属性,这样您就可以从任何需要具有这些属性的文本的地方调用模板。