<?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:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <fo:root>
      <fo:layout-master-set>
        <fo:simple-page-master master-name="A6" page-width="10.5cm" page-height="14.8cm" margin="0.5cm">
          <fo:region-body/>
        </fo:simple-page-master>
      </fo:layout-master-set>
      <fo:page-sequence master-reference="A6">
        <fo:flow flow-name="xsl-region-body">
          
          <fo:block font-family="Helvetica" font-size="8pt">
            <fo:table table-layout="fixed" width="9.5cm">
              <fo:table-column column-width="5.5cm"/>
              <fo:table-column column-width="4cm"/>
              <fo:table-body>
                <fo:table-row>
                  <fo:table-cell border-bottom="0.5pt solid #000000" border-right="0.5pt solid #000000" height="3cm" padding="0.1cm">
                    <fo:block-container font-size="11pt">
                      <fo:block margin-bottom="0.1cm" font-weight="bold"><xsl:value-of select="data/block-a/title"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-a/name"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-a/street"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-a/city"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-a/company"/></fo:block>
                    </fo:block-container>
                  </fo:table-cell>
                  <fo:table-cell border-bottom="0.5pt solid #000000" height="3cm" padding="0.1cm">
                    <fo:block-container>
                      <fo:block><xsl:value-of select="data/block-b/company"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/address"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/city"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/phone"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/fax"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/email"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-b/www"/></fo:block>
                      <fo:block>
                        <fo:external-graphic content-height="scale-to-fit" width="2.5cm">
                          <xsl:attribute name="src">
                            <xsl:value-of select="data/block-b/img"/>
                          </xsl:attribute>
                        </fo:external-graphic>
                      </fo:block>
                    </fo:block-container>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row>
                  <fo:table-cell border-bottom="0.5pt solid #000000" border-right="0.5pt solid #000000" height="5.6cm" padding="0.1cm">
                    <fo:block-container font-size="17pt">
                      <fo:block margin-bottom="0.1cm" font-weight="bold"><xsl:value-of select="data/block-c/title"/></fo:block>
                      <fo:block><xsl:value-of select="data/block-c/text"/></fo:block>
                    </fo:block-container>
                  </fo:table-cell>
                  <fo:table-cell border-bottom="0.5pt solid #000000" height="5.6cm" padding="0.1cm">
                    <fo:block-container font-size="11pt">
                      <fo:block font-size="17pt"><xsl:value-of select="data/block-d/title"/></fo:block>
                      <fo:block>
                        <xsl:value-of select="data/block-d/text"/>
                      </fo:block>
                      <fo:block><xsl:value-of select="data/block-d/number"/></fo:block>
                    </fo:block-container>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row>
                  <fo:table-cell number-columns-spanned="2" border-bottom="0.5pt solid #000000" text-align="center" padding="0.15cm">
                    <fo:block font-size="9pt"><xsl:value-of select="data/block-e"/></fo:block>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row>
                  <fo:table-cell number-columns-spanned="2" border-bottom="0.5pt solid #000000" text-align="center" padding="0.15cm">
                    <fo:block>
                      <xsl:variable name="barcode">
                        <xsl:value-of select="data/block-f/barcode"/>
                      </xsl:variable>
                      <fo:instream-foreign-object>
                        <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="{$barcode}" orientation="0">
                          <barcode:code128>
                            <barcode:module-width>0.04cm</barcode:module-width>
                            <barcode:height>2cm</barcode:height>
                            <barcode:human-readable>none</barcode:human-readable>
                          </barcode:code128>
                        </barcode:barcode>
                      </fo:instream-foreign-object>
                    </fo:block>
                    <fo:block>
                      <xsl:value-of select="data/block-f/barcode"/>
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
                <fo:table-row>
                  <fo:table-cell number-columns-spanned="2" border-bottom="0.5pt solid #000000" padding="0.15cm 0">
                    <fo:block font-size="5pt">
                      <xsl:value-of select="data/block-g"/>
                    </fo:block>
                  </fo:table-cell>
                </fo:table-row>
              </fo:table-body>
            </fo:table>
          </fo:block>

        </fo:flow>
      </fo:page-sequence>
    </fo:root>
  </xsl:template>
</xsl:stylesheet>