[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Problem selecting following::code

Subject: Re: Problem selecting following::code
From: andrew welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 11 Oct 2005 12:50:07 +0100
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.