xsl fo的脚注参考

时间:2017-07-07 09:12:01

标签: xslt xsl-fo

我在xsl fo“footnote”中遇到问题脚注引用不对齐如何对齐 我希望脚注显示在左边对齐而不是缩进。 编码如下: -

正文: -

"<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年3月25日获得总统同意并在

    中发布
    1. 于2016年3月25日获得总统同意并发布

        3. Received the assent of the President on March
      
  2. 但我想

    1. 于2016年3月25日获得总统同意并发布于

    2. 于2016年3月25日获得总统同意并发布

    3. 3月份获得总统同意

1 个答案:

答案 0 :(得分:1)

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

因此,如果脚注来自fo:block元素(或其他块级格式化对象)start-indent="1cm",则脚注体也将缩进!

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