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 / stupid.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  4.6 KB  |  154 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. <xsl:stylesheet
  19.   version="1.0"
  20.   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  21. >
  22.   <xsl:variable name="tablecolor">#d0f0d0</xsl:variable>
  23.   <xsl:variable name="mediumtablecolor">#e0ffe0</xsl:variable>
  24.   <xsl:variable name="lighttablecolor">#f0fff0</xsl:variable>
  25.  
  26.   <xsl:template match="sqltbl">
  27.     <xsl:element name="table"> 
  28.       <xsl:attribute name="border">1</xsl:attribute>
  29.       <xsl:attribute name="align">center</xsl:attribute>
  30.       <xsl:attribute name="bgcolor"><xsl:value-of select="$tablecolor"/></xsl:attribute>
  31.       <xsl:element name="tr"> 
  32.         <xsl:apply-templates select="child::*[1]" mode="head"/>
  33.       </xsl:element>
  34.       <xsl:for-each select="child::*">
  35.         <xsl:element name="tr"> 
  36.           <xsl:apply-templates select="."/>
  37.         </xsl:element>
  38.       </xsl:for-each>
  39.     </xsl:element>
  40.   </xsl:template>
  41.  
  42.   <xsl:template match="sqltblrow" mode="head">
  43.     <xsl:for-each select="./child::*">
  44.       <xsl:element name="th">
  45.         <xsl:value-of select="name()"/>
  46.       </xsl:element>
  47.     </xsl:for-each>
  48.   </xsl:template>
  49.  
  50.   <xsl:template match="sqltblrow">
  51.     <xsl:for-each select="./child::*">
  52.       <xsl:element name="td">
  53.         <xsl:attribute name="valign">top</xsl:attribute>
  54.         <xsl:apply-templates/>
  55.       </xsl:element>
  56.     </xsl:for-each>
  57.   </xsl:template>
  58.  
  59.   <xsl:template match="sql-set">
  60.      <xsl:element name="table">
  61.         <xsl:attribute name="border">1</xsl:attribute>
  62.         <xsl:attribute name="bgcolor"><xsl:value-of select="$mediumtablecolor"/></xsl:attribute>
  63.     <xsl:for-each select="./child::*">
  64.        <xsl:element name="tr">
  65.           <xsl:element name="td">
  66.              <xsl:apply-templates/>
  67.           </xsl:element>
  68.        </xsl:element>
  69.     </xsl:for-each>
  70.      </xsl:element>
  71.   </xsl:template>
  72.  
  73.   <xsl:template name="sql-set-item">
  74.      <xsl:value-of select="."/>
  75.      <xsl:apply-templates/>
  76.   </xsl:template>
  77.  
  78.  
  79.   <xsl:template match="sql-list">
  80.      <xsl:element name="table">
  81.         <xsl:attribute name="border">1</xsl:attribute>
  82.         <xsl:attribute name="bgcolor"><xsl:value-of select="$mediumtablecolor"/></xsl:attribute>
  83.     <xsl:variable name="i"><xsl:value-of select="position()"/></xsl:variable>
  84.     <xsl:for-each select="./child::*">
  85.        <xsl:element name="tr">
  86.           <xsl:element name="td">
  87.              <xsl:attribute name="bgcolor"><xsl:value-of select="$lighttablecolor"/></xsl:attribute>
  88.              <xsl:value-of select="@pos"/>.
  89.           </xsl:element>
  90.           <xsl:element name="td">
  91.              <xsl:apply-templates/>
  92.           </xsl:element>
  93.        </xsl:element>
  94.     </xsl:for-each>
  95.      </xsl:element>
  96.   </xsl:template>
  97.  
  98.   <xsl:template name="sql-list-item">
  99.      <xsl:value-of select="."/>
  100.      <xsl:apply-templates/>
  101.   </xsl:template>
  102.  
  103.  
  104.   <xsl:template match="sql-row">
  105.      <xsl:element name="table">
  106.         <xsl:attribute name="border">1</xsl:attribute>
  107.         <xsl:attribute name="bgcolor"><xsl:value-of select="$mediumtablecolor"/></xsl:attribute>
  108.     <xsl:element name="tr">
  109.        <xsl:for-each select="./child::*">
  110.           <xsl:element name="td">
  111.              <xsl:apply-templates/>
  112.           </xsl:element>
  113.        </xsl:for-each>
  114.     </xsl:element>
  115.      </xsl:element>
  116.   </xsl:template>
  117.  
  118.   <xsl:template name="sql-row-item">
  119.      <xsl:value-of select="."/>
  120.      <xsl:apply-templates/>
  121.   </xsl:template>
  122.  
  123.  
  124.   <xsl:template match="@*|node()" priority="-1">
  125.    <xsl:copy>
  126.     <xsl:apply-templates select="@*|node()"/>
  127.    </xsl:copy>
  128.   </xsl:template>
  129.  
  130.  
  131.   <xsl:template match="@*|node()" priority="-1" mode="head">
  132.    <xsl:copy>
  133.     <xsl:apply-templates select="@*|node()" mode="head"/>
  134.    </xsl:copy>
  135.   </xsl:template>
  136.  
  137.   <xsl:template match="error">
  138.      <xsl:element name="table">
  139.      <xsl:attribute name="align">center</xsl:attribute>
  140.      <xsl:attribute name="width">100%</xsl:attribute>
  141.      <xsl:attribute name="bgcolor">#ffe0e0</xsl:attribute>
  142.         <xsl:element name="tr">
  143.        <xsl:element name="td">
  144.        <xsl:attribute name="align">center</xsl:attribute>
  145.           <xsl:element name="big">       
  146.                  <xsl:apply-templates/>
  147.           </xsl:element>
  148.        </xsl:element>
  149.         </xsl:element>
  150.      </xsl:element>
  151.   </xsl:template>
  152.  
  153. </xsl:stylesheet>
  154.