Now I am a little worried 

I have used the block-containers because a good method for job seemed me (type Chinese boxes) to manage areas with edges, with background-color etc. 

It is better that I attach everything of my file of test to make to understand you what I intend to do. 

Thanks for the support

 

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet xmlns="http://www.csb.it/be/stampe/templates" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

 

   <xsl:template match="/">

 

      <fo:root>

         <fo:layout-master-set>

 

            <fo:simple-page-master master-name="doc" page-width="210mm" page-height="296mm" margin-top="10mm" margin-bottom="5mm" margin-left="5mm" margin-right="5mm">

 

               <fo:region-before region-name="areaHeader" extent="0mm"/>

               <fo:region-body region-name="areaBody" margin-top="0mm"/>

            </fo:simple-page-master>

         </fo:layout-master-set>

 

         <fo:page-sequence master-reference="doc" initial-page-number="1" force-page-count="no-force" country="it" language="it">

        

            <fo:static-content flow-name="areaHeader">       

               <xsl:call-template name="templateHeader"/>

            </fo:static-content>

        

            <fo:flow flow-name="areaBody">

               <xsl:call-template name="templateBody"/>

            </fo:flow>

         </fo:page-sequence>

      </fo:root>

   </xsl:template>

 

   <xsl:template name="templateTestata">

      <fo:block-container font-size="9pt" height="110mm" width="200mm" position="absolute">

         <fo:block-container font-size="7pt" height="36mm" width="200mm" position="absolute">

            <fo:block-container height="36mm" width="169mm" position="absolute">

               <fo:block-container border-style="solid" border-width="0.5pt" border-color="grey" height="9mm" width="169mm" position="absolute">

                 

                  <fo:block-container height="9mm" width="58mm" left="13mm" position="absolute">

                     <fo:block font-weight="bold" space-before="1.5mm">

                        heading 1

                     </fo:block>

                     <fo:block font-weight="bold">

                        heading 2

                     </fo:block>

                  </fo:block-container>

                 

                  <fo:block-container height="9mm" width="80mm" left="85mm" position="absolute">

                     <fo:block space-before="1.5mm">

                        <xsl:value-of select="//xmlFile/heading3"/>

                     </fo:block>

                     <fo:block>

                        <xsl:value-of select="//xmlFile/heading4"/>

                     </fo:block>

                  </fo:block-container>

               </fo:block-container>

 

              

               <fo:block-container border-style="solid" border-width="0.5pt" border-color="grey" height="15mm" width="169mm" top="9mm" position="absolute">

           

                  <fo:block-container height="17mm" width="58mm" left="13mm" position="absolute">

                     <fo:block space-before="1.5mm">

                        heading 5

                     </fo:block>

                     <fo:block>

                        heading 6

                     </fo:block>

                     <fo:block>

                        heading 7

                     </fo:block>                    

                     <fo:block>

                        heading 8

                     </fo:block>

                  </fo:block-container>

              

                  <fo:block-container height="17mm" width="80mm" left="85mm" position="absolute">

                                                                                  <fo:block space-before="1.5mm">

                                                                                              telefhon

                                                                                              <xsl:value-of select="//xmlFile/telephon"/>

                                                                                  </fo:block>

                                                                                  <fo:block>

                                                                                              Fax

                                                                                              <xsl:value-of select="//xmlFile/Fax"/>

                                                                                  </fo:block>

                                                                                  <fo:block>

                                                                                              Fax 2

                                                                                              <xsl:value-of select="//xmlFile/Fax"/>

                                                                                  </fo:block>

                                                                                  <fo:block>

                                                                                              Internet

                                                                                              <xsl:value-of select="//xmlFile/www"/>

                                                                                  </fo:block>

                  </fo:block-container>

               </fo:block-container>

 

              

               <fo:block-container border-style="solid" border-width="0.5pt" border-color="grey" height="9mm" width="169mm" top="24mm" position="absolute">

           

                  <fo:block-container height="9mm" width="58mm" left="13mm" position="absolute">

                     <fo:block space-before="1.5mm">

                        VAT

                        <xsl:value-of select="//xmlFile/vat"/>

                     </fo:block>

                     <fo:block>

                        FC

                        <xsl:value-of select="//xmlFile/fiscalCode"/>

                     </fo:block>

                  </fo:block-container>

                 

                  <fo:block-container height="9mm" width="80mm" left="85mm" position="absolute">

                     <fo:block space-before="1.5mm">

                        heading 9

                        <xsl:value-of select="//xmlFile/heading9"/>

                     </fo:block>

                     <fo:block>

                        <xsl:value-of select="//xmlFile/heading10"/>

                     </fo:block>

                  </fo:block-container>

               </fo:block-container>

            </fo:block-container>

 

           

            <fo:block-container height="36mm" width="28mm" left="172mm" position="absolute">

               <xsl:variable name="var_url_1" select="//xmlFile/url"/>

               <fo:block>

                  <fo:external-graphic src="url('{$var_url_1}')" scaling="uniform" width="28mm"/>

               </fo:block>

            </fo:block-container>

         </fo:block-container>

 

         

         <fo:block-container background-color="rgb(231,231,231)" height="10mm" width="200mm" top="38mm" position="absolute">

            <fo:block font-size="16pt" font-weight="bold" text-align="start" space-before="2mm" start-indent="3mm">

               TITLED

            </fo:block>

         </fo:block-container>

 

                                  

         <fo:block-container font-size="10pt" height="46mm" width="200mm" top="52mm" position="absolute">

           

            <fo:block-container height="46mm" width="88mm" left="3mm" position="absolute">

               <fo:block font-size="6pt">

                  customer

               </fo:block>

               <fo:block space-before="2mm">

                  <xsl:value-of select="//customer/socrag"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//customer/socrag2"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//customer/address"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//customer/address2"/>

               </fo:block>

                                                           <fo:block>

                                                                       <xsl:value-of select="//customer/state"/>

                                                           </fo:block>

            </fo:block-container>

           

            <fo:block-container height="30mm" width="90mm" left="105mm" position="absolute">

               <fo:block font-size="6pt">

                  Delivery

               </fo:block>

               <fo:block space-before="2mm">

                  <xsl:value-of select="//delivery/socrag"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//delivery/socrag2"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//delivery/address"/>

               </fo:block>

               <fo:block>

                  <xsl:value-of select="//delivery/address2"/>

               </fo:block>

                                                           <fo:block>

                                                                       <xsl:value-of select="//delivery/state"/>

                                                           </fo:block>

                                               </fo:block-container>

            

            <fo:block-container height="10mm" width="90mm" top="30mm" left="105mm" position="absolute">

               <fo:block>

                  Code

                  <xsl:value-of select="//sog/code"/>

               </fo:block>

               <fo:block>

                  Reference:

                  <xsl:value-of select="//sog/reference"/>

               </fo:block>

            </fo:block-container>

         </fo:block-container>

        

        

         <fo:block-container height="15mm" width="200mm" top="95mm" id="onLastPage" position="absolute">

                                              

                                               <fo:block color="grey">

                                                           <fo:leader leader-pattern="rule" leader-length="200mm"/>

                                               </fo:block>

 

          

            <fo:block-container background-color="rgb(231,231,231)" height="7mm" width="8mm" top="4mm" position="absolute">

               <fo:block font-size="6pt" start-indent="0.5mm">

                  Pag

               </fo:block>

               <fo:block space-before="0.5mm" text-align="center">

                  <fo:page-number/> /

                                                                       <fo:page-number-citation ref-id="onLastPage"/>

               </fo:block>

            </fo:block-container>

  

            <fo:block-container background-color="rgb(231,231,231)" height="7mm" width="20mm" top="4mm" left="9mm" position="absolute">

               <fo:block font-size="6pt" start-indent="0.5mm">

                  Date

               </fo:block>

               <fo:block space-before="0.5mm" text-align="center">

                  <xsl:value-of select="//document/date"/>

               </fo:block>

            </fo:block-container>

         

            <fo:block-container background-color="rgb(231,231,231)" height="7mm" width="16mm" top="4mm" left="30mm" position="absolute">

               <fo:block font-size="6pt" start-indent="0.5mm">

                  Number

               </fo:block>

               <fo:block space-before="0.5mm" text-align="center">

                  <xsl:value-of select="//document/number"/>

               </fo:block>

            </fo:block-container>

 

            <fo:block-container background-color="rgb(231,231,231)" height="7mm" width="65mm" top="4mm" left="47mm" position="absolute">

               <fo:block font-size="6pt" start-indent="0.5mm">

                  Payment

               </fo:block>

               <fo:block space-before="0.5mm" start-indent="0.5mm" text-align="start">

                  <xsl:value-of select="//document/payment"/>

               </fo:block>

            </fo:block-container>

 

            <fo:block-container background-color="rgb(231,231,231)" height="7mm" width="87mm" top="4mm" left="113mm" position="absolute">

               <fo:block font-size="6pt" start-indent="0.5mm">

                  Bamk

               </fo:block>

               <fo:block space-before="0.5mm" start-indent="0.5mm" text-align="start">

                  <xsl:value-of select="//document/bank"/>

               </fo:block>

            </fo:block-container>

                                               <fo:block color="grey" space-before="6mm">

                                                           <fo:leader leader-pattern="rule" leader-length="200mm"/>

                                               </fo:block>

         </fo:block-container>

      </fo:block-container>

   </xsl:template>

 

   <xsl:template name="templateBody">

     

      <fo:block-container height="170mm" width="200mm" top="110mm" position="absolute">

        

         <fo:block-container font-size="9pt" height="120mm" width="200mm" position="absolute">

            

            <fo:table table-layout="fixed">

               

               <fo:table-column column-number="1" column-width="125mm"/>

               <fo:table-column column-number="2" column-width="15mm"/>

               <fo:table-column column-number="3" column-width="30mm"/>

               <fo:table-column column-number="4" column-width="30mm"/>

 

               <fo:table-header>

                  <fo:table-row>

                     <fo:table-cell column-number="1">

                        <fo:block>Article</fo:block>

                     </fo:table-cell>

                     <fo:table-cell column-number="2">

                        <fo:block font-size="6pt" start-indent="3mm">Quantity</fo:block>

                     </fo:table-cell>

                     <fo:table-cell column-number="3">

                        <fo:block font-size="6pt" start-indent="10mm">Price</fo:block>

                     </fo:table-cell>

                     <fo:table-cell column-number="4">

                        <fo:block font-size="6pt" start-indent="12mm">Amount</fo:block>

                     </fo:table-cell>

                  </fo:table-row>

               </fo:table-header>

 

               <fo:table-body space-before="1mm">

                

                  <xsl:for-each select="//body/*">

                     <fo:table-row line-height="5mm">

                        <fo:table-cell>

                           <fo:block text-align="start">

                              <xsl:value-of select="article"/>

                           </fo:block>

                        </fo:table-cell>

                        <fo:table-cell>                       

                           <fo:block text-align="end">

                              <xsl:value-of select="quantity"/>

                           </fo:block>

                        </fo:table-cell>

                        <fo:table-cell>                        

                           <fo:block text-align="end">

                              <xsl:value-of select="price"/>

                           </fo:block>

                        </fo:table-cell>                          

                        <fo:table-cell>                          

                           <fo:block text-align="end">

                              <xsl:value-of select="amount"/>

                           </fo:block>

                        </fo:table-cell>

                     </fo:table-row>

                  </xsl:for-each>

               </fo:table-body>

            </fo:table>

         </fo:block-container>

        

 

         <fo:block-container height="40mm" width="200mm" top="130mm" position="absolute">

 

                                               <fo:block-container height="20mm" width="200mm" position="absolute">

                                                           <fo:block font-size="10pt" font-weight="bold">

                                                                       <xsl:value-of select="//line1"/>

                                                           </fo:block>     

                                                           <fo:block color="grey">

                                                                       <fo:leader leader-pattern="rule" leader-length="200mm"/>

                                                           </fo:block>

                                               </fo:block-container>

                                              

 

                                               <fo:block-container height="20mm" width="40mm" top="15mm" left="160mm" position="absolute">

                                                           <fo:block font-size="6pt" font-weight="bold">

                                                                       TOTAL

                                                           </fo:block>

                                                           <fo:block-container font-size="9pt" height="10mm" width="15mm" top="5mm" position="absolute">

                                                                       <fo:block font-weight="bold" text-align="start">

                                                                                  <xsl:value-of select="//total/euro"/>

                                                                       </fo:block>

                                                           </fo:block-container>

                                                           <fo:block-container font-size="9pt" height="10mm" width="28mm" top="5mm" left="12.5mm" position="absolute">

                                                                       <fo:block font-weight="bold" text-align="end">

                                                                                  <xsl:value-of select="//total/amount"/>

                                                                       </fo:block>

                                                           </fo:block-container>

                                               </fo:block-container>

 

                                               <fo:block-container height="8mm" width="200mm" top="30mm" position="absolute">

                                                           <fo:block font-size="7pt">

                                                                       <xsl:value-of select="//line2"/>

                                                           </fo:block>                 

                        <fo:block color="grey">

                                   <fo:leader leader-pattern="rule" leader-length="200mm"/>

                        </fo:block>

                                               </fo:block-container>

         </fo:block-container>

      </fo:block-container>

   </xsl:template>

</xsl:stylesheet>