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">2</xsl:variable>
6
<xsl:variable name="initial_left_pos">1.2</xsl:variable>
7
<xsl:variable name="width_increment">9.5</xsl:variable>
8
<xsl:variable name="frame_width">9.0cm</xsl:variable>
10
<xsl:variable name="width_col1">1.2cm</xsl:variable>
11
<xsl:variable name="width_col2">1.8cm</xsl:variable>
12
<xsl:variable name="width_col3">6cm</xsl:variable>
14
<xsl:variable name="bottom_pos">2.4cm</xsl:variable>
15
<xsl:variable name="frame_height">26cm</xsl:variable>
17
<xsl:template match="/">
18
<xsl:apply-templates select="results"/>
21
<xsl:template match="results">
22
<document filename="example_5.pdf">
23
<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">
24
<pageTemplate id="main">
26
<fill color="(0.4,0.4,0.4)"/>
27
<stroke color="(0.4,0.4,0.4)"/>
28
<setFont name="Helvetica" size="8"/>
29
<drawString x="1.8cm" y="1.4cm"><xsl:value-of select="auction/name"/></drawString>
30
<drawRightString x="19.2cm" y="1.4cm"><xsl:value-of select="auction/date-au1"/></drawRightString>
31
<lineMode width="0.2mm"/>
32
<lines>1.8cm 1.8cm 19.2cm 1.8cm</lines>
34
<xsl:apply-templates select="lines/lot" mode="frames"/>
39
<paraStyle name="name" fontName="Helvetica-Bold" fontSize="16" alignment="center"/>
40
<blockTableStyle id="result">
41
<blockValign value="TOP"/>
42
<blockAlignment value="CENTER" start="0,0" stop="-1,0"/>
43
<blockAlignment value="RIGHT" start="0,1" stop="-1,-1"/>
44
<blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="-1,0"/>
45
<blockBackground colorName="grey" start="0,0" stop="-1,0"/>
46
<blockTextColor colorName="white" start="0,0" stop="-1,0"/>
47
<lineStyle kind="LINEBELOW" colorName="red" start="0,0" stop="-1,0"/>
48
<lineStyle kind="LINEBEFORE" colorName="grey" start="-2,0" stop="-2,-1"/>
49
<lineStyle kind="LINEBEFORE" colorName="grey" start="-1,0" stop="-1,-1"/>
50
<lineStyle kind="LINEBEFORE" colorName="black" start="0,1" stop="0,-1"/>
51
<lineStyle kind="LINEAFTER" colorName="black" start="-1,1" stop="-1,-1"/>
56
<xsl:apply-templates select="lines"/>
62
<xsl:template match="lines/lot" mode="frames">
63
<xsl:if test="position() < $number_columns + 1">
65
<xsl:attribute name="width">
66
<xsl:value-of select="$frame_width"/>
68
<xsl:attribute name="height">
69
<xsl:value-of select="$frame_height"/>
71
<xsl:attribute name="x1">
72
<xsl:value-of select="$initial_left_pos + (position()-1) * $width_increment"/>
73
<xsl:text>cm</xsl:text>
75
<xsl:attribute name="y1">
76
<xsl:value-of select="$bottom_pos"/>
82
<xsl:template match="lines">
83
<blockTable repeatRows="1" style="result">
84
<xsl:attribute name="colWidths">
85
<xsl:value-of select="$width_col1"/>
86
<xsl:text>, </xsl:text>
87
<xsl:value-of select="$width_col2"/>
88
<xsl:text>, </xsl:text>
89
<xsl:value-of select="$width_col3"/>
97
<xsl:apply-templates select="lot" mode="story"/>
102
<xsl:template match="lot" mode="story">
105
<xsl:value-of select="lot-number"/>
108
<xsl:if test="lot-price!=''">
109
<xsl:value-of select="round(lot-price)"/>
113
<para><xsl:value-of select="lot-buyer"/></para>