root/trunk/projects/bos/payment-website/static/poi-description-ge.xsl

Revision 3118, 4.8 kB (checked in by hans, 8 months ago)

thomas' version of 24-apr

Line 
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                 version="1.0">
4   <xsl:output method="html"/>
5  
6   <xsl:template match="/">
7     <html xmlns="http://www.w3.org/1999/xhtml">
8       <head>       
9         <title>Sambodja POI template</title></head>
10       <body>
11         <xsl:apply-templates/>
12       </body>
13     </html>
14   </xsl:template>
15  
16   <!-- params passed in from outside -->
17   <xsl:param name="host" select="localhost"/>
18   <xsl:param name="lang" select="en"/>
19   <!-- other params -->
20   <xsl:param name="image_width" select="120"/>
21  
22   <xsl:template match="poi">
23     <xsl:param name="poi_xml_link" select="concat('http://', $host, '/poi-xml/', @id, '?lang=', $lang)"/>
24     <table width="500" style="background-color: rgb(186, 186, 186);"
25            border="0" cellpadding="5" cellspacing="0">
26       <tbody>
27         <tr>
28           <td colspan="3" style="width: 99px; text-align: left;">             
29             <img src="http://{$host}/images/header_ganzneu.gif" alt="Create Rainforest Banner / BOS Logo" width="400"/>
30           </td>
31         </tr>       
32         <tr>
33           <td style="width: 100px;">
34             <h1><xsl:value-of select="@title"/></h1>
35             <h2><xsl:value-of select="@subtitle"/></h2>
36             <table width="400">
37               <tr><td>
38                   <xsl:value-of select="description"/>
39               </td></tr>
40             </table>       
41             <xsl:choose>
42               <xsl:when test="@id='1983023'">
43                 <p><a href="http://{$host}/de/bestellung">Machen Sie mit!</a></p>
44               </xsl:when>
45               <xsl:otherwise>
46                 <br/><br/>
47               </xsl:otherwise>
48             </xsl:choose>
49             <table>
50               <tbody>
51                 <tr>
52                   <td><xsl:apply-templates select="descendant::image[1]">
53                       <xsl:with-param name="link" select="$poi_xml_link"/>
54                   </xsl:apply-templates></td>
55                   <td><xsl:apply-templates select="descendant::image[2]">
56                       <xsl:with-param name="link" select="$poi_xml_link"/>
57                   </xsl:apply-templates></td>
58                   <td><xsl:apply-templates select="descendant::image[3]">
59                       <xsl:with-param name="link" select="$poi_xml_link"/>
60                   </xsl:apply-templates></td>
61                 </tr>
62                 <tr>
63                   <td valign="top"><xsl:apply-templates select="descendant::image[1]" mode="title"/></td>
64                   <td valign="top"><xsl:apply-templates select="descendant::image[2]" mode="title"/></td>
65                   <td valign="top"><xsl:apply-templates select="descendant::image[3]" mode="title"/></td>
66                 </tr>
67                 <tr>
68                   <td><xsl:apply-templates select="descendant::image[4]">
69                       <xsl:with-param name="link" select="$poi_xml_link"/>
70                   </xsl:apply-templates></td>
71                   <td><xsl:apply-templates select="descendant::image[5]">
72                       <xsl:with-param name="link" select="$poi_xml_link"/>
73                   </xsl:apply-templates></td>
74                   <td><xsl:apply-templates select="descendant::image[6]">
75                       <xsl:with-param name="link" select="$poi_xml_link"/>
76                   </xsl:apply-templates></td>
77                 </tr>
78                 <tr>
79                   <td valign="top"><xsl:apply-templates select="descendant::image[4]" mode="title"/></td>
80                   <td valign="top"><xsl:apply-templates select="descendant::image[5]" mode="title"/></td>
81                   <td valign="top"><xsl:apply-templates select="descendant::image[6]" mode="title"/></td>
82                 </tr>
83               </tbody>
84             </table>
85           </td>
86         </tr>
87         <tr><td align="center" colspan="3"><a href="{$poi_xml_link}">learn more</a></td></tr>
88         <tr>
89           <td style="width: 99px;" colspan="3" align="center" valign="middle">
90             <font color="#999999">
91               <a href="http://{$host}/en/index">create rainforest</a> | copyright
92             </font>
93           </td>
94         </tr>
95       </tbody>
96       </table>
97       <p/> 
98   </xsl:template>
99  
100   <xsl:template match="image">
101     <xsl:param name="id" select="@id"/>
102     <xsl:param name="aspect_ratio" select="width div height"/>
103     <!-- <xsl:message>val:<xsl:value-of select="$aspect_ratio"/></xsl:message> -->
104     <xsl:param name="w" select="$image_width"/>
105     <xsl:param name="h" select="$aspect_ratio * $w"/>
106     <a href="{$link}"><img src="http://{$host}/image/{$id}/thumbnail,,{$w},{$h}" width="{$w}" height="{$h}"/></a>
107   </xsl:template>
108
109   <xsl:template match="image" mode="title">
110     <span style="font-size: small;"><xsl:value-of select="@title"/></span>
111   </xsl:template>
112
113 </xsl:stylesheet>
114
Note: See TracBrowser for help on using the browser.