[xsl] To find out immediate following tag(S)

Subject: [xsl] To find out immediate following tag(S)
From: "J. S. Rawat" <jrawat@xxxxxxxxxxxxxx>
Date: Mon, 06 Oct 2008 17:43:27 +0530
Hi List you people has suggested that one can find out immediate following TAG by following-sibling::*[1][self::a1]. Just to extend the topic, how we will find out all the immediate siblings.

Input
<a>first</a>
<a1>second</a1>
<a1>third</a1>
<a>fourth
<a1>fifth</a1>
<b1>sixth</b1>
</a>
<a1>seven</a1>
<a1>eight</a1>
<a>nine</a>
<b1>ten</b1>
<a1>ele</a1>

OUTPUT
<a>first
second
third</a>
<a>fourth
<a1>fifth</a1>
<b1>sixth</b1>
seven
eight</a>
<a>nine</a>
<b1>ten</b1>
<a1>ele</a1>


Current Thread