Subject: Re: [xsl] modeling relationships for efficent XSL processing From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 26 Feb 2004 20:58:18 -0500 |
Basically my task is this: somehow organize all information about a set of databases, features, and sites and be able to dynamically generate configuration files for a number of configurations, and for a number of output formats.
But I don't want to keep repeating the same information in the XML file. I keep going back to the idea of trying to "normalize" the XML so that one doesn't have to keep repeating information.
The example above requires not only that the person writing the <site> node know which databases a feature uses, it requires embedding the actual model of the feature and it's configuration file into the <site> element itself. That seems bad to me.
I'd like to figure out a way to have the human deal with normalized data and have the computer figure out how to expand everything into the final format. So two node sets (and you can see by the comment in the first I can't figure out how it'd be modeled):
<feature name="dblookup">
<!-- this feature requires 1 or more databases -->
<config name="/usr/local/etc/dblookup.conf">
<list name="databases">
<!-- somehow indicate a variable list of dbname_server_pair nodes? -->
</list> </config> </feature>
<site name="intranet_wsj"> <use_feature name="dblookup"> <use_database dbserver="oracle1" dbname="barrons_content"/>
<use_database dbserver="oracle2" dbname="wsj_content"/>
<use_database dbserver="oracle1" dbname="barrons_subscribers"/>
<use_database dbserver="oracle1" dbname="wsj_subscribers"/>
</use_feature> </site>
Get transformed into:
<site name="intranet_wsj">
<feature name="dblookup">
<config name="/usr/local/etc/dblookup.conf">
<list name="databases">
<dbname_sever_pair dbname="barrons_content" dbserver="oracle1"/>
<dbname_sever_pair dbname="wsj_content" dbserver="oracle2"/>
<dbname_sever_pair dbname="barrons_subscribers" dbserver="oracle1"/>
<dbname_sever_pair dbname="wsj_subscribers" dbserver="oracle2"/>
<xsl:for-each select="id(@nameservers)"> <dbname_server_pair dbname="{@dbname}" dbserver="{@dbserver}"/> </xsl:for-each>
</list> </config> </feature> </site>
That lets the human deal with the bits of information important to them, and require they have intimate knowledge of every feature's exact makeup. Is this making any sense to people> I'm worried I'm muddling my goals. :(
-- US XSL training: Washington,DC March 15; San Francisco,CA March 22 World-wide on-site corporate, government & user group XML training G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] modeling relationships fo, James A. Robinson | Thread | [xsl] Unable to resolve the XSL ref, Bob Cagle |
[xsl] Outputting A tag information, Vivek Shinde | Date | [xsl] attribute values as name valu, Tracy |
Month |