xsl-list
[Top] [All Lists]

Re: Problem selecting following::code

2005-10-11 04:50:07
On 10/10/05, watchstone(_at_)netzero(_dot_)com 
<watchstone(_at_)netzero(_dot_)com> 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.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>