[xsl] Templates Producing Similar Output

Subject: [xsl] Templates Producing Similar Output
From: "Peter Eschenbrenner" <cen_sys@xxxxxxxxxxx>
Date: Tue, 1 Apr 2003 10:48:44 -0600
I am of the opinion that similar items should be built/managed using the
same templates.  I am building SQL statements and like the idea of
having the same template produce statements to pull data out and put it
back in.  I am not worried as much about performance as I am about
maintainablility.


SELECT    client.datecreated,
UPDATE    datecreated='$db_client_datecreated',
INSERT    (datecreated, ...) VALUES ( '$db_client_datecreated', ...)

SELECT    <tableName />.<fieldName />, ...
UPDATE    <fieldName />='$db_<tableName />_<fieldName />', ...
INSERT    (<fieldName />, ... ) VALUES ( '$db_<tableName />_<fieldName
/>', ...)
 

The first part of INSERT is the same as SELECT but without the
<tableName />. prefix.  The last part of INSERT is the same as UPDATE
but without the <fieldName />= prefix.  So as I see it there are two
options:


SELECT would have one template
UPDATE would have one template
INSERT would have two templates
-- OR --
SELECT and INSERT would share a template with a parameter
UPDATE and INSERT would share a template with a parameter


Question:
Should I build the templates to be shared?


Peter Eschenbrenner (XSL newbie)

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


Current Thread