Let's say I have some XSL transforming XML. Is it possible for the same XSL sheet to run a second sweep over the resultant XML? For example, let's say my XSL turns
<xml> <animal><dog>Rex</dog></animal> <animal><dog>Henry</dog></animal> <animal><dog>Fido</dog></animal> </xml> into
<xml> <dog>Rex</dog> <dog>Henry</dog> <dog>Fido</dog> </xml> I don't want to output that; rather, I then want to perform more XSL based on THAT, i.e. resultant, XML structure.
A practical example? I want to append to each dog node the number of proceeding dog siblings it has. So it would end up like:
<xml> <dog>Rex (2)</dog> <dog>Henry (1)</dog> <dog>Fido (0)</dog> </xml> This could not be done on the first sweep because in the beginning XML, the dog nodes were not siblings - they each lived inside an animal node.
[EDIT: I know this could be done by interrogating instead the index of the parent animal node, but that's only for this contrived example; generally, I still need to know how to act on transformed XML - if it's even possible]
I hope that makes some sort of sense. If there is a really easy way to do this, go easy on me, as I'm no XSL ninja...
Thanks in advance