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 lib-page.xml
Date Sun, 09 Jan 2000 23:44:19 GMT
stefano     00/01/09 15:44:19

  Modified:    samples  README index.xml
               samples/hello hello-page-html.xsl
               samples/xsp lib-page.xml
  Added:       samples/entities entities-page-html.xsl entities-page.xml
                        message.txt
               samples/import import-page-html.xsl import-page.xml
  Log:
  added some samples to show XML external entities and XSTL import
  
  Revision  Changes    Path
  1.3       +7 -1      xml-cocoon/samples/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/README,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- README	1999/11/30 16:29:58	1.2
  +++ README	2000/01/09 23:44:17	1.3
  @@ -7,13 +7,19 @@
   how to XML-ize your web-serving environment.
   
         - hello ................. a simple hello world example
  +      - entities .............. shows XML external entities
  +      - import ................ shows XSLT imports
         - sites ................. some live Apache web sites XML-ized
         - fo .................... examples regarding XSL formatting objects
         - wap ................... how to turn your site wireless ready with WML
         - vml ................... how to turn your site voice ready with VoiceML
  -      - sql ................... how to XML-ize your legacy rational data
  +      - sql ................... how to XML-ize your rational data
         - dcp ................... how to add dynamic PI evaluation
         - xsp ................... examples to show XML compiled server pages
  +      - ldap .................. how to XML-ize your LDAP data
  +      - vrml .................. how to use Cocoon to generate VRML
  +      - fromServlet ........... how to call Cocoon from another servlet
  +
   
   Filenames
   ---------
  
  
  
  1.6       +9 -0      xml-cocoon/samples/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/index.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- index.xml	2000/01/05 16:13:30	1.5
  +++ index.xml	2000/01/09 23:44:18	1.6
  @@ -8,6 +8,15 @@
      This is a very simple demostration of how to use Cocoon. A simple XML page
      is transformed into an HTML page.
     </sample>
  +  <sample name="Hello World (with external message)" url="entities/entities-page.xml">
  +   This is a very simple demostration of how to use Cocoon. Same page as above,
  +   but some of its content is included using XML external entities.
  +  </sample>
  +  <sample name="Hello World (with imported stylesheet)" url="import/import-page.xml">
  +   This is a very simple demostration of how to use Cocoon. Same page as above,
  +   but its stylesheet is an extention of the previous one and changes some
  +   of its properties.
  +  </sample>
    </group>
    
    <group name="XML-ized web sites">
  
  
  
  1.1                  xml-cocoon/samples/entities/entities-page-html.xsl
  
  Index: entities-page-html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <!DOCTYPE xsl:stylesheet [
   <!ENTITY message SYSTEM "message.txt">
  ]>
  
  <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
  
  <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"/><xsl:text> - &message;</xsl:text>
       </title>
      </head>
      <body bgcolor="#ffffff">
       <xsl:apply-templates/>
      </body>
     </html>
    </xsl:template>
  
    <xsl:template match="title">
     <h1 align="center">
      <xsl:apply-templates/>
     </h1>
    </xsl:template>
  
    <xsl:template match="paragraph">
     <p align="center">
      <i>
       <xsl:apply-templates/>
      </i>
     </p>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/samples/entities/entities-page.xml
  
  Index: entities-page.xml
  ===================================================================
  <?xml version="1.0"?>
  <?xml-stylesheet href="entities-page-html.xsl" type="text/xsl"?>
  <?cocoon-process type="xslt"?>
  
  <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
  
  <!DOCTYPE page [
   <!ENTITY message SYSTEM "message.txt">
  ]>
  
  <page>
   <title>Hello</title>
   <content>
    <paragraph>&message;</paragraph>
   </content>
  </page>
  
  
  1.1                  xml-cocoon/samples/entities/message.txt
  
  Index: message.txt
  ===================================================================
  This is an included message.
  
  
  1.3       +0 -2      xml-cocoon/samples/hello/hello-page-html.xsl
  
  Index: hello-page-html.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/hello/hello-page-html.xsl,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- hello-page-html.xsl	1999/12/02 11:55:02	1.2
  +++ hello-page-html.xsl	2000/01/09 23:44:18	1.3
  @@ -2,8 +2,6 @@
   
   <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
   
  -<!-- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> -->
  -
   <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   
     <xsl:template match="page">
  
  
  
  1.1                  xml-cocoon/samples/import/import-page-html.xsl
  
  Index: import-page-html.xsl
  ===================================================================
  <?xml version="1.0"?>
  
  <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
  
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  
    <xsl:import href="../hello/hello-page-html.xsl"/>
    
    <xsl:template match="paragraph">
     <p align="left">
      <b>
       <xsl:apply-templates/>
      </b>
     </p>
    </xsl:template>
  
  </xsl:stylesheet>
  
  
  1.1                  xml-cocoon/samples/import/import-page.xml
  
  Index: import-page.xml
  ===================================================================
  <?xml version="1.0"?>
  <?xml-stylesheet href="import-page-html.xsl" type="text/xsl"?>
  <?cocoon-process type="xslt"?>
  
  <!-- Written by Stefano Mazzocchi "stefano@apache.org" -->
  
  <page>
   <title>Hello</title>
   <content>
    <paragraph>This is my first Cocoon file!</paragraph>
   </content>
  </page>
  
  
  1.4       +6 -29     xml-cocoon/samples/xsp/lib-page.xml
  
  Index: lib-page.xml
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/samples/xsp/lib-page.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- lib-page.xml	2000/01/08 07:19:37	1.3
  +++ lib-page.xml	2000/01/09 23:44:19	1.4
  @@ -1,7 +1,7 @@
   <?xml version="1.0"?>
   
   <!-- Author: Stefano Mazzocchi "stefano@apache.org" -->
  -<!-- Version: $Id: lib-page.xml,v 1.3 2000/01/08 07:19:37 ricardo Exp $ -->
  +<!-- Version: $Id: lib-page.xml,v 1.4 2000/01/09 23:44:19 stefano Exp $ -->
   
   <?cocoon-process type="xsp"?>
   
  @@ -63,34 +63,11 @@
    further processing of the produced content, as required, for example, by
    XSL-transformations.</p>
    
  - <servlet:headers>
  -  <p>Here are the request headers...</p>
  -  <list title="Request Headers">
  -   <servlet:for-each-header>
  -    <element>
  -     <xsp:attribute name="name">
  -      <servlet:header-name/>
  -     </xsp:attribute>
  -     <servlet:header-value/>
  -    </element>
  -   </servlet:for-each-header>
  -  </list>
  - </servlet:headers>
  -
  - <servlet:parameters>
  -  <p>and here the servlet parameters that were passed along with the request...</p>
  -  <list title="Servlet Parameters">
  -   <servlet:for-each-parameter>
  -    <element>
  -     <xsp:attribute name="name">
  -      <servlet:parameter-name/>
  -     </xsp:attribute>
  -     <servlet:parameter-value tag="item"/>
  -    </element>
  -   </servlet:for-each-parameter>
  -  </list>
  - </servlet:parameters>
  -    
  + <!-- FIXME (SM): here should go some taglib to emulate the other two 
  +      examples, but we don't have yet a good way to iterate over items
  +      and so on without using logic directly... more feedback is needed on
  +      the taglib issue. -->
  +      
    <p>All right, the first XSP page is over, but you can see the dynamically syntax
highlighted
    <link href="view-source.xml?filename=lib-page.xml">source of this page</link>,
    <link href="view-source.xml?url=resource://org/apache/cocoon/processor/xsp/library/java/request.xsl">the
servlet request library logicsheet</link>,
  
  
  

Mime
View raw message