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

Sorting works with String literal but not with variabl

Subject: Sorting works with String literal but not with variable
From: "Tengshe, Ashish" <Tengshe.Ashish@xxxxxxxxxxxxx>
Date: Thu, 8 Aug 2002 09:48:18 -0500
datadirect string literal
I want to sort the following XML Dynamically:
<CustomerList>
	<Customer>
		<FName>John</FName>
		<LName>Doe</LName>
		<Age>26</Age>
		<Phone>515-248-5025</Phone>
	</Customer>
	<Customer>
		<FName>Josh</FName>
		<LName>Ratliff</LName>
		<Age>24</Age>
		<Phone>515-909-0909</Phone>
	</Customer>
	<sortBy>Age</sortBy>                             //This is the element I use for determing the sort 
</CustomerList>
		
This is working for me
				<xsl:apply-templates select="/CustomerList/Customer">
		 			<xsl:sort select="Age" />
		 		</xsl:apply-templates>	 	 
But this is not:

				<xsl:variable name="sortvar">
		 			<xsl:value-of select="//sortBy"/>
		 		</xsl:variable>
		 		
		 		<xsl:apply-templates select="/CustomerList/Customer">
		 			<xsl:sort select="$sortvar" />
		 		</xsl:apply-templates>	 	 

Any issues with using sort like this, I tried putting an XPath directly in select of sort but still doesn't do the trick.
Thanks!

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


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.