This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Accessing Variables while sorting
- From: "Seema R" <seema dot r at net-kraft dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Tue, 8 Jan 2002 18:32:07 +0530
- Subject: RE: [xsl] Accessing Variables while sorting
- Reply-to: xsl-list at lists dot mulberrytech dot com
Thanks ! Worked like a dream.
Would you please explain *[name()]
-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of
Jarno.Elovirta@nokia.com
Sent: Tuesday, January 08, 2002 6:22 PM
To: xsl-list@lists.mulberrytech.com
Subject: RE: [xsl] Accessing Variables while sorting
Hi
> 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>
You don't--use
<xsl:for-each select="PatientList/Patient">
<xsl:sort select="*[name() = ../../SortDetails/SortField]"
order="ascending"></xsl:sort>
<tr>
<td width="17%" height="30"><xsl:value-of select="LastName"/></td>
or
<xsl:variable name="Variable" select="PatientList/SortDetails/SortField"
/>
<xsl:for-each select="PatientList/Patient">
<xsl:sort select="*[name() = $Variable]" order="ascending"></xsl:sort>
<tr>
<td width="17%" height="30"><xsl:value-of select="LastName"/></td>
Santtu
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list