Subject: Re: [xsl] making html output for application pages From: "J.Pietschmann" <j3322ptm@xxxxxxxx> Date: Fri, 19 Apr 2002 23:18:58 +0200 |
When generating the pages, the xsl figures out the general layout of the page and values of things like the page title, headers. This requires lots of instances of:
<xsl:choose> <xsl:when test='/top/page = "index"'> <xsl:text>This is the index page</xsl:text> </xsl:when> <xsl:when test='/top/page = "somePage"'> <xsl:text>This is some other page</xsl:text> </xsl:when> ... and so on for about 30 pages ... </xsl:choose>
Well, you can try to leverage the template mechanism. For example <xsl:template match="top"> <html> <head> <title> <xsl:apply-template select="page" mode="title"/> </title> </head> <body> <xsl:apply-template select="page" mode="body"/> </body> </html> </xsl:template>
<xsl:template match="page[.='index']" mode="title"> <xsl:text>Index page</xsl:text> </xsl:template>
<xsl:template match="page[.='somePage']" mode="title"> <xsl:text>This is some other page</xsl:text> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] making html output for applic, Bernie Bernstein | Thread | RE: [xsl] making html output for ap, Hunsberger, Peter |
[xsl] making html output for applic, Bernie Bernstein | Date | [xsl] XPath Explorer, alex |
Month |