1

我有一份用 XML 编码的中世纪手稿(使用 TEI 模式)。手稿有一个“主体”,它已在 XSL:FO 中xsl-region-body完美地映射到并输出。手稿的左右页边空白处还有一些“注释”(注解)。这些在 XML 文档中被标记,例如<add type="margin_gloss" place="left">Some foo note</add>

我已保留xsl-region-startxsl-region-end接收这些相对于它们在原始手稿中的位置的页边注。但是,我无法让标记的文本“流入”这些区域。

注意:我将硬编码数据放入这些区域没有问题,例如,<fo:static-content flow-name="xsl-region-after">

问题是Apache FOP告诉我下面的代码:For "fo:page-sequence", only one "fo:flow" may be declared.

        <fo:page-sequence master-reference="odd">
            <fo:static-content flow-name="xsl-region-after"
                font-family="Times"
                font-size="8pt">
                <fo:block text-align="center">-<fo:page-number/>-
                </fo:block>
            </fo:static-content>
            <fo:flow flow-name="xsl-region-end"
                font-family="Times"
                font-size="6pt">
                <xsl:call-template name="marginalia-right"/>
            </fo:flow>
            <fo:flow flow-name="xsl-region-body" 
                font-family="Times"
                font-size="8pt"
                space-before="8pt"
                space-after="8pt">
                <xsl:apply-templates/>
            </fo:flow>
        </fo:page-sequence>

我使用 XSL 模板提取注释:

 <xsl:template match="//tei:add[@type='margin_gloss' and @place='right']" name="marginalia-right">
      <fo:block>
          <xsl:value-of select="text()"/>
      </fo:block>
  </xsl:template>

总结一下这个问题:我希望用 XML 标记的边距注释<add>出现在. FPO 告诉我我不能“流动”两次。xsl-region-startxsl-region-endxsl-region-body

4

1 回答 1

2

您无法将 region-start 中的内容与 region-body 中的内容同步。

但是,您可以将内容放置在 region-body 中并操纵其位置,使其与 region-start 重叠。XSL-FO提供fo:float机制来执行此操作。

<fo:block --extra wide and a negative left margin to overlap the region-start>
    <fo:float> this contains the margin note</fo:float>
    <fo:block>this contains the body text linked to the note</fo:block>
</fo:block>

FOP对 fo:float 的支持有限。商业 FO 处理器(我使用 Antennahouse Formatter)提供全面支持。

于 2017-12-21T08:41:55.047 回答