Re: [xsl] Web sites: building common components centrally

Subject: Re: [xsl] Web sites: building common components centrally
From: Raffaele Sena <raff@xxxxxxxxxxxx>
Date: Thu, 25 Nov 2004 21:06:59 -0800 (PST)
If you are thinking of producing your data as valid XHTML documents you 
can simply add "marker" for where you want to insert the common part.
You can have empty <div> like:

  <div class="header"/>

  <div class="footer"/>

and have your XSL pages match on the named div:

  <xsl:template match="div[@class='header']"/>

For adding CSS you can match on the "head" tag, copy its content and add 
your styles.

And if you don't "process" your data you will have valid pages with 
probably some extra empty lines (the divs).

The only thing I don't like of this approach is the amount of extra data 
you have to add to produce valid XHTML page (html/head/body, etc.) but 
again, if you want to have the option of not having to run an XSLT 
processor on your data and still have viewable pages that makes up for it.

-- Raffaele

------------------------------------------------------

On Thu, 25 Nov 2004, Frans Englich wrote:

  ...
> 
> Currently, my plan is to write/produce all documents in XHTML, and associate 
> every file with an XSLT which adds the common parts such as base CSS, 
> headers, navigation, footers, and so forth; the styleheet would "merge" the 
> document with the common elements.
> 
> To me it sounds practical, the documents are standalone, valid XHTML 
> documents(they can be validated and tested independently) and the website 
> framework is centrally controlled. Bandwidth can be saved by doing the 
> transformation at the client. Perhaps it is restraining if the navigation is 
> somehow dynamic/context bound, affected by the document, I cannot yet tell.
> 
> But this is a common problem -- how do people usually solve this?
> 
 ...

Current Thread