forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From je...@apache.org
Subject cvs commit: xml-forrest/src/resources/stylesheets page2html.xsl profile2page.xsl
Date Sat, 05 Jul 2003 13:03:52 GMT
jefft       2003/07/05 06:03:52

  Modified:    src/resources/conf profiler.xmap
               src/resources/stylesheets page2html.xsl profile2page.xsl
  Log:
  Update profiler stylesheets
  
  Revision  Changes    Path
  1.5       +1 -1      xml-forrest/src/resources/conf/profiler.xmap
  
  Index: profiler.xmap
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/conf/profiler.xmap,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- profiler.xmap	5 Jul 2003 13:01:02 -0000	1.4
  +++ profiler.xmap	5 Jul 2003 13:03:52 -0000	1.5
  @@ -36,7 +36,7 @@
           <map:transform src="resources/stylesheets/profile2page.xsl">
             <map:parameter name="use-request-parameters" value="true"/>
           </map:transform>
  -        <map:transform src="resources/stylesheets/complex-page2html.xsl">
  +        <map:transform src="resources/stylesheets/page2html.xsl">
             <map:parameter name="contextPath" value="{request:contextPath}"/>
           </map:transform>
   
  
  
  
  1.2       +107 -68   xml-forrest/src/resources/stylesheets/page2html.xsl
  
  Index: page2html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/page2html.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- page2html.xsl	15 Mar 2003 06:26:16 -0000	1.1
  +++ page2html.xsl	5 Jul 2003 13:03:52 -0000	1.2
  @@ -1,48 +1,54 @@
   <?xml version="1.0"?>
   
  -<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  +<!--+
  +    | Covert samples file to the HTML page. Uses styles/main.css stylesheet.
  +    |
  +    | Author: Nicola Ken Barozzi "nicolaken@apache.org"
  +    | Author: Vadim Gritsenko "vgritsenko@apache.org"
  +    | Author: Christian Haul "haul@apache.org"
  +    | CVS $Id$
  +    +-->
  +
  +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xlink="http://www.w3.org/1999/xlink">
  +
  +  <xsl:param name="contextPath" select="string('/cocoon')"/>
   
  - <xsl:output indent="yes"/>
  -  
    <xsl:template match="/">
     <html>
      <head>
  -    <title>Apache Cocoon 2.1-dev</title>
  -    <link rel="SHORTCUT ICON" href="favicon.ico"/>
  -
  -    <xsl:apply-templates select="page/style"/>
  -    <xsl:apply-templates select="page/script"/>
  +     <title>Apache Forrest</title>
  +     <link rel="SHORTCUT ICON" href="favicon.ico"/>
  +     <xsl:apply-templates select="document/header/style"/>
  +     <xsl:apply-templates select="document/header/script"/>
      </head>
  -   <body bgcolor="#ffffff" link="#0086b2" vlink="#00698c" alink="#743e75">
  +   <body>
       <table border="0" cellspacing="2" cellpadding="2" align="center" width="100%">
  -     <tr>
  -      <td width="*"><font face="arial,helvetica,sanserif" color="#000000">The
Apache Software Foundation is proud to
  -present...</font></td>
  -      <td width="40%" align="center"><img border="0" src="/cocoon/samples/images/cocoon.gif"/></td>
  -      <td width="30%" align="center"><font face="arial,helvetica,sanserif" color="#000000"><b>version
  -2.1-dev</b></font></td>
  -     </tr>
  -     <tr>
  -      <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center"
width="100%">
  -       <tr>
  -        <td width="90%" align="left" bgcolor="#0086b2"><font size="+1" face="arial,helvetica,sanserif"
  -            color="#ffffff"><xsl:value-of select="page/@title"/></font></td>
  -
  -        <xsl:apply-templates select="page/tab"/>
  -       </tr>
  -      </table>
  -     </tr>
  +      <tr>
  +        <td width="50%">
  +          <h2><xsl:value-of select="document/header/title"/></h2>
  +        </td>
  +        <td width="25%">
  +          <xsl:apply-templates select="document/header/tab"/>
  +        </td>
  +      </tr>
       </table>
   
  -    <table width="100%">   
  -     <xsl:apply-templates select="page/row"/>
  -    </table>
  -   
  -    <p align="center">
  -     <font size="-1">
  -      Copyright &#169; 1999-2002 <a href="http://www.apache.org/">The Apache
