<?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="6pt">

                        <fo:table table-layout="fixed" width="9.5cm">
                            <fo:table-column column-width="3cm"/>
                            <fo:table-column column-width="4.5cm"/>
                            <fo:table-column column-width="2cm"/>
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell padding-bottom="0.25cm" padding-right="0.25cm" display-align="after">
                                        <fo:block text-align="left">
                                            <fo:external-graphic content-height="scale-to-fit" width="2.75cm">
                                                <xsl:attribute name="src">
                                                    <xsl:value-of select="data/logos/netlux"/>
                                                </xsl:attribute>
                                            </fo:external-graphic>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding-bottom="0.25cm" display-align="after">
                                        <fo:block text-align="right">
                                            <xsl:variable name="barcode">
                                                <xsl:value-of select="data/logos/barcode" />
                                            </xsl:variable>
                                            <fo:instream-foreign-object>
                                                <barcode:barcode xmlns:barcode="http://barcode4j.krysalis.org/ns" message="{$barcode}">
                                                    <barcode:code128>
                                                        <barcode:height>0.85cm</barcode:height>
                                                        <barcode:module-width>0.25mm</barcode:module-width>
                                                        <barcode:human-readable>bottom</barcode:human-readable>
                                                    </barcode:code128>
                                                </barcode:barcode>
                                            </fo:instream-foreign-object>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell padding-bottom="0.25cm" padding-left="0.25cm" display-align="after">
                                        <fo:block text-align="right">
                                            <fo:external-graphic content-height="scale-to-fit" width="1.75cm">
                                                <xsl:attribute name="src">
                                                    <xsl:value-of select="data/logos/nt"/>
                                                </xsl:attribute>
                                            </fo:external-graphic>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>

                        <fo:table table-layout="fixed" width="9.5cm">
                            <fo:table-column column-width="4.75cm"/>
                            <fo:table-column column-width="4.75cm"/>
                            <fo:table-body>
                                <fo:table-row>
                                    <fo:table-cell border="0.5pt solid #000000" padding="0.25cm">
                                        <fo:block margin-bottom="0.25cm">
                                            <fo:block font-size="7pt" font-weight="bold">Pick up Address</fo:block>
                                        </fo:block>
                                        <fo:block margin-bottom="0.25cm">
                                            <fo:block font-weight="bold"><xsl:value-of select="data/pickup/name"/></fo:block>
                                            <fo:block><xsl:value-of select="data/pickup/address"/></fo:block>
                                            <fo:block><xsl:value-of select="data/pickup/city"/></fo:block>
                                            <fo:block><xsl:value-of select="data/pickup/country"/></fo:block>
                                        </fo:block>
                                        <fo:block>
                                            <fo:block><xsl:value-of select="data/pickup/data"/></fo:block>
                                            <fo:block><xsl:value-of select="data/pickup/phone"/></fo:block>
                                        </fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="0.5pt solid #000000" padding="0.25cm">
                                        <fo:block margin-bottom="0.25cm">
                                            <fo:block font-size="7pt" font-weight="bold">Delivery Address</fo:block>
                                        </fo:block>
                                        <fo:block margin-bottom="0.25cm">
                                            <fo:block font-weight="bold"><xsl:value-of select="data/delivery/name"/></fo:block>
                                            <fo:block><xsl:value-of select="data/delivery/address"/></fo:block>
                                            <fo:block><xsl:value-of select="data/delivery/city"/></fo:block>
                                            <fo:block><xsl:value-of select="data/delivery/country"/></fo:block>
                                        </fo:block>
                                        <fo:block>
                                            <fo:block><xsl:value-of select="data/delivery/data"/></fo:block>
                                            <fo:block><xsl:value-of select="data/delivery/phone"/></fo:block>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-columns-spanned="2" border="0.5pt solid #000000" padding="0.25cm">
                                        <fo:block margin-bottom="0.25cm">
                                            <fo:inline font-size="7pt" font-weight="bold">Shipment details : </fo:inline>
                                            <fo:inline><xsl:value-of select="data/shipment/number"/></fo:inline>
                                        </fo:block>
                                        <fo:block>
                                            <fo:table table-layout="fixed" width="100%">
                                                <fo:table-column column-width="15%"/>
                                                <fo:table-column column-width="15%"/>
                                                <fo:table-column column-width="35%"/>
                                                <fo:table-column column-width="35%"/>
                                                <fo:table-body>
                                                    <fo:table-row>
                                                        <fo:table-cell>
                                                            <fo:block><xsl:value-of select="data/shipment/count"/></fo:block>
                                                        </fo:table-cell>
                                                        <fo:table-cell>
                                                            <fo:block><xsl:value-of select="data/shipment/weight"/></fo:block>
                                                        </fo:table-cell>
                                                        <fo:table-cell>
                                                            <fo:block><xsl:value-of select="data/shipment/a"/></fo:block>
                                                        </fo:table-cell>
                                                        <fo:table-cell>
                                                            <fo:block><xsl:value-of select="data/shipment/b"/></fo:block>
                                                        </fo:table-cell>
                                                    </fo:table-row>
                                                </fo:table-body>
                                            </fo:table>
                                        </fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell border="0.5pt solid #000000" padding="0.25cm" display-align="after">
                                        <fo:block margin-bottom="0.25cm" font-size="7pt" font-weight="bold">Order details</fo:block>
                                        <fo:block><xsl:value-of select="data/details/date"/></fo:block>
                                    </fo:table-cell>
                                    <fo:table-cell border="0.5pt solid #000000" padding="0.25cm" display-align="after">
                                        <fo:block><xsl:value-of select="data/details/a"/></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                                <fo:table-row>
                                    <fo:table-cell number-columns-spanned="2" border="0.5pt solid #000000" height="2cm" padding="0.25cm">
                                        <fo:block margin-bottom="0.25cm" font-size="7pt" font-weight="bold">More information / remarks</fo:block>
                                        <fo:block><xsl:value-of select="data/details/remarks"/></fo:block>
                                    </fo:table-cell>
                                </fo:table-row>
                            </fo:table-body>
                        </fo:table>

                        <fo:block padding-top="0.1cm" text-align="right">www.netlux.fi</fo:block>

                    </fo:block>

                </fo:flow>
            </fo:page-sequence>
        </fo:root>
    </xsl:template>
</xsl:stylesheet>