xsltxsl-fo

Remove space between static content and flow


For some reasons, a margin is automatically added between <fo:static-content flow-name="xsl-region-before"> and <fo:flow flow-name="xsl-region-body" space-before="0pt" margin-top ="0pt" padding-top="0pt">.

How can I remove it?

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:fo="http://www.w3.org/1999/XSL/Format">

    <xsl:template match="/">
        <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
            <fo:layout-master-set>
                <fo:simple-page-master master-name="A4" page-width="210mm" page-height="297mm" margin="10mm">
                    <fo:region-body margin-top="20mm" margin-bottom="20mm"/>
                    <fo:region-before extent="20mm"/>
                    <fo:region-after extent="20mm"/>
                </fo:simple-page-master>
            </fo:layout-master-set>

            <fo:page-sequence master-reference="A4">
                <fo:static-content flow-name="xsl-region-before">
                    <fo:block-container width="539.3px" height="20px" padding="0px" margin="0px" border-bottom="1pt solid black">
                        <fo:block>
                            <fo:inline font-family="arialBold" font-size="18px" font-weight="bold" color="#000000">
                                Задачи обработки отправлений
                            </fo:inline>
                            <fo:inline font-family="arial" font-size="8px" color="#000000">
                                Страница <fo:page-number/>/<fo:page-number-citation ref-id="end-of-doc"/>
                            </fo:inline>
                            <fo:leader leader-length="37px"/>
                            <fo:inline font-family="arial" font-size="18px" font-weight="bold" color="#000000">
                                <xsl:value-of select="AppealPrintFormList/currentDate"/> в <xsl:value-of select="AppealPrintFormList/currentTime"/>
                            </fo:inline>
                        </fo:block>
                    </fo:block-container>
                </fo:static-content>

                <fo:flow flow-name="xsl-region-body" space-before="0pt" margin-top="0pt" padding-top="0pt">
                    <xsl:for-each select="AppealPrintFormList/AppealPrintForm">
                        <fo:table table-layout="fixed" width="556px">
                            <fo:table-column column-width="91px"/>
                            <fo:table-column column-width="162px"/>
                            <fo:table-column column-width="37.5%"/>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell padding="0px">
                                        <fo:block font-family="arial" font-size="12px" font-weight="bold">
                                            <xsl:value-of select="clientSystemOrderNumber"/>
                                        </fo:block>
                                        <fo:block font-family="arial" font-size="8px" color="#7F7F7F" font-weight="bold">
                                            <xsl:value-of select="appealType"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="0px">
                                        <fo:block font-family="arial" font-size="8px" color="#000000">
                                            Получ.: <xsl:value-of select="contactPhone"/>
                                        </fo:block>
                                        <fo:block font-family="arialBold" font-size="8px" color="#000000">
                                            Отпр.: <xsl:value-of select="sender"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="0px">
                                        <fo:block-container margin-left="12.5px" padding="0px" text-align="left" start-indent="0px" end-indent="0px">
                                            <fo:block margin="0px" padding="0px">
                                                <fo:inline font-family="arialBold" font-weight="bold" font-size="8px" color="#000000">
                                                    <xsl:value-of select="barcode"/>
                                                </fo:inline>
                                                <fo:leader leader-length="6px"/>
                                                <fo:inline font-family="arial" font-size="8px" color="#000000">
                                                    <xsl:value-of select="ukdRegisterWeight"/> кг
                                                </fo:inline>
                                                <fo:leader leader-length="4px"/>
                                                <fo:inline font-family="arial" font-size="8px" color="#000000">
                                                    <xsl:value-of select="routeName"/>
                                                </fo:inline>
                                            </fo:block>
                                            <fo:block margin="0px" padding="0px">
                                                <fo:inline font-family="arialBold" font-size="8px" color="#000000">
                                                    <xsl:value-of select="mailType"/>
                                                </fo:inline>
                                                <fo:leader leader-length="6px"/>
                                                <fo:inline font-family="arial" font-size="8px" color="#000000">
                                                    <xsl:value-of select="rpoStatus"/> кг
                                                </fo:inline>
                                                <fo:leader leader-length="6px"/>
                                                <fo:inline font-family="arial" font-size="8px" color="#000000">
                                                    <xsl:value-of select="deliveryDate"/>
                                                </fo:inline>
                                            </fo:block>
                                        </fo:block-container>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>

                        <fo:table table-layout="fixed" width="556px" space-before="8px">
                            <fo:table-column column-width="50%"/>
                            <fo:table-column column-width="25%"/>
                            <fo:table-column column-width="22%"/>

                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell padding="0px">
                                        <fo:block font-family="arial" font-size="8px" color="#000000">
                                            <xsl:value-of select="essence"/>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="0px">
                                        <fo:block font-family="arial" font-size="8px" color="#000000">
                                            <xsl:value-of select="zoneDescription"/>
                                        </fo:block>
                                        <fo:block font-family="arial" font-size="8px" color="#7F7F7F">
                                            Текущая зона
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding="0px">
                                        <fo:block-container border-bottom="0.4px solid black" height="10px" width="100%">
                                            <fo:block> </fo:block>
                                        </fo:block-container>
                                        <fo:block font-family="arial" margin-top="1px" font-size="8px" color="#7F7F7F">
                                            Новая зона
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>
                        <fo:block-container space-before="5px" space-after="8px" border="0.4pt dashed black" width="100%">
                            <fo:block> </fo:block>
                        </fo:block-container>
                    </xsl:for-each>
                    <fo:block id="end-of-doc"/>
                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>
</xsl:stylesheet>

I tried to remove all indents by setting <fo:static-content flow-name="xsl-region-before" space-after="0pt" padding="0px" margin="0px"> and <fo:flow flow-name="xsl-region-body" space-before="0pt" margin-top="0pt" padding-top="0pt"> but that didn't help.


Solution

  • Your region-body has a margin. The flow is inside that region.