Software Foundation</a>.<br/>
  +    <p>
  +     <xsl:choose>
  +      <xsl:when test="document/body/row">
  +       <table width="100%">
  +        <xsl:apply-templates select="document/body/*"/>
  +       </table>
  +      </xsl:when>
  +      <xsl:otherwise>
  +       <xsl:apply-templates select="document/body/*"/>
  +      </xsl:otherwise>
  +     </xsl:choose>
  +    </p>
  +
  +    <p class="copyright">
  +      Copyright &#169; 1999-2003 <a href="http://www.apache.org/">The Apache
Software Foundation</a>.
         All rights reserved.
  -     </font>
       </p>
      </body>
     </html>
  @@ -51,57 +57,90 @@
    <xsl:template match="style">
     <link type="text/css" rel="stylesheet" href="{@href}"/>
    </xsl:template>
  -
  + 
    <xsl:template match="script">
     <script type="text/javascript" src="{@href}"/>
    </xsl:template>
  -
  + 
    <xsl:template match="tab">
  -  <td nowrap="nowrap" bgcolor="#ffffff"><a href="{@href}"><i><xsl:value-of
select="@title"/></i></a></td>
  +  <a href="{@href}"><i><xsl:value-of select="@title"/></i></a>&#160;
    </xsl:template>
  -
  + 
    <xsl:template match="row">
     <tr>
      <xsl:apply-templates select="column"/>
     </tr>
    </xsl:template>
  -
  + 
    <xsl:template match="column">
     <td valign="top">
  -   <table border="0" bgcolor="#000000" cellpadding="0" cellspacing="0" width="97%">
  -    <tbody>
  -     <tr>
  -      <td>
  -
  -       <table bgcolor="#000000" border="0" cellspacing="2" cellpadding="2" align="center"
width="100%">
  -        <tr>
  -         <td bgcolor="#0086b2" width="100%" align="left">
  -          <font size="+1" face="arial,helvetica,sanserif" color="#ffffff"><xsl:value-of
select="@title"/></font>
  -         </td>
  -        </tr>
  -        <tr>
  -         <td width="100%" bgcolor="#ffffff" align="left">
  -
  -          <xsl:apply-templates/>
  -
  -         </td>
  -        </tr>
  -       </table>
  -      
  -      </td>
  -     </tr> 
  -    </tbody>
  -   </table>
  +   <h4 class="samplesGroup"><xsl:value-of select="@title"/></h4>
  +   <p class="samplesText"><xsl:apply-templates/></p>
     </td> 
    </xsl:template>
   
  - <xsl:template match="para">
  -  <p align="left">
  -   <i><xsl:apply-templates/></i>
  + <xsl:template match="section">
  +  <xsl:choose> <!-- stupid test for the hirachy deep -->
  +   <xsl:when test="../../../section">
  +    <h5><xsl:value-of select="title"/></h5>
  +   </xsl:when>
  +   <xsl:when test="../../section">
  +    <h4><xsl:value-of select="title"/></h4>
  +   </xsl:when>
  +   <xsl:when test="../section">
  +    <h4 class="samplesGroup"><xsl:value-of select="title"/></h4>
  +   </xsl:when>
  +  </xsl:choose>
  +  <p>
  +   <xsl:apply-templates select="*[name()!='title']"/>
     </p>
    </xsl:template>
   
  - <xsl:template match="@*|node()" priority="-2"><xsl:copy><xsl:apply-templates
select="@*|node()"/></xsl:copy></xsl:template>
  - <xsl:template match="text()" priority="-1"><xsl:value-of select="."/></xsl:template>
  + <xsl:template match="source">
  +  <div style="background: #b9d3ee; border: thin; border-color: black; border-style:
solid; padding-left: 0.8em; 
  +              padding-right: 0.8em; padding-top: 0px; padding-bottom: 0px; margin: 0.5ex
