[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: making html output for application pages

Subject: Re: making html output for application pages
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Fri, 19 Apr 2002 23:18:58 +0200
bernie bernstein
Bernie Bernstein wrote:
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>

I hope you see the pattern and can extend on it.

J.Pietschmann


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.