2011-04-19 82 views
0

匹配我使用XSL-FO和<sup>如何在XSL-FO

例如,我想使2標內試圖風格的外部參照內容價值

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

我使用下面的代碼,我認爲應該工作。

<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忽略它。

任何人都可以給我一些指點如何迎合和風格這些SUPS

感謝,

回答

4

這個模板是不是你<sup>元件匹配的原因是因爲您正在使用id屬性匹配<sup>它的值爲*

如果你想匹配有id屬性<sup>元素,你的比賽改成這樣:

sup[@id] 

而且,嘗試使用vertical-align="super"對標文本。

實施例:

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