XSLT Reverse Order Templates Using Application Templates or Calling Patterns?
I am writing a transform for a nodeset 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 from top to bottom (recursive):
<!--do stuff 5-->
<!--do stuff 4-->
<!--do stuff 3-->
<!--do stuff 2-->
<!--do stuff 1-->
The problem is that it generates a 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'm out of ideas on how to resort to this after recursion? Should I use a different template and embed the app templates or is there some other way that I can change the order?
+1
a source to share
2 answers