cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <>
Subject RE: html templates - best practise
Date Fri, 03 Oct 2003 15:02:21 GMT
I believe I am doing exactly what you are asking.  We use an html skeleton
that contains span tags wherever dynamic content is to go. We have a
pipeline that aggregates the html (converted to XHTML by the HTMLGenerator)
along with the XML form of our Data Transfer Objects as created by Betwixt.
This is then transformed by a stylesheet that imports the following
stylesheet. This stylesheet echos all the html until it finds a span tag. It
then uses the id to process the DTO using the stylesheet that imported this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl=" <>
<xsl:template match="/">
  <xsl:apply-templates select="/page/html"/>
<xsl:template match="/page/html">
      <xsl:apply-templates select="@*|node()" />
<xsl:template match="/page/html//@*">
  <xsl:copy />
<xsl:template match="/page/html//node()">
    <xsl:when test="name()='span'">
        <xsl:copy-of select="@*[not(name()='id')]"/>
        <xsl:variable name="actionName" select="@id"/>
        <xsl:apply-templates select="/page/*[name() = $actionName]"/>
        <xsl:apply-templates select="@*|node()" />

-----Original Message-----
From: Andreas Bohnert []
Sent: Friday, October 03, 2003 2:21 AM
Subject: html templates - best practise

i read a lot of tutorials and docs about cocoon and i really like it, but I
still don't know, what's the best practise to handle html templates.
I get the static part of my html page from a html designer and I want to
leave it untouched, so the designer can modify it later on. Of course, some
place holders and template instructions should be in there, to put the
dynamic part into the right place.
maybe this strict seperation( html design <-> java/xml programming) is
against the philosophie of cocoon, because I understand:
all required data (static+dynamic) should be put in the xml datasource with
the generator and during the transformation process this data will be mixed
with html(or wap or pdf) language specific parts.
so, how do you handle this?
any suggestions/comments are welcome!!
thanks very much

View raw message