cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@locus.apache.org
Subject cvs commit: xml-cocoon/samples/xsp clean-page.xml page-html.xsl page-xsp.xsl
Date Wed, 16 Feb 2000 01:09:30 GMT
stefano     00/02/15 17:09:30

  Modified:    samples/xsp clean-page.xml page-html.xsl page-xsp.xsl
  Log:
  ...
  
  Revision  Changes    Path
  1.2       +15 -15    xml-cocoon/samples/xsp/clean-page.xml
  
  Index: clean-page.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/xsp/clean-page.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- clean-page.xml	2000/01/03 01:37:23	1.1
  +++ clean-page.xml	2000/02/16 01:09:30	1.2
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   
   <!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
  -<!-- Version: $Id: clean-page.xml,v 1.1 2000/01/03 01:37:23 stefano Exp $ -->
  +<!-- Version: $Id: clean-page.xml,v 1.2 2000/02/16 01:09:30 stefano Exp $ -->
   
   <?cocoon-process type="xslt"?>
   <?xml-stylesheet href="page-xsp.xsl" type="text/xsl"?>
  @@ -12,20 +12,20 @@
     <name>Stefano Mazzocchi</name>
     <address>stefano@apache.org</address>
    </author>
  - 
  +
    <p>Hi, I'm your first XSP page ever.</p>
  - 
  +
    <p>I've been requested <count/> times.</p>
  - 
  +
    <p>The content you are seeing in this page is provided to you
    by an XML content producer that was compiled into Java bytecode
    and executed at request time. This allows greater flexibility and
    ease of use for page programmers without any performance degradation
    since all XML parsing and such is precompiled and it's avoided at
    request time.</p>
  - 
  +
    <p>Let's show some useful information with expression evaluation...</p>
  - 
  +
    <request-data>
     <string name="Request method" method="Method"/>
     <string name="Request URI" method="RequestURI"/>
  @@ -43,26 +43,26 @@
     <string name="Remote host" method="RemoteHost"/>
     <string name="Authorization scheme" method="AuthType"/>
    </request-data>
  - 
  +
    <p>Ok. Now that you know how logic can be transformed into content, let's
    add some juice and mix logic with content generation
    in a way that allows you to forget about what method is used to generate and
  - handle the content as XML and concentrate on having your work done. 
  + handle the content as XML and concentrate on having your work done.
    Note, how XSP don't allow you to explicitly write something on the response
    from the logic realm: this is one of the major
    differences between XSP and other server pages technologies and allows
    further processing of the produced content, as required, for example, by
    XSL-transformations.</p>
  - 
  +
    <request-headers/>
  - 
  +
    <servlet-parameters/>
  - 
  - <p>All right, the first XSP page is over, but you can see the 
  +
  + <p>All right, the first XSP page is over, but you can see the
    dynamically syntax highlighted
  - <link href="view-source.xml?filename=clean-page.xml">source of this page</link>

  - and its <link href="view-source.xml?filename=page-xsp.xsl">logicsheet</link>

  + <link href="view-source.xml?filename=clean-page.xml">source of this page</link>
  + and its <link href="view-source.xml?filename=page-xsp.xsl">logicsheet</link>
    provided to you by another XSP page.</p>
  - 
  +
    <p>Enjoy XSP!</p>
   </page>
  
  
  
  1.4       +6 -6      xml-cocoon/samples/xsp/page-html.xsl
  
  Index: page-html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/xsp/page-html.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- page-html.xsl	2000/02/13 18:29:16	1.3
  +++ page-html.xsl	2000/02/16 01:09:30	1.4
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  - 
  +
     <xsl:template match="page">
      <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
      <html>
  @@ -30,16 +30,16 @@
         </tr>
        </table>
       </center>
  -    
  +
       <p align="center">
        <font size="-1">
         Copyright &#169; @year@ <a href="http://xml.apache.org">The Apache XML
