You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by Apache Wiki <wi...@apache.org> on 2005/04/05 14:03:40 UTC
[Cocoon Wiki] Update of "TemplateBasedWebSite" by EladMessing
Dear Wiki user,
You have subscribed to a wiki page or wiki category on "Cocoon Wiki" for change notification.
The following page has been changed by EladMessing:
http://wiki.apache.org/cocoon/TemplateBasedWebSite
The comment on the change is:
Some fixes so that the example could be copy pasted and work
------------------------------------------------------------------------------
For each request (URI) a content xml is generated
Page1.xml
- {{{
+ {{{
+ <html xmlns:osm="http://osmosis.gr/osml/1.0">
<osm:containers>
<osm:container contentID="page-title">
<p> First Page Title </p>
@@ -47, +48 @@
<p>first page body ......</p>
</osm:container>
</osm:containers>
+ </html>
}}}
=== Template ===
- XHTML file that can be edit using any visual XHTML editor work as our website template. Inside this template file are some special elements belong to diffirent namespace. Those elements define where to put the content from block or main content.
+ XHTML file that can be edit using any visual XHTML editor work as our website template. Inside this template file are some special elements belong to diffirent namespace. Those elements define where to put the content from block or main content.
-
+
+ template.xhtml
{{{
- <html>
+ <?xml version="1.0"?>
+ <layout>
+ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:osm="http://osmosis.gr/osml/1.0">
<body>
<p><osm:copy-content select="page-title"/></p>
<table>
<tr>
<td><osm:copy-block select="menu"/></td>
- <td><osm:copy-content select="page-body"</td>
+ <td><osm:copy-content select="page-body"/></td>
</tr>
</table>
- <p>><osm:copy-content select="footer"/></p>
+ <p><osm:copy-block select="footer"/></p>
</body>
- </html>
+ </html>
+ </layout>
}}}
=== Put all together ===
@@ -118, +124 @@
</xsl:template>
- <xsl:template match="osm:content-copy">
+ <xsl:template match="osm:copy-content">
<xsl:call-template name="getContent">
<xsl:with-param name="select" select="@select"/>
</xsl:call-template>
</xsl:template>
- <xsl:template match="osm:block-copy">
+ <xsl:template match="osm:copy-block">
<xsl:call-template name="getBlock">
<xsl:with-param name="select" select="@select"/>
</xsl:call-template>
@@ -168, +174 @@
core.xsl
{{{
- <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:osm="http://osmosis.gr/osml/1.0"
+ <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:osm="http://osmosis.gr/osml/1.0">
<xsl:output method="html" version="1.0" encoding="iso-8859-7" indent="yes" omit-xml-declaration="no"/>
<!-- if you create your custom xml - xsl element add here refernce to your xsl -->