This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: last(): selecting the last one?



> Heppa,
> 
> > Hmmm.... No. Since the order of the result should be like 
> > above and then
> > find the latest concerning both date and time+ select it's 
> > topic element 
> > value. 
> 
> Yes, but *where* do you want to do that? Inside the template selection
> that generates that list, or outside? If it's the latter, then 

Yes the latter one in this case. And thanks, it works now =)

> 
> variable name="latest"
>   for-each select="message"
>     sort select="the xpath to sort the data"
>     sort select="the xpath to sort the time"
>     if test="position() = last()"
>        value-of select="topic"
> 
> will set the $latest variable to the value of the topic element of the
> latest message.
> 
> Cheers,
> 
> Santtu
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 



*******************************************************************
Jarkko Moilanen         *You are wise, witty, and wonderful,      *
Researcher/ ITCM        *but you spend too much time              *
jarkko.moilanen@uta.fi  *reading this sort of trash.              *
www.uta.fi/~jm60697     *                                         *
GSM: +358 50 3766 927   *                                         *
*******************************************************************
* ITCM Information Technology and Crisis Management               *
*******************************************************************

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]