Re: [xsl] generic sorting problem

Subject: Re: [xsl] generic sorting problem
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Tue, 06 Sep 2005 21:56:09 +0200
Hi,

Tempore 21:21:50, die 09/06/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit peter willard donisthorpe <paytur@xxxxxxxxxxx>:

I need to sort the children of the root element by _their_ first child.

I suggest you try this for a starters:


<xsl:template match="/*">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:for-each select="*">
			<xsl:sort select="*[1]"/>
			<xsl:copy-of select="."/>
		</xsl:for-each>
	</xsl:copy>
</xsl:template>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
B+NN= N?N/N4N1 OON9 N?ON4N-N= N?N/N4N1B;  - N#O	N:ON1ON7O

Current Thread