xsl-list
[Top] [All Lists]

Sort by Parameters-Child Nodes

2004-04-29 06:38:28
Hi!!
I have the following sample XSL which i'm trying to
modify for Sorting based on parameters .
I'm able to sort by DATE,TIME fields as seen below but
not PERSON/FNAME or PERSON/LNAME 
when i pass them as parameters . 
I'm pretty sure i'm missing something in "template
match" or "sort select" .Can anbody please point me 
in the right direction .

Thanks!!!

SAMPLE XML:

<ABC>
<DATE>2006-09-19T20:12:15</DATE>
<TIME>20:12:15</TIME>
<PERSON><FNAME>joe</FNAME><LNAME>joe</LNAME></PERSON>
</ABC>

SAMPLE XSL:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
xml:space="preserve">
<xsl:param name="pa"/>
<xsl:param name="pas"/>

<xsl:template match="/">

<xsl:for-each select = "//ABC">

<xsl:sort select="*[name()=$pa]"  order="{$pas}"/>
<xsl:value-of select="DATE"/>
<xsl:value-of select="TIME"/>
<xsl:value-of select="PERSON/LNAME"/>
<xsl:value-of select="PERSON/FNAME"/>
</xsl:for-each>

</xsl:template> 

</xsl:stylesheet>



        
                
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs  
http://hotjobs.sweepstakes.yahoo.com/careermakeover 


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