<?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="10pt">

                        <fo:table table-layout="fixed" width="9.5cm" border-bottom="0.01cm solid #000">
                            <fo:table-column column-width="8cm"/>
                            <fo:table-column column-width="1.5cm"/>
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell>
                                        <fo:block margin-bottom="0.75cm" font-weight="bold" font-size="12pt">EXPRESS - <xsl:value-of select="data/courier"/></fo:block>
                                        <fo:block>SAAJA:</fo:block>
                                        <fo:block font-weight="bold"><xsl:value-of select="data/recepient/name"/></fo:block>
                                        <fo:block margin-bottom="0.75cm"><xsl:value-of select="data/recepient/phone"/></fo:block>
                                        <fo:block>SIHTPUNKT:</fo:block>
                                        <fo:block margin-bottom="0.75cm" font-weight="bold"><xsl:value-of select="data/destination"/></fo:block>
                                        <fo:block margin-bottom="1.25cm" font-size="7pt">LISATEENUSED: <xsl:value-of select="data/additional"/></fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border-left="0.01cm solid #000" display-align="center" text-align="center">
                                        <fo:block-container reference-orientation="90">
                                            <fo:block wrap-option="no-wrap">SAATJA: <xsl:value-of select="data/sender"/></fo:block>
                                        </fo:block-container>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>

                        <fo:block padding="0.5cm 0.75cm" text-align="center">
                            <xsl:variable name="barcode">
                                <xsl:value-of select="data/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.05cm</barcode:module-width>
                                        <barcode:height>3cm</barcode:height>
                                    </barcode:code128>
                                </barcode:barcode>
                            </fo:instream-foreign-object>
                        </fo:block>

                        <fo:table table-layout="fixed" width="9.5cm" border-top="0.01cm solid #000">
                            <fo:table-column column-width="4.75cm"/>
                            <fo:table-column column-width="4.75cm"/>
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell padding-top="0.75cm">
                                        <fo:block><xsl:value-of select="data/transporter/name"/></fo:block>
                                        <fo:block><xsl:value-of select="data/transporter/address"/></fo:block>
                                        <fo:block><xsl:value-of select="data/transporter/city"/> <xsl:value-of select="data/transporter/zip"/></fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding-top="0.75cm" display-align="center" text-align="right">
                                        <fo:block><xsl:value-of select="data/transporter/www"/></fo:block>
                                        <fo:block><xsl:value-of select="data/transporter/email"/></fo:block>
                                        <fo:block><xsl:value-of select="data/transporter/phone"/></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>