home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-cocoon-addon-1.4.9-installer.exe / sunletconf.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  2.8 KB  |  98 lines

  1. <?xml version="1.0"?>
  2. <!--
  3.   Copyright 1999-2004 The Apache Software Foundation
  4.  
  5.   Licensed under the Apache License, Version 2.0 (the "License");
  6.   you may not use this file except in compliance with the License.
  7.   You may obtain a copy of the License at
  8.  
  9.       http://www.apache.org/licenses/LICENSE-2.0
  10.  
  11.   Unless required by applicable law or agreed to in writing, software
  12.   distributed under the License is distributed on an "AS IS" BASIS,
  13.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.   See the License for the specific language governing permissions and
  15.   limitations under the License.
  16. -->
  17.  
  18. <!-- $Id: sunletconf.xsl,v 1.3 2004/03/06 02:25:39 antonio Exp $ 
  19.  
  20.  Description: The configuration page of a coplet
  21.  
  22. -->
  23.  
  24. <xsl:stylesheet version="1.0" 
  25.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  26.  
  27. <xsl:template match="page">
  28.     <xsl:apply-templates/>
  29. </xsl:template>
  30.  
  31. <xsl:template match="picture">
  32.     <img>
  33.         <xsl:attribute name="src"><xsl:value-of select="normalize-space(url)"/></xsl:attribute>
  34.     </img>
  35. </xsl:template>
  36.  
  37.  
  38. <xsl:template match="form">
  39.     <form>
  40.         <xsl:attribute name="method"><xsl:value-of select="@method"/></xsl:attribute>
  41.         <xsl:attribute name="action"><xsl:value-of select="@action"/></xsl:attribute>
  42.         <table><tbody>
  43.             <xsl:apply-templates select="inputxml"/>
  44.             <tr><td colspan="2" align="middle">
  45.             <xsl:apply-templates select="input"/>
  46.             </td></tr>
  47.         </tbody></table>
  48.     </form>
  49. </xsl:template>
  50.  
  51. <xsl:template match="inputxml">
  52.     <tr>
  53.         <td><xsl:value-of select="@name"/>: </td>
  54.         <td>
  55.             <xsl:choose>
  56.                 <xsl:when test="@name='Newsfeed'">
  57.                     <select name="Newsfeed">
  58.                         <option value="usa">
  59.                             <xsl:if test="normalize-space(.) = 'usa'">
  60.                                 <xsl:attribute name="selected">true</xsl:attribute>
  61.                             </xsl:if>
  62.                             USA
  63.                         </option>
  64.                         <option value="entertainmentgeneral">
  65.                             <xsl:if test="normalize-space(.) = 'entertainmentgeneral'">
  66.                                 <xsl:attribute name="selected">true</xsl:attribute>
  67.                             </xsl:if>
  68.                             Entertainment
  69.                         </option>
  70.                         <option value="foodanddrink">
  71.                             <xsl:if test="normalize-space(.) = 'foodanddrink'">
  72.                                 <xsl:attribute name="selected">true</xsl:attribute>
  73.                             </xsl:if>
  74.                             Food & Drink
  75.                         </option>
  76.                     </select>
  77.                 </xsl:when>
  78.                 <xsl:otherwise>
  79.                     <input>
  80.                         <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
  81.                         <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
  82.                         <xsl:attribute name="type"><xsl:value-of select="@type"/></xsl:attribute>
  83.                     </input>
  84.                 </xsl:otherwise>
  85.             </xsl:choose>
  86.         </td>
  87.     </tr>
  88. </xsl:template>
  89.  
  90. <!-- Copy all and apply templates -->
  91. <xsl:template match="@*|node()">
  92.     <xsl:copy>
  93.         <xsl:apply-templates select="@*|node()" />
  94.     </xsl:copy>
  95. </xsl:template>
  96.  
  97. </xsl:stylesheet>
  98.