如何匹配<sup>值</sup>在 XSL-FO 中 [英] How to match <sup>value</sup> in XSL-FO

查看:38
本文介绍了如何匹配<sup>值</sup>在 XSL-FO 中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 xsl-fo 并尝试在

I'm using xsl-fo and trying to style xref content within a <sup>

例如我想制作 2 上标.

eg I want to make the 2 superscript.

<sup id="FNB-0002"><xref href="#Comp_CLJONLINE_CLJ_2010_04_2/FN-0002">2</xref></sup>

我正在使用以下我认为应该可以工作的代码.

I am using the following code which I think should work.

 <xsl:template match="sup[@id='*']">    
        <fo:inline font-size="24pt" font-weight="bold" text-indent="2em" text-transform="uppercase" >
            <xsl:apply-templates/>
            </fo:inline>
    </xsl:template>

但是我应用的样式都没有被识别.我开始认为这是因为 2 在外部参照中,而 xsl-fo 则忽略了它.

But none of the styles I am applying are being recognised. I'm beginning to think that this is because the 2 is within an xref and the xsl-fo is then ignoring it.

谁能给我一些关于如何满足和设计这些 sup 的指示

Could anyone give me some pointers as how to cater for and style these sups

谢谢,

推荐答案

此模板与您的 <sup> 元素不匹配的原因是因为您正在匹配 <sup> 带有值为 *id 属性.

The reason this template is not matching your <sup> element is because you are matching a <sup> with an id attribute that has the value *.

如果您尝试匹配具有 id 属性的 元素,请将您的匹配更改为:

If you are trying to match <sup> elements that have an id attribute, change your match to this:

sup[@id]

另外,尝试对上标文本使用 vertical-align="super".

Also, try using vertical-align="super" for superscript text.

示例:

<fo:inline vertical-align="super" font-size="8pt">
    <xsl:apply-templates/>
</fo:inline>

这篇关于如何匹配&lt;sup&gt;值&lt;/sup&gt;在 XSL-FO 中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