Xpath 如何匹配<;sup>;价值</sup>;在XSL-FO中
我正在使用xsl fo并尝试在Xpath 如何匹配<;sup>;价值</sup>;在XSL-FO中,xpath,xsl-fo,Xpath,Xsl Fo,我正在使用xsl fo并尝试在 我想做上标2 2 我使用下面的代码,我认为应该可以工作 <xsl:template match="sup[@id='*']"> <fo:inline font-size="24pt" font-weight="bold" text-indent="2em" text-transform="uppercase" > <xsl:apply-templates/>
我想做上标2
2
我使用下面的代码,我认为应该可以工作
<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会忽略它
有谁能给我一些建议,告诉我如何迎合这些口味
谢谢,此模板不匹配您的
元素的原因是您正在将
与值为*
的id
属性匹配
如果您试图匹配具有id
属性的
元素,请将匹配更改为:
sup[@id]
另外,尝试对上标文本使用vertical align=“super”
例如:
<fo:inline vertical-align="super" font-size="8pt">
<xsl:apply-templates/>
</fo:inline>
此模板与
元素不匹配的原因是您将
与具有值*
的id
属性相匹配
如果您试图匹配具有id
属性的
元素,请将匹配更改为:
sup[@id]
另外,尝试对上标文本使用vertical align=“super”
例如:
<fo:inline vertical-align="super" font-size="8pt">
<xsl:apply-templates/>
</fo:inline>