Re: [xsl] Role of XSLT?

Subject: Re: [xsl] Role of XSLT?
From: Adam Turoff <ziggy@xxxxxxxxx>
Date: Sun, 27 Oct 2002 20:58:26 -0500
On Sun, Oct 27, 2002 at 08:16:25PM -0500, Roger L. Costello wrote:
> I have an XML-based web site.  I have a collection of stylesheets which
> convert my Web site's internal XML data into various
> client-customized-HTML.  For example, for my premier clients I have a
> stylesheet which applies a 5% discount.  For clients with handicaps I
> have another stylesheet which displays a select product list.  For
> international clients I have still another stylesheet which converts
> prices to the appropriate currency. And so forth.  Further, as a
> relationship is developed with a new type of client I simply drop in a
> new stylesheet.  The new client is thus seamlessly integrated.

OK.

> Is this a good use of XSLT?  I don't think so.  

Why not?

> The problem is that I am
> dispersing my business rules across the stylesheets, e.g., premier
> clients get a 5% discount.  Maintaining such a system becomes a
> nightmare.

Sounds like a characteristic of your current implementation, not
a failing of XSLT per se.  You could also take this opportunity to
examine your current business rules and reimplement your site with
refactored XSLT stylesheets that better accomodate your needs.

Alternatively, you could throw *everything* out and reimplement
your site in Java, Perl, Python, Zope, PHP, Ruby, ASP, Apache
modules, or [any other web technology of your choice], and better
support for your business rules.  The cost would be tremendous
downtime to learn a new technology and a possibility (not a certainty)
that you'd get better support for your business rules.

> This leads me to question the role of XSLT.  Are there stylesheets which
> do not have business rules built-in?  Should stylesheets be confined to
> simply doing mindless formatting?  What are your thoughts?  /Roger

The role of XSLT is to transform XML data from one representation to
another.

If you need to separate your transformation into two passes -- one for
applying business rules and a second to formatting -- there's nothing
inherent in XSLT that prevents you from doing that.  

Z.


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


Current Thread