Subject: Re: [xsl] RE: loop elements based on attribute From: Martin Honnen <Martin.Honnen@xxxxxx> Date: Fri, 15 Aug 2008 17:15:59 +0200 |
In an xslt-file I use templates for each match on different elements. When I reach a Pkt-element I call the template "pktTemplate". How can I get the right result? I'm almost there...but the problem is that the first Pkt-element that matches (where the template-call is done) is never listed in the result. But the siblings are listed at the right way.
<xsl:template name="pktTemplate">
<xsl:if test="not(preceding-sibling::*[1][self::Pkt])"> <List> <xsl:for-each-group
select="following-sibling::Pkt
[preceding-sibling::*[1][self::Pkt]][generate-
id(preceding-sibling::Pkt[not(preceding-
sibling::*[1][self::Pkt])][1])= generate-
id(current())]" group-starting-with="Pkt[not(@type =
'uavs')]">
Well you only process the following siblings above. So perhaps you want <xsl:for-each-group select=". | following-sibling::Pkt [preceding-sibling::*[1][self::Pkt]][generate- id(preceding-sibling::Pkt[not(preceding- sibling::*[1][self::Pkt])][1])= generate- id(current())]" group-starting-with="Pkt[not(@type = 'uavs')]">
Martin Honnen http://JavaScript.FAQTs.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: loop elements based on at, Kjellaug Johansen | Thread | Re: [xsl] RE: loop elements based o, Mukul Gandhi |
Re: [xsl] Fill line ends with dots, Liam Quin | Date | [xsl] Getting node w/ lowest attrib, Bordeman, Chris |
Month |