[xsl] one stylesheet template for mutiple tables

Subject: [xsl] one stylesheet template for mutiple tables
From: Jerome Sabourin <Jsabourin@xxxxxxxxxxxxxxxxx>
Date: Wed, 30 Jul 2003 16:42:12 -0300
Greetings,

I am wondering if anyone thinks this can be done..  I would like to create
one stylesheet that can be used against multiple tables, using information
from another xml file..

let me try to explain..

I have an existing application which has an config xml file which contains
information regarding a number of individual tables. 
This Config XML is used in another part of the application and i would like
to use it to generate the xsl so i don't have to worry about changing the
stylesheets if the user edits 
this application config. 

This Config xml file tells me the column name and the column header, and the
order to which the xml files are to appear. If columns are not in the
config.xml then i don't wanna display them even though they may exist in the
table source xml. Note each table can have a different number of columns and
this can change.. see Config XML.

Config XML..

<config>
	<table id = "table1">
		<col header = "Name" node = "Na"></col>
		<col header = "Description" node = "Desc"></col>
	</table>

	<table id "table2">
		<col header = "Town" node = "Twn"></col>
		<col header = "Province" node = "Pr"></col>
		<col header = "Street" node = "St"></col>
	</table>
</config>


the data XML for table 1

<NewDataSet>
	<QueryReturn>
		<Na>Mary</Na>
		<NotShown>AAA</NotShown>
		<Desc>a nice girl</Desc>
	</QueryReturn>

	<QueryReturn>
		<Na>Jane</Na>
		<NotShown>BBB</NotShown>
		<Desc>a naughty girl</Desc>
	</QueryReturn>
</NewDataSet>

the data XML for table 2

<NewDataSet>
	<QueryReturn>
		<NotShown>XXX</NotShown>
		<Twn>Moncton</Twn>
		<St>Crowell Dr</St>
	</QueryReturn>

	<QueryReturn>
		<NotShown>YYY</NotShown>
		<Twn>Halifax</Twn>
		<St>High St</St>
	</QueryReturn>
</NewDataSet>

Thanks 
J
And the day came when the risk it took to remain tight inside the bud was
more painful than the risk it took to blossom. 
Anais Nin







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


Current Thread