This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: last(): selecting the last one?
- From: Jarno dot Elovirta at nokia dot com
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 22 Apr 2002 15:51:39 +0300
- Subject: RE: [xsl] last(): selecting the last one?
- Reply-to: xsl-list at lists dot mulberrytech dot com
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
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