2006-12-07 13:41:40 +00:00
|
|
|
<?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">
|
2013-12-18 12:31:30 +00:00
|
|
|
<xsl:variable name="initial_bottom_pos">24.5</xsl:variable>
|
|
|
|
<xsl:variable name="initial_left_pos">0.5</xsl:variable>
|
|
|
|
<xsl:variable name="height_increment">3.5</xsl:variable>
|
|
|
|
<xsl:variable name="width_increment">7</xsl:variable>
|
|
|
|
<xsl:variable name="frame_height">3.7cm</xsl:variable>
|
|
|
|
<xsl:variable name="frame_width">7cm</xsl:variable>
|
|
|
|
<xsl:variable name="number_columns">3</xsl:variable>
|
|
|
|
<xsl:variable name="max_frames">24</xsl:variable>
|
2006-12-07 13:41:40 +00:00
|
|
|
|
|
|
|
<xsl:template match="/">
|
|
|
|
<xsl:apply-templates select="addresses"/>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="addresses">
|
|
|
|
<document>
|
2008-09-10 08:46:40 +00:00
|
|
|
<template leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm"
|
|
|
|
bottomMargin="2.0cm" title="Address list" author="Generated by OpenERP">
|
2006-12-07 13:41:40 +00:00
|
|
|
<pageTemplate id="all">
|
|
|
|
<pageGraphics/>
|
|
|
|
<xsl:apply-templates select="address" mode="frames"/>
|
|
|
|
</pageTemplate>
|
|
|
|
</template>
|
|
|
|
<stylesheet>
|
|
|
|
<paraStyle name="nospace" fontName="Courier" fontSize="12" spaceBefore="0" spaceAfter="0"/>
|
|
|
|
</stylesheet>
|
|
|
|
<story>
|
|
|
|
<xsl:apply-templates select="address" mode="story">
|
|
|
|
<xsl:sort select="contact/country"/>
|
|
|
|
<xsl:sort select="contact/zip"/>
|
|
|
|
<xsl:sort select="company-name"/>
|
|
|
|
</xsl:apply-templates>
|
|
|
|
</story>
|
|
|
|
</document>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="address" mode="frames">
|
|
|
|
<xsl:if test="position() < $max_frames + 1">
|
|
|
|
<frame>
|
|
|
|
<xsl:attribute name="width">
|
|
|
|
<xsl:value-of select="$frame_width"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="height">
|
|
|
|
<xsl:value-of select="$frame_height"/>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="x1">
|
|
|
|
<xsl:value-of select="$initial_left_pos + ((position()-1) mod $number_columns) * $width_increment"/>
|
|
|
|
<xsl:text>cm</xsl:text>
|
|
|
|
</xsl:attribute>
|
|
|
|
<xsl:attribute name="y1">
|
|
|
|
<xsl:value-of select="$initial_bottom_pos - floor((position()-1) div $number_columns) * $height_increment"/>
|
|
|
|
<xsl:text>cm</xsl:text>
|
|
|
|
</xsl:attribute>
|
|
|
|
</frame>
|
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="address" mode="story">
|
2007-03-22 08:30:58 +00:00
|
|
|
<para style="nospace"><xsl:value-of select="company-name"/><xsl:text> </xsl:text><xsl:value-of select="company-title"/></para>
|
2006-12-07 13:41:40 +00:00
|
|
|
<para style="nospace"><xsl:value-of select="street"/></para>
|
|
|
|
<para style="nospace"><xsl:value-of select="street2"/></para>
|
|
|
|
<para style="nospace"><xsl:value-of select="zip"/><xsl:text> </xsl:text><xsl:value-of select="city"/></para>
|
|
|
|
<para style="nospace"><xsl:value-of select="state"/></para>
|
|
|
|
<para style="nospace"><xsl:value-of select="country"/></para>
|
2012-02-23 09:12:17 +00:00
|
|
|
<xsl:if test="position() < last()">
|
2012-02-23 11:12:44 +00:00
|
|
|
<nextFrame/>
|
2012-02-23 09:12:17 +00:00
|
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
|
|
|
|
<xsl:template match="contact">
|
|
|
|
|
2006-12-07 13:41:40 +00:00
|
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|