1
<?xml version="1.0" encoding="utf-8"?>
2
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
3
<xsl:variable name="initial_bottom_pos">24.5</xsl:variable>
4
<xsl:variable name="initial_left_pos">0.5</xsl:variable>
5
<xsl:variable name="height_increment">4.8</xsl:variable>
6
<xsl:variable name="width_increment">10</xsl:variable>
7
<xsl:variable name="frame_height">3cm</xsl:variable>
8
<xsl:variable name="frame_width">9.3cm</xsl:variable>
9
<xsl:variable name="number_columns">2</xsl:variable>
10
<xsl:variable name="max_frames">16</xsl:variable>
12
<xsl:template match="/">
13
<xsl:apply-templates select="lots"/>
16
<xsl:template match="lots">
18
<template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Address list" author="Generated by Tiny ERP">
19
<pageTemplate id="all">
21
<xsl:apply-templates select="lot-line" mode="frames"/>
25
<paraStyle name="nospace" fontName="Courier" fontSize="10" spaceBefore="0" spaceAfter="0"/>
26
<blockTableStyle id="mytable">
27
<blockBackground colorName="lightred" start="0,0" stop="0,0"/>
28
<blockBackground colorName="lightgrey" start="1,0" stop="-1,0"/>
29
<blockAlignment value="CENTER"/>
30
<blockValign value="MIDDLE"/>
31
<blockFont name="Helvetica-BoldOblique" size="14" start="0,0" stop="-1,0"/>
32
<blockFont name="Helvetica" size="8" start="0,1" stop="-1,1"/>
33
<lineStyle kind="GRID" colorName="black" tickness="1"/>
37
<xsl:apply-templates select="lot-line" mode="story"/>
42
<xsl:template match="lot-line" mode="frames">
43
<xsl:if test="position() < $max_frames + 1">
45
<xsl:attribute name="width">
46
<xsl:value-of select="$frame_width"/>
48
<xsl:attribute name="height">
49
<xsl:value-of select="$frame_height"/>
51
<xsl:attribute name="x1">
52
<xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
53
<xsl:text>cm</xsl:text>
55
<xsl:attribute name="y1">
56
<xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
57
<xsl:text>cm</xsl:text>
63
<xsl:template match="lot-line" mode="story">
64
<blockTable style="mytable" colWidths="2.8cm,5.4cm">
67
<para style="nospace"><xsl:value-of select="code"/></para>
69
<para style="nospace"><xsl:value-of select="price"/> EUR</para>
73
<barCode><xsl:value-of select="tracking"/></barCode>
75
<para style="nospace"><xsl:value-of select="product"/></para><xsl:text>, </xsl:text>
76
<para style="nospace"><xsl:value-of select="variant"/></para>