RE: Re: Flat -> Hierarchy --- Continue
[ Dongling Ding] > > My xslt is a generic script. It doesn't know the xml > file name. Is there any other way to do the same > thing? > There are several ways, and it depends on how you want to invoke the transformation. The simplest thing to do is to pass in the file name as a parameter to the stylesheet. You can do this on the command line, or programatically if you invoke the processor that way. How you do it varies from one processor to the other. Another way is to use a driver file - an xml file, of course - which specifies both the data file and the hierarchy structure specification. Then you use document() to bring in each of them, after getting their names from the driver file. The driver file would be the file that you present to the stylesheet for processing. If you will be doing a lot of these tasks but changing the source and structure for each run, a driver file would be best because it would be easy to maintain and to change. There are other possibilities but these are probably the best candidates. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format