Just to clarify the title, I have an XML document that looks like the following:
<group>
<starter>Start</starter>
<backup1>Backup1</backup1>
</group>
<group>
<starter>Another starter</starter>
<backup1>Backup1</backup1>
<backup2>Backup2</backup2>
<backup3>Backup3</backup3>
<reserve>Reserve</reserve>
</group>
So each group can have any number of <backupN>
tags. I need to make sure my XSLT grabs all of them and renames them to "backup_n". Normally my XSLT would apply something in line with the following:
<xsl:for-each select="group/backup">
and loop around that xpath selection. That clearly won't work as even if there is only 1 backup, it's still named <backup1>
and there can also be an arbitrary amount of <backupN>
tags.
What's the best way to loop around arbitrary tags like this? I am using XSLT 1.0, so can't really use any XSLT 2.0 greatness.