In the foreach loop, I want to use before-sibling ::
<for-each..>
<xsl:sort select="type"/>
<xsl:when test="preceding-sibling::data[1]/type != type
the problem is that the "type" within foreach is compared with an unsorted predecessor for example
data1/type = 1
data2/type = 2
data3/type = 1
will compare in the second cycle silbling = 2 (original unsorted) and type = 1 (since it is sorted)
Is there a way around it?
UPDATE: my intention is as follows
before after
data/type2 type1 value1
data/type1 type1 value2
data/type1 and speaking in HTML a spacer here (I compare type2:value to preceding-sibling value
data/type2 type2 value1
type2 value2
I have an unsorted list of addresses, where type is a city, and I need an HTML table sorted by city and do something depending on values ββand other fields (this part works, but since comparing with the previous ones - sibling does not work in sorted for everyone, I have a problem
source
share