This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Accessing Variables while sorting
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 8 Jan 2002 13:18:09 -0000
- Subject: RE: [xsl] Accessing Variables while sorting
- Reply-to: xsl-list at lists dot mulberrytech dot com
<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@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Seema R
> Sent: 08 January 2002 12:18
> To: xsl-list@lists.mulberrytech.com
> Subject: [xsl] 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