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 / error2html.xslt < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.3 KB  |  138 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. <!-- CVS $Id: error2html.xslt,v 1.17 2004/03/06 02:25:41 antonio Exp $ -->
  19.  
  20. <xsl:stylesheet version="1.0"
  21.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  22.                 xmlns:error="http://apache.org/cocoon/error/2.1">
  23.  
  24.   <xsl:param name="contextPath"/>
  25.  
  26.   <!-- let sitemap override default page title -->
  27.   <xsl:param name="pageTitle" select="//error:notify/error:title"/>
  28.  
  29.   <xsl:template match="error:notify">
  30.     <html>
  31.       <head>
  32.         <title>
  33.           <xsl:value-of select="$pageTitle"/>
  34.         </title>
  35.         <link href="{$contextPath}/styles/main.css" type="text/css" rel="stylesheet"/>
  36.         <style>
  37.           h1 { color: #336699; text-align: left; margin: 0px 0px 30px 0px; padding: 0px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #336699;}
  38.           p.message { padding: 10px 30px 10px 30px; font-weight: bold; font-size: 130%; border-width: 1px; border-style: dashed; border-color: #336699; }
  39.           p.description { padding: 10px 30px 20px 30px; border-width: 0px 0px 1px 0px; border-style: solid; border-color: #336699;}
  40.           p.topped { padding-top: 10px; border-width: 1px 0px 0px 0px; border-style: solid; border-color: #336699; }
  41.           pre { font-size: 120%; }
  42.         </style>
  43.         <script src="{$contextPath}/scripts/main.js" type="text/javascript"/>
  44.       </head>
  45.       <body>
  46.         <xsl:apply-templates select="." mode="onload"/>
  47.         <h1><xsl:value-of select="$pageTitle"/></h1>
  48.  
  49.         <p class="message">
  50.           <xsl:value-of select="error:message"/>
  51.         </p>
  52.  
  53.         <p class="description">
  54.           <xsl:value-of select="error:description"/>
  55.         </p>
  56.  
  57.         <xsl:apply-templates select="error:extra"/>
  58.  
  59.         <p class="topped">
  60.           If you need help and this information is not enough, you
  61.           are invited to read the
  62.           <a href="http://cocoon.apache.org/2.1/faq/">Cocoon FAQ</a>.<br/>
  63.           If you still don't find the answers you need,
  64.           can send a mail to the
  65.           <a href="http://cocoon.apache.org/community/mail-lists.html">
  66.           Cocoon mailing lists</a>,
  67.           remembering to:
  68.         </p>
  69.  
  70.         <ul>
  71.           <li>specify the version of Cocoon you're using, or we'll assume that you
  72.               are talking about the latest released version;</li>
  73.           <li>specify the platform-operating system-version-servlet container version;</li>
  74.           <li>send any pertinent error message;</li>
  75.           <li>send pertinent log snippets;</li>
  76.           <li>send pertinent sitemap snippets;</li>
  77.           <li>send pertinent parts of the page that give you problems.</li>
  78.         </ul>
  79.  
  80.         <p>
  81.           For more detailed technical information, take a look at the log
  82.           files in the log directory of Cocoon, which is placed by default in
  83.           the <code>WEB-INF/logs/</code> folder of your cocoon webapp context.<br/>
  84.           If the logs don't give you enough information, you might want to increase the
  85.           log level by changing the Logging configuration which is by default the
  86.           <code>WEB-INF/logkit.xconf</code> file.
  87.         </p>
  88.  
  89.         <p>
  90.           If you think you found a bug, please report it to
  91.           <a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>;
  92.           a message will automatically be sent to the developer mailing list and you'll
  93.           be kept in contact automatically with the further progress on that bug.
  94.         </p>
  95.  
  96.         <p>
  97.           Thanks, and sorry for the trouble if this is our fault.
  98.         </p>
  99.  
  100.         <p class="topped">
  101.           The <a href="http://cocoon.apache.org/">Apache Cocoon</a> Project
  102.         </p>
  103.       </body>
  104.     </html>
  105.   </xsl:template>
  106.  
  107.   <xsl:template match="error:notify" mode="onload">
  108.     <xsl:attribute name="onload">
  109.       <xsl:for-each select="error:extra[contains(@error:description,'stacktrace')]">
  110.         <xsl:text>toggle('</xsl:text>
  111.         <xsl:value-of select="@error:description"/>
  112.         <xsl:text>');</xsl:text>
  113.       </xsl:for-each>
  114.     </xsl:attribute>
  115.   </xsl:template>
  116.  
  117.   <xsl:template match="error:extra">
  118.     <xsl:choose>
  119.      <xsl:when test="contains(@error:description,'stacktrace')">
  120.       <p class="stacktrace">
  121.        <span class="description"><xsl:value-of select="@error:description"/></span>
  122.        <span class="switch" id="{@error:description}-switch" onclick="toggle('{@error:description}')">[hide]</span>
  123.        <pre id="{@error:description}">
  124.          <xsl:value-of select="translate(.,' ','')"/>
  125.        </pre>
  126.       </p>
  127.      </xsl:when>
  128.      <xsl:otherwise>
  129.       <p class="extra">
  130.        <span class="description"><xsl:value-of select="@error:description"/>: </span>
  131.        <xsl:value-of select="."/>
  132.       </p>
  133.      </xsl:otherwise>
  134.     </xsl:choose>
  135.   </xsl:template>
  136.  
  137. </xsl:stylesheet>
  138.