"fo:page-sequence" 不是 "fo:block" 的有效子代。有没有办法来解决这个问题?

"fo:page-sequence" is not a valid child of "fo:block". Is there a way to fix this?

我正在尝试在模板匹配 table 时更改页面序列。我使用宽 tables,不适合 A4,因此需要将页面横向放置。

        <xsl:message>Outputclass: <xsl:value-of select="@outputclass"/></xsl:message>
        <fo:page-sequence master-reference="{if (@outputclass = 'landscape') then 'landscape-sequence' else 'ditamap-body-sequence'}" xsl:use-attribute-sets="page-sequence.body">
                <xsl:call-template name="startPageNumbering"/>
                <xsl:call-template name="insertBodyStaticContents"/>
                <fo:flow flow-name="xsl-region-body">
                    <xsl:variable name="scale" as="xs:string?">
                        <xsl:call-template name="getTableScale"/>
                    </xsl:variable>

                    <fo:block-container xsl:use-attribute-sets="table__container">
                        <fo:block xsl:use-attribute-sets="table">
                            <xsl:call-template name="commonattributes"/>
                            <xsl:if test="not(@id)">
                            <xsl:attribute name="id">
                                <xsl:call-template name="get-id"/>
                            </xsl:attribute>
                            </xsl:if>
                            <xsl:if test="exists($scale)">
                                <xsl:attribute name="font-size" select="concat($scale, '%')"/>
                            </xsl:if>
                            <xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-startprop ')]" mode="outofline"/>
                            <xsl:apply-templates/>
                            <xsl:apply-templates select="*[contains(@class,' ditaot-d/ditaval-endprop ')]" mode="outofline"/>
                        </fo:block>
                    </fo:block-container>
                </fo:flow>
        </fo:page-sequence>
    </xsl:template>

有没有办法像这样更改页面顺序?

  1. 您可以尝试 Crane Softwrights 的“Page Sequence Master Interleave (PSMI)”实用程序(参见 https://cranesoftwrights.github.io/resources/psmi/
  2. 如果 FOP 支持页面浮动(参见 https://xmlgraphics.apache.org/fop/compliance.html#fo-property-float),那么您可能已经将横向 table 浮动到下一页。
  3. 如果您使用的是 AH 格式化程序,那么您可以使用嵌套 fo:page-sequence(参见 https://www.antenna.co.jp/AHF/help/v70e/ahf-ext.html#fo.page-sequence