xsl-list
[Top] [All Lists]

Re: sorting on attributes.

2002-10-23 08:39:49
Hi Shree,
Try
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="text" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:for-each select="name/@*">
<xsl:sort order="ascending" select="name()" data-type="text"/>
<xsl:value-of select="name()"/><xsl:text>=</xsl:text><xsl:value-of
select="."/>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
HTH
Vasu
----- Original Message -----
From: <shreekumar_veeramani(_at_)freddiemac(_dot_)com>
To: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Wednesday, October 23, 2002 4:31 PM
Subject: [xsl] sorting on attributes.



is there a way to sort on the attributes of an element.


example :

<name lastname="shr" firstname="kum" age="26" address="40 port">

output:

name
     address = 40 port
     age = 26
     firstname = kum
     lastname = shr


Shree


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>