[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: how to rearrange nodes based on a dependency graph
Guenther,
I didn't follow the start of this thread closely, so I can't give a particular solution, but... At 05:52 PM 12/20/01, you wrote: I still can't see what this would do. This isn't about simply filtering out nodes with dependencies, it is filtering out those nodes that had already been processed because of the dependency graph walk. The only way I can see to do this is to somewhere keep a list of the processed nodes, but how can I do that with XSL? (I guess I can't). Right: such an approach would not be The XSL Way. XSLT processing is designed to be as side-effect free as possible; and unfortunately relying on the order nodes happen to be processed in a given implementation (or even relying on the assumption that they will be processed in any order at all) is considered to be relying on a side effect. The only alternative would be to decide for every node if it would have been in the dependency graph of any prior node. But that would mean that all dependency graphs need to be always chased for every node, that's kind of mind-boggling. It is, which is why people are trying to apply keys to approach the problem: keys are the usual XSLT device for creating associations between elements based on relationships other than the structures they come in (in your case, cross-references between the elements). The fact that a given key value can return several matching nodes is an important feature, allowing for grouping (which idiom has made Steve Muench immortal) -- which may be exactly what you really need -- and other kinds of operations that defy the logic of document order. I think a key approach would do it for you; if even that comes up short, the next strategy to consider would be to break your processing into two passes. XSLT gets really powerful when you use a stylesheet to generate either a new source file optimized for the next pass, or a second stylesheet to run over the same source. Does that suggest directions for you to think in? Cheers, Wendell
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
|