Re: Variables and Values
At 03:00 AM 3/24/2004, you wrote:
In hind sight it is actually more logical to preprocess the data. The application used to contain the code to collect the data via interactive questionnaires, process it and then do the merge - it makes more sense to stick the processing in with the data collection.
> Stretch your brain to accommodate the
The trouble is most likely in the assumption that the way to do it is to set a value and then change it later ... the XSL Way would probably be to use a particular value already set on a node in your source, falling back on another value if the source has no such value to use. More complex dependencies can also be modeled.
But it's difficult to show how this would be without more information about the particulars. And even in pure XSLT, when the dependencies get really complex one sometimes finds the easiest way is to pass over the data more than once (whether by pipelining transforms or by using the widely-available node-set() extension to process result trees) -- which is in effect what you're doing even if not using XSLT for the first-step transform.
So your solution may well be where you would get to in any case. Please don't take my remarks in the spirit of "you should be doing this", since I'm quite satisfied you are working out a strong approach. Rather, I mean only to caution you not to judge XSLT based solely on its lack of features you expect to have, when it has other features that can accomplish the same ends. One of these is the ability to inspect the source tree really easily: XPath gives you, in effect, "random access" to the source document, so for the most part you don't have to program the processor to go hunting for things; you just ask for them. Another of these is the ability not just to use if/then conditionals, but to select and/or match nodes conditionally as well.
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