[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Sorting unique and sub-total problem
Roger,
At 11:27 AM 6/2/2004, you wrote: The <ITEM> nodes can be in any order. What I would like to get at the end is the following out put. Yes: the axes provide access to the document in its original order. You have a fairly standard grouping problem. Grouping is a very common requirement that is not addressed well by XSLT 1.0 (it is a species of up-conversion), but for which a multitude of sophisticated techniques have nonetheless been devised. Start researching them on the FAQ at http://www.dpawson.co.uk/xsl/sect2/sect21.html, and at Jeni's pages at http://www.jenitennison.com/xslt/grouping. I fear that the only way to deal with this is to use XSLT to preorder the nodes and then use a 2nd script using the same approach as described. You could do this, but your problem does not look so difficult that you couldn't do it in one pass. Alternatively I could go right back to the process that originally created the XML file and order / sub total from there... something I really want to avoid if at all possible. This, however, is sometimes the best solution: sometimes the source comes out of a relational database, and relational technology is very good at this kind of operation. Is there another approach I can take ? Am I expecting too much from XSLT with all this... ? Nope. Just dig a little deeper under "grouping". Good luck, Wendell
|
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
|