0px; clear: both;">
  +  <pre>
  +   <xsl:value-of select="."/>
  +  </pre>
  +  </div>
  + </xsl:template>
  + 
  + <xsl:template match="link">
  +  <xsl:text> </xsl:text>
  +  <a href="{@href}">
  +   <xsl:apply-templates/>
  +  </a>
  +  <xsl:text> </xsl:text>
  + </xsl:template>
  + 
  + <xsl:template match="strong">
  +  <xsl:text> </xsl:text>
  +  <b>
  +   <xsl:apply-templates/>
  +  </b>
  +  <xsl:text> </xsl:text>
  + </xsl:template>
  + 
  + <xsl:template match="anchor">
  +  <a name="{@name}">
  +   <xsl:apply-templates/>
  +  </a>
  + </xsl:template>
  + 
  +<!-- <xsl:template match="table">
  +  <table border="1" cellspacing="3" cellpadding="3">
  +   <xsl:apply-templates/>
  +  </table>
  + </xsl:template> -->
  +
  +  <xsl:template match="para">
  +   <p>
  +     <xsl:apply-templates/>
  +   </p>
  +  </xsl:template>
  +
  + <xsl:template match="*|@*|node()|text()" priority="-1">
  +  <xsl:copy><xsl:apply-templates select="*|@*|node()|text()"/></xsl:copy>
  + </xsl:template>
   
   </xsl:stylesheet>
  
  
  
  1.2       +62 -53    xml-forrest/src/resources/stylesheets/profile2page.xsl
  
  Index: profile2page.xsl
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/stylesheets/profile2page.xsl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- profile2page.xsl	15 Mar 2003 06:26:16 -0000	1.1
  +++ profile2page.xsl	5 Jul 2003 13:03:52 -0000	1.2
  @@ -12,30 +12,31 @@
    <xsl:param name="component"/>
   
    <xsl:template match="/">
  -  <page>
  -   <tab title="Back" href="profile.html"/>
  -   <tab title="Overview" href="welcome"/>
  -   <style href="xml2html.css"/>
  -   <script href="xml2html.js"/>
  -
  -   <xsl:choose>
  -    <xsl:when test="$component!=''">
  -     <xsl:apply-templates
  -         select="profile:profilerinfo/profile:pipeline/profile:result/profile:component[@profile:index=$component]"
  -         mode="fragment"/>
  -    </xsl:when>
  -    <xsl:when test="$result!=''">
  -     <xsl:apply-templates select="profile:profilerinfo/profile:pipeline/profile:result"
mode="result"/>
  -    </xsl:when>
  -    <xsl:when test="$key!=''">
  -     <xsl:apply-templates select="profile:profilerinfo/profile:pipeline" mode="results"/>
  -    </xsl:when>
  -    <xsl:otherwise>
  -     <xsl:apply-templates select="profile:profilerinfo" mode="pipelines"/>
  -    </xsl:otherwise>
  -   </xsl:choose>
  - 
  -  </page>
  +  <document>
  +   <header>
  +   <title>Forrest Profiler</title>
  +    <tab title="Back" href="index.html"/>
  +   </header>
  +   <body>
  +    <xsl:choose>
  +     <xsl:when test="$component!=''">
  +      <xsl:apply-templates
  +          select="profile:profilerinfo/profile:pipeline/profile:result/profile:component[@index=$component]"
  +          mode="fragment"/>
  +     </xsl:when>
  +     <xsl:when test="$result!=''">
  +      <xsl:apply-templates select="profile:profilerinfo/profile:pipeline/profile:result"
mode="result"/>
  +     </xsl:when>
  +     <xsl:when test="$key!=''">
  +      <xsl:apply-templates select="profile:profilerinfo/profile:pipeline" mode="results"/>
  +     </xsl:when>
  +     <xsl:otherwise>
  +      <xsl:apply-templates select="profile:profilerinfo" mode="pipelines"/>
  +     </xsl:otherwise>
  +    </xsl:choose>
  +
  +   </body>
  +  </document>
    </xsl:template>
   
    <xsl:template match="profile:profilerinfo" mode="pipelines">
  @@ -56,19 +57,19 @@
   
          <tr bgcolor="#FFFFFF">
           <td>
  -         <a href="?key={@profile:key}">
  -          <font face="verdana"><strong><xsl:value-of select="@profile:uri"/></strong></font>
  +         <a href="?key={@key}">
  +          <font face="verdana"><strong><xsl:value-of select="@uri"/></strong></font>
            </a>
           </td>
           <td>
  -         <a href="?key={@profile:key}">
  -          <xsl:value-of select="profile:average/@profile:time"/> ms
  +         <a href="?key={@key}">
  +          <xsl:value-of select="profile:average/@time"/> ms
            </a>
           </td>
           <xsl:for-each select="profile:result">
            <td>
  -          <a href="?key={../@profile:key}&amp;result={@profile:index}">
  -           <xsl:value-of select="@profile:time"/> ms
  +          <a href="?key={../@key}&amp;result={@index}">
  +           <xsl:value-of select="@time"/> ms
             </a>
            </td>
           </xsl:for-each>
  @@ -87,7 +88,7 @@
    <xsl:template match="profile:pipeline" mode="results">
   
     <row>
  -   <column title="{@profile:uri}">
  +   <column title="{@uri}">
   
       <table width="100%" cellspacing="0" cellpadding="5" align="left">
        <font size="+0" face="arial,helvetica,sanserif" color="#000000">
  @@ -107,22 +108,22 @@
            <xsl:value-of select="$pos"/>
           </td>
           <td width="10%">
  -         <xsl:value-of select="@profile:role"/>
  -         <xsl:if test="@profile:source">
  -          (<xsl:value-of select="@profile:source"/>)
  +         <xsl:value-of select="@role"/>
  +         <xsl:if test="@source">
  +          (<xsl:value-of select="@source"/>)
            </xsl:if>
           </td>
   
           <xsl:for-each select="../../profile:average/profile:component[position()=$pos]">
            <td>
  -          <xsl:value-of select="@profile:time"/> ms
  +          <xsl:value-of select="@time"/> ms
            </td>
           </xsl:for-each>
    
           <xsl:for-each select="../../profile:result/profile:component[position()=$pos]">
            <td>
  -          <a href="?key={../../@profile:key}&amp;result={../@profile:index}&amp;component={@profile:index}">
  -           <xsl:value-of select="@profile:time"/> ms
  +          <a href="?key={../../@key}&amp;result={../@index}&amp;component={@index}">
  +           <xsl:value-of select="@time"/> ms
             </a>
            </td>
           </xsl:for-each>
  @@ -133,11 +134,11 @@
         <tr>
          <td></td>
          <td><b>Total time</b></td>
  -       <td><b><xsl:value-of select="profile:result/@profile:time"/> ms</b></td>
  +       <td><b><xsl:value-of select="profile:result/@time"/> ms</b></td>
          <xsl:for-each select="profile:result">
           <td>
            <b>
  -          <xsl:value-of select="@profile:time"/> ms
  +          <xsl:value-of select="@time"/> ms
            </b>
           </td>
          </xsl:for-each>
  @@ -154,28 +155,36 @@
    <xsl:template match="profile:result" mode="result">
   
     <row>
  -   <column title="{../@profile:uri}">
  +   <column title="{../@uri}">
   
       <table bgcolor="#ffffff" border="0" cellspacing="0" cellpadding="2"  width="100%"
