xsl-list
[Top] [All Lists]

RE: Fwd: Parameterised Sorts

2003-12-10 05:30:12
If you have an element <e att="3"> then the name of the attribute node
(as returned by the local-name() function) is "att", not "@att".

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
chris(_at_)fabalou(_dot_)com
Sent: 10 December 2003 11:20
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Fwd: Parameterised Sorts


Hi folks,

I'm fairly new to xsl but I have looked everywhere to the 
answer to my problem 
with no joy.  Perhaps someone can help?

I have a table that I need to allow the sort order to be 
changeable on so I 
have implemented a parameter based sort like so:

<xsl:apply-templates select="teams/group">
   <xsl:sort select="*[local-name()=string($sortRequested)]" 
order="{$sortOrderRequested}"/>
</xsl:apply-templates>

If $sortRequested = 'name' and name is a node below group it 
works OK. If $sortRequested = '@name' and name is an 
attribute of group it dosn't work.

What am I doing wrong?
Thanks for any help.
Chris




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



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



<Prev in Thread] Current Thread [Next in Thread>