[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: generic sort based on attribute names

Subject: RE: generic sort based on attribute names
From: "Chaitanya Desai" <cdesai@xxxxxxxxxxx>
Date: Tue, 25 Jan 2005 12:48:58 -0800
sorting names in c
OK, 
This is the recursive stylesheet I have, to handle a generic XML. 
How does the thing you explained with the 'e' fit here. 

xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:template match="*">

        <xsl:copy>

            <xsl:for-each select="@*">

                <xsl:sort select="name(.)"/>

                <xsl:attribute name="{name(.)}">

                    <xsl:value-of select="."/>

                </xsl:attribute>

            </xsl:for-each>

           

            <xsl:apply-templates>

                <!-- the select for this sort needs to be the concatenated 			name-value pairs of all the attributes sorted 					in alphabetical order -->
			
		<xsl:sort select="name(.)"/>

            </xsl:apply-templates>

        </xsl:copy>

    </xsl:template>

</xsl:stylesheet>

 


-----Original Message-----
From: Joris Gillis [mailto:roac@xxxxxxxxxx] 
Sent: Tuesday, January 25, 2005 12:14 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  generic sort based on attribute names

Tempore 21:09:23, die 01/25/2005 AD, hinc in  
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Chaitanya Desai  
<cdesai@xxxxxxxxxxx>:

> I want this to be generic.
> The tag/attribute names are not known. The 'e' was just part of the  
> example.
'e' is jsut a random name. It can be everything; it's not related to  
elements residing in the input file who also happen to be named 'e'.

regards,
-- 
Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041)
"CB&CB9CB;CB.CB:CB?CB?CB= CB5CB9CB=CB1CB9 CB<CB1CB;CB;CB?CB= CB7 Cb CB9CB;CECB;CB1CB;CB?CB="  -  
CE!CB;CB5CECB2CB?Cb&CB;CB?Cb

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
--~--

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.