align="center">
   
        <tr>
         <td align="left"><b>Components</b></td>
  -      <td align="left"><b>Time</b></td>
  +      <td align="left"><b>Total time</b></td>
  +      <td align="left"><b>Setup time</b></td>
  +      <td align="left"><b>Processing time</b></td>
        </tr>
   
   
        <xsl:for-each select="profile:component">
         <tr>
          <td>
  -        <a href="?key={../../@profile:key}&amp;result={../@profile:index}&amp;component={@profile:index}">
  -         <xsl:value-of select="@profile:role"/>
  -         <xsl:if test="@profile:source">
  -          (<xsl:value-of select="@profile:source"/>)
  +        <a href="?key={../../@key}&amp;result={../@index}&amp;component={@index}">
  +         <xsl:value-of select="@role"/>
  +         <xsl:if test="@source">
  +          (<xsl:value-of select="@source"/>)
            </xsl:if>
           </a>
          </td>
          <td>
  -        <xsl:value-of select="@profile:time"/> ms
  +        <xsl:value-of select="@time"/> ms
  +       </td>
  +       <td>
  +        <xsl:value-of select="@setup"/> ms
  +       </td>
  +       <td>
  +        <xsl:value-of select="@processing"/> ms
          </td>
         </tr>
        </xsl:for-each>
  @@ -200,8 +209,8 @@
   
         <xsl:for-each select="profile:environmentinfo/profile:request-parameters/profile:parameter">
          <tr>
  -        <td><xsl:value-of select="@profile:name"/></td>
  -        <td><xsl:value-of select="@profile:value"/></td>
  +        <td><xsl:value-of select="@name"/></td>
  +        <td><xsl:value-of select="@value"/></td>
          </tr>
         </xsl:for-each>
   
  @@ -231,8 +240,8 @@
     
         <xsl:for-each select="profile:environmentinfo/profile:session-attributes/profile:attribute">
          <tr>
  -        <td><xsl:value-of select="@profile:name"/></td>
  -        <td><xsl:value-of select="@profile:value"/></td>
  +        <td><xsl:value-of select="@name"/></td>
  +        <td><xsl:value-of select="@value"/></td>
          </tr>
         </xsl:for-each>
   
  @@ -254,9 +263,9 @@
     <row>
      <column>
       <xsl:attribute name="title">
  -     <xsl:value-of select="@profile:role"/>
  -     <xsl:if test="@profile:source">
  -      (<xsl:value-of select="@profile:source"/>)
  +     <xsl:value-of select="@role"/>
  +     <xsl:if test="@source">
  +      (<xsl:value-of select="@source"/>)
        </xsl:if>
       </xsl:attribute>
   
  
  
  

Mime
View raw message