[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem selecting following::code
On 10/10/05, watchstone@xxxxxxxxxxx <watchstone@xxxxxxxxxxx> wrote: > I am taking a list of items and combining/grouping them by their <id> number (a substring of it) and then outputting each as a separate file. I asked about creating multiple output files last week and couldn't get the 2.0 solution to work, so I'm using version 1.1 with saxon 6.5.x so please give a solution that will work with that. Here's the structure of my data: You couldn't get <xsl:result-document> to work in 2.0 so you decided to use 1.1?? That's madness :) [snip] > <!-- > I want to only select the first <item> where > the first four digits of the <id> element match > any number of following <item> elements, so this test > intends to make sure that only the first <item> is selected > --> <xsl:for-each-group select="item" group-by="substring(id, 1, 4)"> Then use current-group() to access the elements in the group, and current-grouping-key() to access the value used to group them together. Shorter, concise questions tend to get more answers as the person answering the question doesn't have to invest too much time in reading and understanding the problem.
|
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
|