Xml XSL FO:页眉和页脚内容正在溢出

Xml XSL FO:页眉和页脚内容正在溢出,xml,xsl-fo,Xml,Xsl Fo,我正在使用XSL-fo在docbook中生成modspecs的pdf版本。我当前正在使用此XSLT控制转换: ... <xsl:param name="footer.rule" select="0"/> <xsl:param name="header.rule" select="1"/> <xsl:param name="fop.extensions" select="0"/> <xsl:param name="fop1.extensions" sele

我正在使用XSL-fo在docbook中生成modspecs的pdf版本。我当前正在使用此XSLT控制转换:

...
<xsl:param name="footer.rule" select="0"/>
<xsl:param name="header.rule" select="1"/>
<xsl:param name="fop.extensions" select="0"/>
<xsl:param name="fop1.extensions" select="1"/>

<xsl:template match="node()|@*">
    <xsl:copy>
        <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
</xsl:template>

<xsl:template name="footer.content">
    <xsl:param name="pageclass" select="''"/>
    <xsl:param name="sequence" select="''"/>
    <xsl:param name="position" select="''"/>
    <xsl:param name="gentext-key" select="''"/>
    <fo:block space-before="12pt" keep-together.within-page="auto"/>
    <xsl:choose>
        <xsl:when test="$position = 'left'">
            <fo:block>Acme Corp</fo:block>
            <fo:block><fo:leader leader-pattern="space"/></fo:block>
        </xsl:when>
        <xsl:when test="$position = 'right'">
            <fo:block>Cool Stuff</fo:block>
            <fo:block>Page <fo:page-number/> of <fo:page-number-citation ref-id="last-page"/></fo:block>
        </xsl:when>
    </xsl:choose>
</xsl:template>
<xsl:template name="header.content">
    <xsl:param name="pageclass" select="''"/>
    <xsl:param name="sequence" select="''"/>
    <xsl:param name="position" select="''"/>
    <xsl:param name="gentext-key" select="''"/>
    <xsl:choose>
        <xsl:when test="$position = 'left'">
            <fo:block><fo:inline font-weight="bold"><xsl:value-of select="$app_name"/> - <xsl:value-of select="d:title/text()"/></fo:inline></fo:block>
            <fo:block>
                <fo:retrieve-marker retrieve-class-name="section.head.marker"
                    retrieve-position="first-including-carryover"
                    retrieve-boundary="page-sequence"/>
            </fo:block>
        </xsl:when>
        <xsl:when test="$position = 'right'">
            <fo:block>Version <xsl:value-of select="$app_version"/></fo:block>
            <fo:block> Build <xsl:value-of select="$build_number"/></fo:block>
        </xsl:when>
    </xsl:choose>
</xsl:template>

现在页眉和页脚显示良好,但由于某些原因,尤其是在modspec的早期页面上,页面内容与页眉和页脚重叠。有没有办法修复它,使其不再重叠?

尝试调整一些控制页面布局的参数。我将从body.margin.top和body.margin.bottom开始。请参见。

Ace,这是一个关于1 XSLT如何生成所需FO输出的问题,还是关于2生成什么FO输出的问题,还是关于3 FO为什么不生成所需PDF的问题?如果为1,请显示所需的FO输出与实际FO输出。如果我认为是2,为什么要向我们展示XSLT?请展示您当前FO输出的代表性示例,包括页面内容。如果是3,请说明您使用的是什么处理器。@LarsH:实际上主要是问题1。我希望XSLT能够被修复,从而防止内容溢出。就屏幕截图而言,我认为这有点多余。当前来自上一页的内容与页眉混淆,当前页内容的内容与页脚混淆。理想情况下,内容来自上一页。页面显示在页眉下方,当前页面的内容到达页脚时停止。这与XSLT无关。值得一提的是,您可以使用任何语言构建FO文档,但仍然会遇到这种特定的XSL-FOXML词汇表问题