Project</a>.<br/>
         All rights reserved.
        </font>
       </p>
  -       
  +
       </body>
  -   </html>  
  +   </html>
     </xsl:template>
   
     <xsl:template match="title|author">
  @@ -67,7 +67,7 @@
         <td width="100%">
          <table border="0" width="100%" cellpadding="4">
           <tr>
  -         <th bgcolor="#e0e0e0" colspan="2" align="right"><xsl:value-of select="@title"/></th>
            
  +         <th bgcolor="#e0e0e0" colspan="2" align="right"><xsl:value-of select="@title"/></th>
           </tr>
           <xsl:apply-templates/>
          </table>
  @@ -116,5 +116,5 @@
       </td>
      </tr>
     </xsl:template>
  - 
  +
   </xsl:stylesheet>
  
  
  
  1.4       +20 -20    xml-cocoon/samples/xsp/page-xsp.xsl
  
  Index: page-xsp.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/xsp/page-xsp.xsl,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- page-xsp.xsl	2000/01/08 07:19:39	1.3
  +++ page-xsp.xsl	2000/02/16 01:09:30	1.4
  @@ -3,31 +3,31 @@
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
     <xsl:template match="page">
  -  
  +
       <xsl:processing-instruction name="cocoon-process">type="xsp"</xsl:processing-instruction>
   
       <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
       <xsl:processing-instruction name="xml-stylesheet">href="page-html.xsl" type="text/xsl"</xsl:processing-instruction>
   
       <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
  - 
  +
       <xsp:logic>
  -      static private int counter = 0; 
  -      
  -      private synchronized int count() { 
  -        return counter++; 
  +      static private int counter = 0;
  +
  +      private synchronized int count() {
  +        return counter++;
         }
  -      
  +
         private String normalize(String string) {
           if (string == null) return "";
           else return string;
         }
  -    </xsp:logic>  
  -  
  +    </xsp:logic>
  +
       <xsl:copy>
        <xsl:apply-templates/>
       </xsl:copy>
  -   
  +
      </xsp:page>
   
     </xsl:template>
  @@ -35,7 +35,7 @@
     <xsl:template match="title|author|link">
      <xsl:copy-of select="."/>
     </xsl:template>
  -  
  +
     <xsl:template match="p">
      <xsl:copy>
       <xsl:apply-templates/>
  @@ -66,12 +66,12 @@
   
     <xsl:template match="request-headers">
          <xsp:logic><![CDATA[
  -         Enumeration e = request.getHeaderNames(); 
  +         Enumeration e = request.getHeaderNames();
            if ((e != null) && (e.hasMoreElements())) { ]]>
               <p>Here are the request headers...</p>
               <list title="Request Headers">
                   <xsp:logic><![CDATA[
  -                  while (e.hasMoreElements()) {  
  +                  while (e.hasMoreElements()) {
                       String k = (String) e.nextElement(); ]]>
                       <element>
                           <xsp:attribute name="name">
  @@ -85,18 +85,18 @@
             }
           </xsp:logic>
     </xsl:template>
  - 
  +
     <xsl:template match="servlet-parameters">
      <xsp:logic><![CDATA[
  -          e = request.getParameterNames(); 
  +          e = request.getParameterNames();
             if ((e != null) && (e.hasMoreElements())) { ]]>
               <p>and here the servlet parameters that were passed along
               with the request...</p>
               <list title="Servlet Parameters">
                   <xsp:logic><![CDATA[
  -                  while (e.hasMoreElements()) { 
  +                  while (e.hasMoreElements()) {
                       String k = (String) e.nextElement();
  -                    String val = request.getParameter(k); 
  +                    String val = request.getParameter(k);
                       String vals[] = request.getParameterValues(k); ]]>
                       <element>
                           <xsp:attribute name="name">
  @@ -113,8 +113,8 @@
                     }
                   </xsp:logic>
               </list>
  -          } 
  -        </xsp:logic>      
  +          }
  +        </xsp:logic>
     </xsl:template>
  - 
  +
   </xsl:stylesheet>
  
  
  

Mime
View raw message