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

RE: XHTML templating (best method)

Subject: RE: XHTML templating (best method)
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 26 Jan 2007 16:03:13 -0000
RE:  XHTML templating (best method)
> That would be a better way around but I can't see a way to 
> wrap the page-specific stylesheets in the common one without 
> breaking the common stylesheet in two stylesheets, top and 
> bottom, or am I missing the point.

Something like this:

[specialCase.xsl]

<xsl:stylesheet>
 
<xsl:import href="generalCase.xsl"/>

<xsl:template match="/" mode="page-specific">
  ... generate page-specific content ...
</xsl:template>

</xsl:stylesheet>

[generalCase.xsl]

<xsl:stylesheet>
 
<xsl:import href="generalCase.xsl"/>

<xsl:template match="/">
  <boilerplate>
    <xsl:apply-templates select="." mode="page-specific"/>
  </boilerplate>
</xsl:template>

</xsl:stylesheet>

The detail can vary, depending on how much common structure there is between
the different XML source documents. As shown above, it works with no common
structure at all: the only thing the general-purpose stylesheet does it to
wrap a standard boilerplate around the page-specific output.

Michael Kay
http://www.saxonica.com/

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.