问题
I'm using xsl-fo and trying to style xref content within a <sup>
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>
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.
Could anyone give me some pointers as how to cater for and style these sups
Thanks,
回答1:
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 *
.
If you are trying to match <sup>
elements that have an id
attribute, change your match to this:
sup[@id]
Also, try using vertical-align="super"
for superscript text.
Example:
<fo:inline vertical-align="super" font-size="8pt">
<xsl:apply-templates/>
</fo:inline>
来源:https://stackoverflow.com/questions/5718411/how-to-match-supvalue-sup-in-xsl-fo