Changeset 2798

Show
Ignore:
Timestamp:
03/25/08 14:53:53 (8 months ago)
Author:
ksprotte
Message:

working on kml.xsl

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/projects/bos/tmp/kml.xsl

    r2776 r2798  
    11<?xml version="1.0" encoding="utf-8"?> 
    22<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    3   xmlns:kml="http://earth.google.com/kml/2.1" 
    4   xmlns:bos="http://headcraft.de/bos" 
    5   version="1.0"> 
     3                xmlns:kml="http://earth.google.com/kml/2.1" 
     4                xmlns:bos="http://headcraft.de/bos" 
     5                version="1.0"> 
    66  <xsl:output method="html"/> 
     7   
    78  <xsl:template match="/"> 
    89    <html xmlns="http://www.w3.org/1999/xhtml"> 
     
    1617    </html> 
    1718  </xsl:template> 
    18  
     19   
     20  <!-- language setting --> 
     21  <xsl:param name="lang" select="'de'"/> 
     22  <!-- server --> 
     23  <xsl:param name="server" select="'http://test.createrainforest.org'"/> 
     24  <!-- image_width --> 
     25  <xsl:param name="image_width" select="60"/> 
     26   
    1927  <xsl:template match="kml:Placemark">   
    20     <!-- images here <img/><img/><img/> -->         
    2128    <table style="background-color: rgb(186, 186, 186); width: 319px; height: 350px;" border="0" cellpadding="5" cellspacing="0"> 
    2229      <tbody> 
    2330        <tr> 
    24           <td colspan="3" style="width: 99px; text-align: left;"> 
    25                 Create Rainforest Banner / BOS Logo 
     31          <td colspan="3" style="width: 99px; text-align: left;">              
     32            <img src="{$server}/images/header_ganzneu.gif" alt="Create Rainforest Banner / BOS Logo" width="400"/> 
    2633          </td> 
    27         </tr> 
     34        </tr>         
    2835        <tr> 
    2936          <td style="width: 100px;"> 
    30             <a href="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"> 
    31               <img style="border: 0px solid ;" alt="Galerie" src="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"/> 
     37            <a href="{$server}/infosystem/en/satellitenkarte.htm#"> 
     38              <img style="border: 0px solid ;" alt="Galerie" src="{$server}/infosystem/en/satellitenkarte.htm#"/> 
    3239              <br/> Galerie Slidwshow</a></td><td style="width: 33%;"> 
    33             <a href="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"> 
    34               <img style="border: 0px solid ;" alt="Panorama-klein" src="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"/> 
    35               <br/>Panorama-Mini</a></td><td style="width: 33%;"> <a href="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"> 
    36               <img style="border: 0px solid ;" alt="Video" src="http://createrainforest.org/infosystem/en/satellitenkarte.htm#"/> 
     40            <a href="{$server}/infosystem/en/satellitenkarte.htm#"> 
     41              <img style="border: 0px solid ;" alt="Panorama-klein" src="{$server}/infosystem/en/satellitenkarte.htm#"/> 
     42              <br/>Panorama-Mini</a></td><td style="width: 33%;"> <a href="{$server}/infosystem/en/satellitenkarte.htm#"> 
     43              <img style="border: 0px solid ;" alt="Video" src="{$server}/infosystem/en/satellitenkarte.htm#"/> 
    3744              <br/>Video</a></td></tr><tr><td style="width: 33%;" colspan="3"> 
    38             <h1><xsl:value-of select="kml:name"/></h1> 
    39             <div style="text-align: justify;"> 
    40               <xsl:value-of select="descendant::bos:description/bos:content[@lang='en']"/> 
    41               <a href="http://createrainforest.org/en/index">learn more</a></div> 
    42           </td></tr><tr><td style="width: 99px;" colspan="3" align="center" valign="middle"> 
    43             <font color="#999999"><a href="http://createrainforest.org/en/index">create rainforest</a> 
    44                   | copyright</font> 
    45           </td></tr></tbody></table> 
     45            <h1><xsl:value-of select="descendant::bos:title/bos:content[@lang=$lang]"/></h1> 
     46            <h2><xsl:value-of select="descendant::bos:subtitle/bos:content[@lang=$lang]"/></h2> 
     47            <div style="text-align: left;"> 
     48              <xsl:value-of select="descendant::bos:description/bos:content[@lang=$lang]"/> 
     49              <a href="{$server}/en/index">learn more</a></div> 
     50            <xsl:apply-templates select="descendant::bos:image"/> 
     51        </td></tr><tr><td style="width: 99px;" colspan="3" align="center" valign="middle"> 
     52            <font color="#999999"><a href="{$server}/en/index">create rainforest</a> 
     53              | copyright</font> 
     54    </td></tr></tbody></table> 
    4655    <p/>     
    4756  </xsl:template> 
    48  
     57   
     58  <xsl:template match="bos:image"> 
     59    <xsl:param name="id" select="bos:id"/> 
     60    <xsl:param name="aspect_ratio" select="bos:width div bos:height"/> 
     61    <!-- <xsl:message>val:<xsl:value-of select="$aspect_ratio"/></xsl:message> --> 
     62    <xsl:param name="w" select="$image_width"/> 
     63    <xsl:param name="h" select="$aspect_ratio * $w"/> 
     64    <img src="{$server}/image/{$id}" width="{$w}" height="{$h}"/> 
     65    &#160; 
     66  </xsl:template> 
    4967</xsl:stylesheet> 
    5068