I've been googling for help on this one and found the dawson resource (
http://www.dpawson.co.uk/xsl/sect2/sect21.html) but there's a lot there and I'm not even really sure how to properly word my problem.
I want to take an arbitrary XML file (so immediately I'm thinking 'start with identity transform') and for every leaf node, set its text value equal to an ever increasing number. Ideally they should represent an iterative count of which leaf it is, but as long as they are unique, I could live without it.
I'm a bit stuck on two aspects. First, how to modify the identity transform to say "Copy everything other than the text, which I would like to change to X" and second, how to maintain that X throughout my transform so that it is unique/increasing.
(For the curious I've got a rather unwieldy piece of legacy code (not XSL) that reads in my XML and processes it twelve ways to Sunday. There's a bug somewhere that's causing wrong data to be processed. Since a large portion of my incoming data is identical to other parts, I'm trying to come up with some sort of way to map my data through the system so that when I look at the output I can say "Aha, leaf 12 ended up here when it should have been leaf 97.")
Thanks!