Subject: RE: [xsl] sorting on elementnames From: cknell@xxxxxxxxxx Date: Fri, 26 Sep 2003 11:18:00 -0400 |
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: [xsl] 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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] [Fwd: Unwanted xmlns attr, Dinesh Gurram | Thread | [xsl] Expression expected in variab, Kathy Burke |
Re: [xsl] Text Table with sorting, Ryan Sawatzky | Date | [xsl] Expression expected in variab, Kathy Burke |
Month |