|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: sorting on elementnames
After cleaning up your child element tags (they are not closed, therefor your document is not XML), this template will do the trick:
<xsl:template match="/something">
<something>
<xsl:for-each select="*" >
<xsl:sort select="name()" order="ascending" data-type="text" />
<xsl:copy-of select="." />
</xsl:for-each>
</something>
</xsl:template>
--
Charles Knell
cknell@xxxxxxxxxx - email
-----Original Message-----
From: "marcel salathe" <ms7141@xxxxxx>
Sent: Fri, 26 Sep 2003 16:51:40 +0200 (MEST)
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: sorting on elementnames
Hello
A rather simple question: how can I sort on element names?
All sorting examples I've found sort on attribute values or element values,
but not on element names.
For example, I have
<something>
<a>
<b>
<b>
<a>
<b>
</something>
and I want to get
<something>
<a>
<a>
<b>
<b>
<b>
</something>
Thanks very much for help!
Regards,
Marcel
--
NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
Jetzt kostenlos anmelden unter http://www.gmx.net
+++ GMX - die erste Adresse für Mail, Message, More! +++
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








