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.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2004-07-12  |  5.5 KB  |  129 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.xsl,v 1.2 2004/03/06 02:25:33 antonio Exp $ -->
  19.  
  20. <xsl:stylesheet version="1.0"
  21.                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  22.                 xmlns:lex="http://chaperon.sourceforge.net/schema/lexer/2.0">
  23.  
  24.   <xsl:param name="contextPath"/>
  25.  
  26.   <!-- let sitemap override default page title -->
  27.   <xsl:param name="pageTitle" select="//parse-exception/message"/>
  28.  
  29.   <xsl:template match="parse-exception">
  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.           table { margin: 0px; border: 0px; padding: 0px; }
  43.           tr { margin: 0px; border: 0px; padding: 0px; }
  44.           td { margin: 0px; border: 0px; padding: 0px; }
  45.           span.lt { background-color: #e5ffe5; margin: 0px; border: 0px; padding: 0px; }
  46.           span.eq { background-color: #ff0000; margin: 0px; border: 0px; padding: 0px; }
  47.           span.gt { background-color: #ffe5e5; margin: 0px; border: 0px; padding: 0px; }
  48.         </style>
  49.       </head>
  50.       <body>
  51.         <h1>Error</h1>
  52.  
  53.         <p class="message">
  54.           <xsl:value-of select="message"/>
  55.         </p>
  56.  
  57.         <p class="topped"/>
  58.  
  59.         <p class="extra"><span class="description">column </span><xsl:value-of select="@column-number"/></p>
  60.         <p class="extra"><span class="description">line </span><xsl:value-of select="@line-number"/></p>
  61.         <xsl:if test="source">
  62.          <p class="extra"><span class="description">source </span><xsl:value-of select="source/@ref"/></p>
  63.         </xsl:if>
  64.  
  65.         <xsl:apply-templates select="source"/>
  66.  
  67.         <p class="topped">
  68.           For more detailed technical information, take a look at the log
  69.           files in the log directory of Cocoon, which is placed by default in
  70.           the <code>WEB-INF/logs/</code> folder of your cocoon webapp context.<br/>
  71.           If the logs don't give you enough information, you might want to increase the
  72.           log level by changing the Logging configuration which is by default the
  73.           <code>WEB-INF/logkit.xconf</code> file.
  74.         </p>
  75.  
  76.         <p>
  77.           If you think you found a bug, please report it to
  78.           <a href="http://nagoya.apache.org/bugzilla/">Apache's Bugzilla</a>;
  79.           a message will automatically be sent to the developer mailing list and you'll
  80.           be kept in contact automatically with the further progress on that bug.
  81.         </p>
  82.  
  83.         <p>
  84.           Thanks, and sorry for the trouble if this is our fault.
  85.         </p>
  86.  
  87.         <p class="topped">
  88.           The <a href="http://cocoon.apache.org/">Apache Cocoon</a> Project
  89.         </p>
  90.       </body>
  91.     </html>
  92.   </xsl:template>
  93.  
  94.   <xsl:template match="source">
  95.    <xsl:variable name="line-number" select="number(../@line-number)"/>
  96.  
  97.    <p class="topped">
  98.     <pre>
  99.      <xsl:apply-templates select="lex:output/lex:lexeme[(number(@line) < $line-number) and (number(@line) > number($line-number - 10))]" mode="lt"/>
  100.      <xsl:apply-templates select="lex:output/lex:lexeme[number(@line) = $line-number]" mode="eq"/>
  101.      <xsl:apply-templates select="lex:output/lex:lexeme[(number(@line) > $line-number) and (number(@line) < number($line-number + 10))]" mode="gt"/>
  102.     </pre>
  103.    </p>
  104.  
  105.   </xsl:template>
  106.  
  107.   <xsl:template match="lex:lexeme" mode="lt">
  108.    <xsl:value-of select="@line"/> : <span class="lt"><xsl:value-of select="@text"/></span>
  109.   </xsl:template>
  110.  
  111.   <xsl:template match="lex:lexeme" mode="eq">
  112.    <xsl:variable name="column-number" select="number(../../../@column-number)"/>
  113.    <xsl:value-of select="@line"/> : <span class="lt"><xsl:value-of select="substring(@text, 1, $column-number - 1)"/></span>
  114.    <span class="eq"><xsl:value-of select="substring(@text, $column-number, 1)"/></span>
  115.    <span class="gt"><xsl:value-of select="substring(@text, $column-number + 1, string-length(@text) - $column-number)"/></span>
  116.   </xsl:template>
  117.  
  118.   <xsl:template match="lex:lexeme" mode="gt">
  119.    <xsl:value-of select="@line"/> : <span class="gt"><xsl:value-of select="@text"/></span>
  120.   </xsl:template>
  121.  
  122.  <xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
  123.   <xsl:copy>
  124.    <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
  125.   </xsl:copy>
  126.  </xsl:template>
  127.  
  128. </xsl:stylesheet>
  129.