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">1</xsl:variable>
5 <xsl:variable name="height_increment">3.8</xsl:variable>
6 <xsl:variable name="width_increment">7</xsl:variable>
7 <xsl:variable name="frame_height">3.5cm</xsl:variable>
8 <xsl:variable name="frame_width">6.5cm</xsl:variable>
9 <xsl:variable name="number_columns">3</xsl:variable>
10 <xsl:variable name="max_frames">21</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 Open 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"/>
28 <xsl:apply-templates select="lot-line" mode="story"/>
33 <xsl:template match="lot-line" mode="frames">
34 <xsl:if test="position() < $max_frames + 1">
36 <xsl:attribute name="width">
37 <xsl:value-of select="$frame_width"/>
39 <xsl:attribute name="height">
40 <xsl:value-of select="$frame_height"/>
42 <xsl:attribute name="x1">
43 <xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
44 <xsl:text>cm</xsl:text>
46 <xsl:attribute name="y1">
47 <xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
48 <xsl:text>cm</xsl:text>
54 <xsl:template match="lot-line" mode="story">
55 <para style="nospace"><xsl:value-of select="code"/><xsl:text>, </xsl:text><xsl:value-of select="quantity"/><xsl:text> </xsl:text><xsl:value-of select="uom"/></para>
56 <para style="nospace"><xsl:value-of select="product"/><xsl:text> </xsl:text><xsl:value-of select="variant"/></para>
57 <para style="nospace">Serial: <xsl:value-of select="serial"/></para>
58 <para style="nospace">Tracking: <xsl:value-of select="serial"/></para>
59 <spacer length="0.3cm"/>
60 <barCode><xsl:value-of select="tracking"/></barCode>