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">
4
<xsl:variable name="number_columns">6</xsl:variable>
6
<xsl:variable name="initial_left_pos">1.2</xsl:variable>
7
<xsl:variable name="width_increment">3.3</xsl:variable>
8
<xsl:variable name="frame_width">3.0cm</xsl:variable>
10
<xsl:variable name="width_col1">1.2cm</xsl:variable>
11
<xsl:variable name="width_col2">1.8cm</xsl:variable>
13
<xsl:variable name="bottom_pos">2.4cm</xsl:variable>
14
<xsl:variable name="frame_height">26cm</xsl:variable>
16
<xsl:template match="/">
17
<xsl:apply-templates select="results"/>
20
<xsl:template match="results">
21
<document filename="example_5.pdf">
22
<template pageSize="21cm,29.7cm" leftMargin="1.5cm" rightMargin="1.5cm" topMargin="1.5cm" bottomMargin="1.5cm" title="Bordereau acheteur" author="Generated by Tiny ERP, Fabien Pinckaers" allowSplitting="20">
23
<pageTemplate id="main">
25
<fill color="(0.4,0.4,0.4)"/>
26
<stroke color="(0.4,0.4,0.4)"/>
27
<setFont name="Helvetica" size="8"/>
28
<drawString x="1.8cm" y="1.4cm"><xsl:value-of select="auction/name"/></drawString>
29
<drawRightString x="19.2cm" y="1.4cm"><xsl:value-of select="auction/date-au1"/></drawRightString>
30
<lineMode width="0.2mm"/>
31
<lines>1.8cm 1.8cm 19.2cm 1.8cm</lines>
33
<xsl:apply-templates select="lines/lot" mode="frames"/>
38
<paraStyle name="name" fontName="Helvetica-Bold" fontSize="16" alignment="center"/>
39
<blockTableStyle id="result">
40
<blockValign value="TOP"/>
41
<blockAlignment value="RIGHT" start="-1,0" stop="-1,-1"/>
42
<blockAlignment value="CENTER" start="0,0" stop="0,-1"/>
43
<blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
44
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
45
<blockTextColor colorName="white" start="0,0" stop="-1,0"/>
46
<lineStyle kind="LINEBELOW" colorName="red" start="0,0" stop="-1,0"/>
47
<lineStyle kind="LINEBEFORE" colorName="grey" start="-1,0" stop="-1,-1"/>
48
<lineStyle kind="LINEBEFORE" colorName="black" start="0,1" stop="0,-1"/>
49
<lineStyle kind="LINEAFTER" colorName="black" start="-1,1" stop="-1,-1"/>
54
<xsl:apply-templates select="lines"/>
60
<xsl:template match="lines/lot" mode="frames">
61
<xsl:if test="position() < $number_columns + 1">
63
<xsl:attribute name="width">
64
<xsl:value-of select="$frame_width"/>
66
<xsl:attribute name="height">
67
<xsl:value-of select="$frame_height"/>
69
<xsl:attribute name="x1">
70
<xsl:value-of select="$initial_left_pos + (position()-1) * $width_increment"/>
71
<xsl:text>cm</xsl:text>
73
<xsl:attribute name="y1">
74
<xsl:value-of select="$bottom_pos"/>
80
<xsl:template match="lines">
81
<blockTable repeatRows="1" style="result">
82
<xsl:attribute name="colWidths">
83
<xsl:value-of select="$width_col1"/>
84
<xsl:text>, </xsl:text>
85
<xsl:value-of select="$width_col2"/>
92
<xsl:apply-templates select="lot" mode="story"/>
97
<xsl:template match="lot" mode="story">
100
<xsl:value-of select="lot-number"/>
103
<xsl:if test="lot-price!=''">
104
<xsl:value-of select="round(lot-price)"/>