cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Devrim HC <ah...@headcrash.de>
Subject Cocoon-BASICS (could someone look on my listings and say what's m y fault, please)
Date Fri, 03 Nov 2000 11:05:13 GMT
Hello everybody,
 
first I want to be excused for my bad english, but I think it's the only way
to get a answer in this mailinglist.
I found cocoon for me sometime ago and I think the idea cocoon is
representing is great. So I try to learn it, but
enough of me ...
 
Now, my problem:
 
    I try out the basic-idea of cocoon (split content/logic/design) but I
get at last a XML-output on my browser.
 
 
 
THANX a lot of spending time for my Problem!
greetings to all in this mailinglist...
 
Ahmet D.
 
 
This is my XML-file called "hello3.xml" I'am calling from the browser using
Port :8080 :
(I think this should be my content file)
 
<?xml version="1.0"?>
 
<?cocoon-process type="xsp"?>
 
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="hello3-xsp.xsl" type="text/xsl"?>
 
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
 
 <seite>
  <titel>Hello World!</titel>
  <inhalt>
   <paragraph>This is my first own Cocoon page, width a time/date
output!<datum format="test"/></paragraph>
  </inhalt>
 </seite>
 
</xsp:page>

This is my XSP-file called "hello3-xsp.xsl" called out of hello3.xml:
(..., this my logic-sheet, ...)
 
<?xml version="1.0"?>
 
<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
 xmlns:xsp="http://www.apache.org/1999/XSP/Core"
 xmlns:example="http://www.plenix.com/DTD/XSP/Example"
>
 
 <xsl:template match="xsp: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="hello2.xsl"
type="text/xsl"</xsl:processing-instruction>
 
  <xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
   <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
   </xsl:copy>  
   <xsp:logic>
    Date now = new Date();
   </xsp:logic>
   <xsl:copy>
    <xsl:apply-templates/>
   </xsl:copy>
  </xsp:page>
 </xsl:template>
 
 <xsl:template match="@*|node()" priority="-1">
  <xsl:copy>
   <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
 </xsl:template>
 
 <xsl:template match="datum">
  <xsp:expr>now</xsp:expr>
 </xsl:template>
 
</xsl:stylesheet>
 
 
 
 
 
This is my XSL-file called "hello2html.xsl" to translate in HTML:
(... and this should be my design file)
 
<?xml version="1.0"?>
 
<?cocoon-process type="xsp"?>
 
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
  <xsl:template match="seite">
   <xsl:processing-instruction
name="cocoon-format">type="text/html"</xsl:processing-instruction>
   <html>
    <head>
     <title>
      <xsl:value-of select="title"/>
     </title>
    </head>
    <body bgcolor="#ffffff">
     <xsl:apply-templates/>
    </body>
   </html>
  </xsl:template>
 
  <xsl:template match="titel">
   <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>
 
 
 
 
THANX a lot of spending time for my Problem!
greetings to all in this mailinglist...
 
Ahmet D.
 

Mime
View raw message