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

RE: Accessing Variables while sorting

Subject: RE: Accessing Variables while sorting
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Tue, 8 Jan 2002 13:18:09 -0000
zbenjamin
<xsl:variable name="key" select="PatientList/SortDetails/SortField"/>
<xsl:for-each select="PatientList/Patient">
  <xsl:sort select="*[name()=$key]"/>

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Seema R
> Sent: 08 January 2002 12:18
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Accessing Variables while sorting
> 
> 
> Hi,
> 
> I have an XML that reads as 
> <PatientList>
> 	<SortDetails>
> 		<SortField>FirstName</SortField>
> 	</SortDetails>
> 	<Patient>
> 		<LastName>AAndrew</LastName>
> 		<FirstName>ZBenjamin</FirstName>
> 		<Gender>M</Gender>
> 		<Age>56</Age>
> 		<DOB>04-20-1945 </DOB>
> 		<PatientID>234-562-7890</PatientID>
> 	</Patient>
> </PatientList>
> 
> In the code below, how do i assign the value of SortField to 
> $Variable ?
> <xsl:for-each select="PatientList/Patient">
> 	<xsl:sort select="$Variable" order="ascending"></xsl:sort>
> 	   <tr> 
> 	       <td width="17%" height="30"><xsl:value-of 
> select="LastName"/></td>
> 		-----
> 
> Thanks in advance,
> Seema.
> 
>  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

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.