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/wap example-portfolio.xml portfolio-html.xsl portfolio-wml.xsl
Date Fri, 03 Dec 1999 23:49:16 GMT
stefano     99/12/03 15:49:16

  Modified:    samples/dcp sample-page-html.xsl
               samples/sites/java.apache.org fancy-page-html.xsl
               samples/wap example-portfolio.xml portfolio-html.xsl
                        portfolio-wml.xsl
  Added:       samples  index.xml index.xsl
  Log:
  added an XML-ized version of the Cocoon live show
  
  Revision  Changes    Path
  1.1                  xml-cocoon/samples/index.xml
  
  Index: index.xml
  ===================================================================
  <?xml version="1.0"?>
  <?xml-stylesheet href="index.xsl" type="text/xsl"?>
  <?cocoon-process type="xslt"?>
  
  <samples>
   <group name="General Examples">
    <sample name="Hello World" url="hello/hello-page.xml">
     This is a very simple demostration of how to use Cocoon. A simple XML page
     is transformed into an HTML page.
    </sample>
   </group>
   
   <group name="XML-ized web sites">
    <sample name="java.apache.org" url="sites/java.apache.org/news-page.xml">
     This page shows a much more complex example that shows how powerful 
     is the style separation and how powerful XML+XSL can be even for
     static web publishing.
    </sample>
    <sample name="jakarta.apache.org" url="sites/jakarta.apache.org/index-page.xml">
     This pages shows the same thing for the Apache Jakarta web site.
    </sample>
   </group>
  
   <group name="Dynamic content Generation">
    <sample name="DCP using Java" url="dcp/java/sample-page.xml">
     This page shows how you can use Cocoon to generate dynamic content using
     XML processing instructions to trigger Java logic execution.
    </sample>
  
    <sample name="DCP using ECMAScript" url="dcp/ecmascript/sample-page.xml">
     This page shows how you can use Cocoon to generate dynamic content using
     XML processing instructions to trigger ECMAScript logic execution.
    </sample>
   </group>
   
   <group name="Formatting Object Rendering">
    <sample name="Simple FO Example" url="fo/test-fo.xml">
     This page shows some potentials of the XSL Formatting Object specifications
     tranformed into PDF (we suggest you to install Adobe Acrobat Reader as your
     browser plugin for smoother integration)
    </sample>
    
    <sample name="Nover FO formatting" url="fo/darkness-novel.xml">
     In this example, part of Joseph Conrad's "The Heart of Darkness" novel
     is taken from its orginal style-free XML format and rendered into PDF
     using an XML->FO stylesheet.
    </sample>
   </group>
   
   <group name="New media for your web site">
    <sample name="Web and WAP" url="wap/example-portfolio.xml">
     In this example, we show how Cocoon is able to understand which browser
     is requesting the page and applies a different stylesheet to the same
     XML page to render on the different clients. This page is formatted in 
     WML (Wireless Markup Language) if the Nokia Wap Toolkit 1.2 browser (which 
     you could get for free from <a href="http://www.nokia.com">Nokia</a>)
     requests this page. Look into the example source to change this for your
     favorite WAP browser/cell-phone/PDA.
    </sample>
  
    <sample name="VoiceML" url="vml/hello-page.xml">
     This page has the same exact source file as the hello world example, but
     the stylesheet formats it using the VoiceML language. You page has been tested
     with the Motorola VoiceML SDK which you get for free from 
     <a href="http://www.motorola.com">Motorola</a>, but should work with any
     other VoiceML browser.
    </sample>
   </group>
  </samples>
  
  
  1.1                  xml-cocoon/samples/index.xsl
  
  Index: index.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
  <xsl:template match="samples">
  <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
  <html>
   <head>
    <title>Cocoon Live Show</title>
   </head>
   <body>
   
   <p><br /></p>
   
   <center>
    <table border="0" width="60%" bgcolor="#000000" cellspacing="0" cellpadding="0">
     <tr>
      <td width="100%">
       <table border="0" width="100%" cellpadding="4">
        <tr>
         <td width="100%" bgcolor="#c0c0c0" align="right">
          <big><big>Cocoon Live Show</big></big>
         </td>
        </tr>
        <tr>
         <td width="100%" bgcolor="#ffffff" align="center">
          <xsl:apply-templates/>
          <p><br/></p>
         </td>
        </tr>
       </table>
      </td>
     </tr>
    </table>
   </center>
   
   <p align="center">
    <font size="-1">
     Copyright &#169; 1999 <a href="http://xml.apache.org">The Apache XML Project</a>.<br/>
     All rights reserved.
    </font>
   </p>
   </body>
  </html>
  </xsl:template>
  
   <xsl:template match="group">
    <p><br/></p>
    <table border="0" width="90%" bgcolor="#000000" cellspacing="0" cellpadding="0">
     <tr>
      <td width="100%">
       <table border="0" width="100%" cellpadding="4">
        <tr>
         <td width="100%" bgcolor="#e0e0e0">
          <big><xsl:value-of select="@name"/></big>
         </td>
        </tr>
        <xsl:apply-templates/>
       </table>
      </td>
     </tr>
    </table>
   </xsl:template>
  
  <xsl:template match="sample">
   <tr>
    <td width="100%" bgcolor="#ffffff">
     <a href="{@url}"><xsl:value-of select="@name"/></a><xsl:text>
