xsl-list
[Top] [All Lists]

Re: Sort by Parameters-Child Nodes

2004-04-29 07:02:23

not PERSON/FNAME or PERSON/LNAME 
when i pass them as parameters . 

passing in a param (or using a variable generally) is just like using a
string in that position.

You have

<xsl:sort select="*[name()=$pa]"

<xsl:sort select="*[name()='DATE']"

works because * selects all child elements, and teh [] filters out the
date.


<xsl:sort select="*[name()='PERSON/FNAME']"

doesn't work as there is no child element with that name, what you want
is


<xsl:sort select="*/*[name()='FNAME']"

ie select a grandchild with name 'FNAME'


so


<xsl:sort select="(*|*/*)[name()=$pa]"  order="{$pas}"/>

should work if you pass in pa='FNAME' or pa='DATE' as it selects either
children or grandchildren with the specified name.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


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