|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Conditional Grouping Problem
Hi all,
I have an interesting grouping issue. I have xml like: <product> <buyer>John Q. Public</buyer> <name>Our Best Widget</name> </product> <product> <buyer>John Dow</buyer> <name>Our Best Widget</name> </product> <product> <buyer>John Q. Public</buyer> <name>Our Worst Widget</name> </product> <product> <buyer>Jane Doe</buyer> <name>Our Best Widget</name> </product> <product> <buyer>Jill Doe</buyer> <name>Our Worst Widget</name> </product>
Here's the rub, section 1 is for all buyers who only purchased 1 product. Section 2 is for all buyers who buy multiple products. The final output should look like: <!-- single buyers by product name --> <name>Our Best Widget</name> <buyer>Jane Doe</buyer> <buyer>John Doe</buyer> <name> Our Worst Widget</name> <buyer>Jill Doe</buyer> <!-- multiple buyers by buyer --> <buyer>John Q. Public</buyer> <name>Our Best Widget</name> <name>Our Worst Widget</name> If we focus on section 1 for now, I'm using the Muenchian Method with a key like: <xsl:key name="product-by-name" match="Product" use="name" /> How can I modify this key to match only products which are part of a single order (the Product's buyer only bought 1 item)? I'm stretching my xsl knowledge here.. I assume if i can figure this out i can use the same method for section 2. Thanks for any help, -jonathan
|
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
|

Cart








