2017-07-07 55 views
1

我在xsl fo中遇到问题“脚注”脚注参考不对齐如何对齐 我希望脚注在左侧对齐显示不缩进。 编码有以下几点: -xsl fo的脚注参考

正文: -

"<footnoteref refid="FN0001">1</footnoteref>"any action taken by the Central 
Government under the Resolution of the Government of India, Planning Commission 
bearing Notification Number A-43011/02/2009-Admin. 

XSLT: -

<xsl:template match="footnoteref"> 
<xsl:variable name="fnoteid" select="@refid"/> 
<fo:footnote> 
<fo:inline font-size="70%" baseline-shift="super"> 
<xsl:apply-templates/> 
</fo:inline> 
<fo:footnote-body> 
<fo:list-block provisional-label-separation="2.5mm" provisional-distance-between-starts="10mm"> 
<fo:list-item> 
<fo:list-item-label end-indent="label-end()"> 
<fo:block text-align="right" text-indent="0pt" margin-left="0pt" font-size="8.5" font-style="normal"> 
<xsl:value-of select="//footnote[@id=$fnoteid]/footnum"/> 
<xsl:choose> 
<xsl:when test="$fnoteid = 1 to 9000"><xsl:text>.</xsl:text></xsl:when> 
</xsl:choose> 
</fo:block> 
</fo:list-item-label> 
<fo:list-item-body start-indent="body-start()"> 
<fo:block text-align="justify" text-indent="0pt" margin-left="0pt" font-size="8.5" font-style="normal"> 
<xsl:apply-templates select="//footnote[@id=$fnoteid]"/> 
</fo:block> 
</fo:list-item-body> 
</fo:list-item> 
</fo:list-block> 
</fo:footnote-body> 
</fo:footnote> 
</xsl:template> 

我的脚注看起来像

  1. 收到总统的同意上月2016年5月25日,发表于

    1. 收到的2016年3月25日总统的同意,并发表

      3. Received the assent of the President on March 
      

,但我想

  1. 收到总统的同意上月2016年5月25日发表于

  2. 收到的2016年3月25日总统的同意,并发表

  3. 收到总统的同意就

+0

请同时包含一个例子'footnoteref'和它的'footnote'的XML。 “'test =”$ fnoteid = 1到9000“'”的目的是什么? –

+0

1

回答

1

这似乎是违反直觉的,但fo:footnote元素从继承性的祖先格式化对象

因此,如果脚注从fo:block元素(或另一个块级格式化对象)下降到start-indent="1cm",则脚注主体也会缩进!

要达到预期结果,请修改模板以将start-indent="0cm"添加到fo:footnote-body内部的fo:list-block元素。同样,您将不得不“重置”您不希望fo:footnote-body继承的其他属性(end-indent,空格,font-size,...)。