我有一份用XML编码的中世纪手稿(使用TEI模式)。手稿有一个“身体”,已经被映射成XSL:FO到xsl-region-body,输出非常完美。这份手稿还在左边和右边的空白处出现了一些“亮点”(注)。这些标记在XML文档中,例如使用<add type="margin_gloss" place="left">Some foo note</add>。
我已经保留了xsl-region-start和xsl-region-end,以获得与他们在原稿中的位置相关的保证金。然而,我很难让标记的文本“流”到这些区域。
注意:我没有问题将硬编码数据放入这些区域,例如,使用<fo:static-content flow-name="xsl-region-after">。
问题是,使用下面的代码,Apache告诉我: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>标记的边距在xsl-region-start中出现,xsl-region-end相对于xsl-region-body中的文本行显示。FPO告诉我我不能“流”两次。
发布于 2017-12-21 08:41:55
不能同步区域中的内容--从区域主体中的内容开始。
但是,您可以将内容放置在区域体中,并对其位置进行操作,使其与区域启动重叠。XSL-FO 提供 fo:浮动机制来实现这一点.
<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格式化程序)提供完全支持。
https://stackoverflow.com/questions/47913961
复制相似问题