[xsl] testing for position of an element and displaying it accordingly

Subject: [xsl] testing for position of an element and displaying it accordingly
From: ms <mina_hurray@xxxxxxxxx>
Date: Fri, 19 Jan 2007 06:58:29 -0800 (PST)
Hi all:

My input XML looks like this;

<r1>
<a>test</a>
<a>test2</a>
<b>test test</b>
<a>test3</a>
</r1>

For this XML, I would like to write an XSLT which
basically achieves the following:

1) For the <a> elements which are above the <b>
element, they should be displayed this way:

Test
Test2
1)test test

2) For the <a> element which appears after the <b>
element, I want it displayed after the <b> element:

Test
Test2
1)test test
test3

How can I achieve this in XSLT?  I tried testing the
position, using position()=1. This works obviously for
the first <a> element and fails for the second one. 

Please let me know if this is possible? 


 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

Current Thread