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

Re: Headers 'n Footers 'n XSL

Subject: Re: Headers 'n Footers 'n XSL
From: Arni J Rognvaldsson <arni.rognvaldsson@xxxxxxxxxx>
Date: Tue, 20 Mar 2001 16:34:45 -0500
arni rognvaldsson
Hi,

Assuming your XML looks like this:

<doc>
        <foo>
        </foo>
</doc>

Your XSL for individual pages could look something like this:

<?xml version="1.0"?>
<xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:include href="header_footer.xsl"/>

<xsl:template match="doc">
...
</xsl:template>
</xsl:stylesheet>

And your common header_footer.xsl something like this:

<?xml version="1.0"?>
<xsl:stylesheet version='1.0' xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>

<xsl:template match="/">
        [header here]
        <xsl:apply-templates select="doc"/>
        [footer here]
</xsl:template>
</xsl:stylesheet>

I'm sure this can be improved on some, but at least it works. The interesting part is that from a file perspective, your individual pages include the header/footer, but from an XSL perspective you can think of the header_footer page including the other pages.

Arni

At 01:08 PM 3/20/2001 -0800, you wrote:
Howdy,

I was wondering if anybody on this list has ever worked with headers and
footers and XSL. What I mean is that you have a site or an app that has the
same header, the same footer but the content differs in the middle. What I'd
like to do is have xsl for the particular pages that are getting generated
but call an external source for the header and footer so as to not recreate
the same html all over again. Makes it easy to update headers and footers
too.

I did this in the past when the XSL spec was in its infancy but since then
it doesn't seem like there's an easy way to do this. I was thinking
<xsl:import> or <xsl:include>

Any ideas?

Thanks,

Jon


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


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.