- </xsl:text>
     <xsl:apply-templates/>
    </td>
   </tr>
  </xsl:template>
  
  <xsl:template match="a">
   <a href="{@href}">
    <xsl:apply-templates/>
   </a>
  </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.3       +82 -37    xml-cocoon/samples/dcp/sample-page-html.xsl
  
  Index: sample-page-html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/dcp/sample-page-html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- sample-page-html.xsl	1999/12/02 11:55:01	1.2
  +++ sample-page-html.xsl	1999/12/03 23:49:15	1.3
  @@ -3,61 +3,106 @@
   <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>
  -    <HEAD>
  -      <TITLE><xsl:value-of select="title"/></TITLE>
  -    </HEAD>
  -    <BODY BGCOLOR="white">
  -      <H1 ALIGN="center"><xsl:value-of select="title"/></H1>
  -      <xsl:apply-templates/>
  -    </BODY>
  -    </HTML>
  +   <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
  +   <html>
  +    <head>
  +     <title><xsl:value-of select="title"/></title>
  +    </head>
  +    <body>
  +    <p><br/></p>
  +    <center>
  +     <table border="0" width="60%" bgcolor="#000000" cellspacing="0" cellpadding="0">
  +      <tr>
  +       <td width="100%">
  +        <table border="0" width="100%" cellpadding="4">
  +         <tr>
  +          <td width="100%" bgcolor="#c0c0c0" align="right" valign="middle">
  +           <big><big><xsl:value-of select="title"/></big></big>
  +          </td>
  +         </tr>
  +         <tr>
  +          <td width="100%" bgcolor="#ffffff">
  +           <xsl:apply-templates/>
  +          </td>
  +         </tr>
  +        </table>
  +       </td>
  +      </tr>
  +     </table>
  +    </center>
  +    </body>
  +   </html>  
     </xsl:template>
   
     <xsl:template match="title">
  -   <!-- remove -->
  +   <!-- ignore -->
     </xsl:template>
   
     <xsl:template match="p">
  -   <P>
  +   <xsl:copy>
       <xsl:apply-templates/>
  -   </P>
  +   </xsl:copy>
     </xsl:template>
   
     <xsl:template match="em">
  -    <STRONG><xsl:apply-templates/></STRONG>
  +    <strong><xsl:apply-templates/></strong>
     </xsl:template>
   
     <xsl:template match="parameters">
  -    <P>The following is the list of parameters for this request:</P>
  +   <p>The following is the list of parameters for this request:</p>
   
  -    <TABLE BORDER="1">
  -      <CAPTION><I><B>Parameters</B></I></CAPTION>
  -      <TR>
  -        <TH>Name</TH>
  -	    <TH>Value(s)</TH>
  -      </TR>
  -      <xsl:apply-templates/>
  -    </TABLE>
  +   <center>
  +    <table border="0" width="90%" bgcolor="#000000" cellspacing="0" cellpadding="0">
  +     <tr>
  +      <td width="100%">
  +       <table border="0" width="100%" cellpadding="4">
  +        <tr>
  +         <th bgcolor="#e0e0e0" align="left">Name</th>             
  +         <th bgcolor="#e0e0e0" align="left">Value(s)</th>             
  +        </tr>
  +        <xsl:apply-templates/>
  +       </table>
  +      </td>
  +     </tr>
  +    </table>
  +   </center>
     </xsl:template>
   
     <xsl:template match="parameter">
  -    <TR>
  -      <TD VALIGN="top"><xsl:value-of select="@name"/></TD>
  -      <TD VALIGN="top">
  -	    <TABLE>
  -          <xsl:apply-templates/>
  -        </TABLE>
  -      </TD>
  -    </TR>
  +   <tr>
  +    <td width="100%">
  +     <xsl:choose>
  +      <xsl:when test="position() mod 2 = 0">
  +       <xsl:attribute name="bgcolor">#f0f0f0</xsl:attribute>
  +      </xsl:when>
  +      <xsl:otherwise>
  +       <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
  +      </xsl:otherwise>
  +     </xsl:choose>
  +     <xsl:value-of select="@name"/>
  +    </td>
  +    <td width="100%">
  +     <xsl:choose>
  +      <xsl:when test="position() mod 2 = 0">
  +       <xsl:attribute name="bgcolor">#f0f0f0</xsl:attribute>
  +      </xsl:when>
  +      <xsl:otherwise>
  +       <xsl:attribute name="bgcolor">#ffffff</xsl:attribute>
  +      </xsl:otherwise>
  +     </xsl:choose>
  +     <table border="0">
  +      <xsl:apply-templates/>
  +     </table>
  +    </td>
  +   </tr>
     </xsl:template>
    
     <xsl:template match="parameter-value">
  -    <TR>
  -      <TD>
  -        <xsl:apply-templates/>
  -      </TD>
  -    </TR>
  +   <tr>
  +    <td>
  +     <xsl:apply-templates/>
  +    </td>
  +   </tr>
     </xsl:template>
  -</xsl:stylesheet>
  +  
  +</xsl:stylesheet>
  \ No newline at end of file
  
  
  
  1.3       +1 -5      xml-cocoon/samples/sites/java.apache.org/fancy-page-html.xsl
  
  Index: fancy-page-html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/sites/java.apache.org/fancy-page-html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- fancy-page-html.xsl	1999/12/02 11:55:02	1.2
  +++ fancy-page-html.xsl	1999/12/03 23:49:15	1.3
  @@ -1,14 +1,10 @@
   <?xml version="1.0"?>
   
   <!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
  -<!-- Version: $Id: fancy-page-html.xsl,v 1.2 1999/12/02 11:55:02 stefano Exp $ -->
  +<!-- Version: $Id: fancy-page-html.xsl,v 1.3 1999/12/03 23:49:15 stefano Exp $ -->
   
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
  -  <xsl:output>
  -  
  -  </xsl:output>
  -  
     <xsl:template match="page">
      <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
      <html>
  
  
  
  1.3       +0 -6      xml-cocoon/samples/wap/example-portfolio.xml
  
  Index: example-portfolio.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/wap/example-portfolio.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- example-portfolio.xml	1999/12/02 11:55:03	1.2
  +++ example-portfolio.xml	1999/12/03 23:49:15	1.3
  @@ -61,10 +61,4 @@
      <ever rate="+">87.03</ever>
     </variations>
    </stocks>
  -
  -<note>If loading this page takes a while, you're probably using Netscape
  -Navigator which is very slow at rendering the multiple nested tables
  -used in this page. Try Mozilla and feel the power of the new rendering
  -engine, instead of thinking that Cocoon is slow :)</note>
  -
   </portfolio>
  
  
  
  1.3       +46 -72    xml-cocoon/samples/wap/portfolio-html.xsl
  
  Index: portfolio-html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/wap/portfolio-html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portfolio-html.xsl	1999/12/02 11:55:03	1.2
  +++ portfolio-html.xsl	1999/12/03 23:49:15	1.3
  @@ -8,68 +8,49 @@
      <xsl:processing-instruction name="cocoon-format">type="text/html"</xsl:processing-instruction>
      <html>
   
  -   <head>
  -    <meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"/>
  -    <meta NAME="Author" CONTENT="Cocoon"/>
  -    <title>Portfolio</title>
  -   </head>
  -
  -   <body BGCOLOR="#FFFFFF">
  -    <table border="0" bgcolor="#000000" cellspacing="0" cellpadding="0">
  -     <tr>
  -      <td>
  -       <table border="0" width="100%" cellspacing="2" cellpadding="5">
  -        <tr>
  -         <td bgcolor="#F0F0F0">
  -          <table border="0" width="100%" cellspacing="0" cellpadding="3">
  -           <tr>
  -            <td width="100%" align="center">
  -             <table border="0" width="100%" cellspacing="10">
  -              <tr>
  -               <td valign="top" width="40%">
  -                <table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
  -                 <tr>
  -                  <td width="100%">
  -                   <table border="0" cellpadding="4" width="933">
  -                    <tr>
  -                     <td bgcolor="#C0C0C0" align="right" colspan="2">
  -                      <strong><big><big>Portfolio</big></big></strong>
  -                     </td>
  -                    </tr>
  -                    <tr>
  -                     <td bgcolor="#FFFFFF" align="center">
  -                      <strong><big><big>
  -                       <xsl:value-of select="total"/>
  -                       <xsl:text>$ (</xsl:text>
  -                       <xsl:value-of select="variations/day/@rate"/>
  -                       <xsl:value-of select="variations/day"/>
  -                       <xsl:text>%)</xsl:text>
  -                      </big></big></strong>
  -                     </td>
  -                     <td bgcolor="#FFFFFF" align="center">
  -                      <table border="0" width="100%" cellspacing="10">
  -                       <xsl:apply-templates select="stocks"/>
  -                      </table>
  -                     </td>
  -                    </tr>
  -                   </table>
  -                  </td>
  -                 </tr>
  -                </table>
  -               </td>
  -              </tr>
  -             </table>
  -            </td>
  -           </tr>
  -          </table>
  -         </td>
  -        </tr>
  -       </table>
  -      </td>
  -     </tr>
  -    </table>
  -    <xsl:apply-templates select="note"/>    
  -   </body>
  +    <head>
  +     <title>Your Portfolio</title>
  +    </head>
  +    
  +    <body BGCOLOR="#FFFFFF">
  +     <center>
  +      <table border="0" cellspacing="0" cellpadding="3">
  +       <tr>
  +        <td width="100%" align="center">
  +         <table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">
  +          <tr>
  +           <td width="100%">
  +            <table border="0" cellpadding="4">
  +             <tr>
  +              <td bgcolor="#C0C0C0" align="right" colspan="2">
  +               <big><big>Your Portfolio</big></big>
  +              </td>
  +             </tr>
  +             <tr>
  +              <td bgcolor="#FFFFFF" align="center">
  +               <big>
  +                <xsl:value-of select="total"/>
  +                <xsl:text>$ (</xsl:text>
  +                <xsl:value-of select="variations/day/@rate"/>
  +                <xsl:value-of select="variations/day"/>
  +                <xsl:text>%)</xsl:text>
  +               </big>
  +              </td>
  +              <td bgcolor="#FFFFFF" align="center">
  +               <table border="0" width="100%" cellspacing="10">
  +                <xsl:apply-templates select="stocks"/>
  +               </table>
  +              </td>
  +             </tr>
  +            </table>
  +           </td>
  +          </tr>
  +         </table>
  +        </td>
  +       </tr>
  +      </table>
  +     </center> 
  +    </body>
      </html>
     </xsl:template>
     
  @@ -81,11 +62,11 @@
          <td width="100%">
           <table border="0" cellpadding="4" width="100%">
            <tr>
  -          <td bgcolor="#C0C0C0" align="left" colspan="3">
  +          <td bgcolor="#C0C0C0" align="center" colspan="3">
               <a href="{@url}">
  -             <strong><big>
  +             <big>
                 <xsl:value-of select="@company"/>
  -             </big></strong>
  +             </big>
               </a>
             </td>
            </tr>
  @@ -115,11 +96,4 @@
       </td>
      </tr>
     </xsl:template>
  -  
  -  <xsl:template match="note">
  -   <p>
  -    <xsl:apply-templates/>
  -   </p>
  -  </xsl:template>
  -  
   </xsl:stylesheet>
  
  
  
  1.3       +2 -5      xml-cocoon/samples/wap/portfolio-wml.xsl
  
  Index: portfolio-wml.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/wap/portfolio-wml.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- portfolio-wml.xsl	1999/12/02 11:55:03	1.2
  +++ portfolio-wml.xsl	1999/12/03 23:49:16	1.3
  @@ -2,10 +2,7 @@
   
   <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
   
  -<xsl:stylesheet 
  -	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  -	xmlns="http://www.wapforum.org/DTD/wml_1.1.xml"
  -	result-ns="http://www.wapforum.org/DTD/wml_1.1.xml">
  +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
    <xsl:template match="portfolio">
     <xsl:processing-instruction name="cocoon-format">type="text/wml"</xsl:processing-instruction>
  @@ -30,7 +27,7 @@
        <br/>
        <br/>
        <small>
  -      Copyright&#xA9; 1999<br/>
  +      Copyright &#xA9; 1999<br/>
         Apache Software Foundation.<br/>
         All rights reserved.
        </small>
  
  
  

Mime
View raw message