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

Web app customization - XSLT design and reuse

Subject: Web app customization - XSLT design and reuse
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Fri, 25 Apr 2008 20:42:55 +0200
 Web app customization - XSLT design and reuse
I have a simple BDBXML/PHP/XSLT web application. XML documents are
stored in BDBXML, retrieved via PHP and transformed into HTML using
XSLT 1.0 (LibXSLT).

I want the look to be customizable. Many things can be made look
different using just CSS. However, I'd like to also reshuffle the HTML,
whenever the need arises. There may be things to add or remove or
rearrange.

I'm looking for the best strategy to do this. To me, the best strategy
means: avoid redundancy, reuse your code, make adaptations with minimum
textual changes.

Currently, I have a couple of PHP scripts each of which teams up with an
XSLT stylesheet. All of them include common functionality in main.xsl,
which contains the skeleton of my page layout.

Then, there are some stylesheets used for formatting data, which work
together. I xsl:import fmt1.xsl for basic stuff; for a more complicated
layout, I also xsl:import fmt2.xsl; and, for special occasions, also
fmt3.xsl.

Now, I may want to serve different versions of my page layout. My idea
is that whatever I may wish to override should go into xsl:template in a
seperate file that is pulled in using xsl:import, so a later xsl:import
on the same level can be used to override the definitions contained
therein.

In this scenario, an xsl:template[@match] may have an advantage over
xsl:template[@name] as xsl:apply-imports works only for match templates,
not for named ones.

Is this the way to go or are there alternatives, maybe more suitable
ones? Any comments welcome!

Michael

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.