I am writing a transform for a set of nodes, similar to this.
<xsl:template match="/" name="nav">
<!--do stuff-->
<xsl:if test="notEnd">
<xsl:call-template name="nav"></xsl:call-template>
</xsl:if>
</xsl:template>
The result it generates is top down (recursive):
<!--do stuff 5-->
<!--do stuff 4-->
<!--do stuff 3-->
<!--do stuff 2-->
<!--do stuff 1-->
The problem is after it generates the result, I need it to be in the correct order:
<!--do stuff 1-->
<!--do stuff 2-->
<!--do stuff 3-->
<!--do stuff 4-->
<!--do stuff 5-->
I am out of ideas on how to resort this after recursion? Should I use another template and implement apply-templates or is there a another way I can reverse the order?