[xsl] Moving Specific content/element to the end of the output file

Subject: [xsl] Moving Specific content/element to the end of the output file
From: "Ramkumar" <ramkumar@xxxxxxxxxxxxxxxxxx>
Date: Tue, 6 Oct 2009 17:47:18 +0530
Hi List,

I am doing xml to html transformation using xslt v2.0 with saxon.

In my input xml file, element 'footnote' may come any where in my xml
structure. There is specific parent element for this, common root element is
'doc'. 

I will try to move all the footnotes to the end of the output file.

XSLT(Part of my xslt):
======================

<!--Match all the elements-->
<xsl:template match="/"><xsl:apply-templates/></xsl:template>

<!--To retain umnatched element-->
<xsl:template match="*">
		<xsl:copy>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
</xsl:template>

<!--Root Element-->
<xsl:template match="doc"><html><xsl:apply-templates/></html></xsl:template>

<!--Footnote-->
<xsl:template match="footnote"><sup><xsl:value-of
select="substring(@identifier,string-length(@identifier)"/></sup><xsl:text>
</xsl:text><xsl:apply-templates/></xsl:template>

Please suggest how to achieve my request.

Regards,
Ramkumar

Current Thread