|
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 one.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/">
<xsl:apply-templates select="/page/html"/> </xsl:template> <xsl:template match="/page/html">
<xsl:apply-templates select="@*|node()" /> </xsl:template> <xsl:template match="/page/html//@*">
<xsl:copy /> </xsl:template> <xsl:template match="/page/html//node()">
<xsl:choose> <xsl:when test="name()='span'"> <span> <xsl:copy-of select="@*[not(name()='id')]"/> <xsl:variable name="actionName" select="@id"/> <xsl:apply-templates select="/page/*[name() = $actionName]"/> </span> </xsl:when> <xsl:otherwise> <xsl:copy> <xsl:apply-templates select="@*|node()" /> </xsl:copy> </xsl:otherwise> </xsl:choose> </xsl:template> </xsl:stylesheet>
|
- Re: html templates - best practise Andreas Bohnert
- Re: html templates - best practise Derek Hohls
- Re: html templates - best practise Bertrand Delacretaz
- Re: html templates - best practise Andreas Hartmann
- RE: html templates - best practise Conal Tuohy
- Re: html templates - best practise Derek Hohls
- Re: html templates - best practise Derek Hohls
- Re: html templates - best practise Andreas Hartmann
- Re: html templates - best practise gounis
- RE: html templates - best practise Ralph Goers
- RE: html templates - best practise Horsfield, Peter A.
- RE: html templates - best practise Horsfield, Peter A.
