Subject:Recursion Help Author:James Durning Date:24 Aug 2006 04:14 PM
Warning, this forum trims spaces.
Inside your main template, get all the 1st level elements
<xsl:template match="/DocumentElement">
<root>
<xsl:apply-templates select="work_order[not(PARENT_KEY)]"/>
</root>
</xsl:template>
Then inside each of those elements, get all of the children elements like so:
<xsl:template match="work_order">
<xsl:variable name="id" select="UNIQUE_KEY"/>
<xsl:apply-templates select="/DocumentElement/work_order[PARENT_KEY = $id]"/>
</xsl:template>
Fill in your output details inside these 2 templates.
Hope this helps.