This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Compare current node with the last node in a sorted for-each list
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] Compare current node with the last node in a sorted for-each list
- From: TBrouwer at virtual-affairs dot com
- Date: Mon, 21 May 2001 14:20:58 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
Example:
<node1>
<node2 attr="name4" extra="test1"/>
<other>More1</other>
<x>X</x>
<y>Y</y>
<node2 attr="name3" extra="test2"/>
<s>S</s>
<other>More2</other>
<node2 attr="name2" extra="test1"/>
<other>More3</other>
<node2 attr="name1" extra="test1"/>
<z>Z</z>
<other>More4</other>
</node1>
Is it possible to display all 'node2' in alphabetic order based on the
value of the 'attr' attribute? Further, as the value of the attribute
'extra' is the same as the node before in the sorted list, then print an
extra line under that node with <same />
Wanted output:
<node2 attr="name1" extra="test1"/>
<node2 attr="name2" extra="test1"/>
<same/>
<node2 attr="name3" extra="test2"/>
<node2 attr="name4" extra="test1"/>
Thanks in advance for any suggestions....
T. Brouwer.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list