xsl-list
[Top] [All Lists]

RE: [xsl] Isolate single result from sorted list

2007-06-25 17:00:31
I think you need to copy all future programs to a node-set, then sort
that node-set and select the one in position 1.

Something like this?

<xsl:variable name="futureprograms" select="//programme[(_at_)start >
$currentTime]"/>
<xsl:for-each select="$futureprograms">
        <xsl:sort select="@start"/>
        <xsl:if test="position() = 1">
                <xsl:copy-of select="."/>
        </xsl:if>
</xsl:for-each>

-----Original Message-----
From: Mike Wilt [mailto:mikewilt(_at_)gmail(_dot_)com] 
Sent: Tuesday, 26 June 2007 6:51 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Isolate single result from sorted list

Hi!

I would like to refresh a web page based on a list of "program start
times" contained in XML format.  I can select and sort the start
times, but I am having trouble isolating the *next* start time.  In
other words, XSLT formats a list of results (as one would expect) but
I need to identify a single result.

My code can be viewed here:

http://www.room117.com/sandbox/startTimes.txt

The output of my code can be viewed here:

http://www.room117.com/sandbox/startTimes.php

After scouring the web and searching the archives for this list, I
attempted many solutions but could not make any work---I am completely
stumped.  I will be eternally grateful if someone could suggest a
simple, straightforward solution.

Thanks in advance!

Mike

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




==============================================================================
The information contained in this email and any attachment is confidential and
may contain legally privileged or copyright material.   It is intended only for
the use of the addressee(s).  If you are not the intended recipient of this
email, you are not permitted to disseminate, distribute or copy this email or
any attachments.  If you have received this message in error, please notify the
sender immediately and delete this email from your system.  The ABC does not
represent or warrant that this transmission is secure or virus free.   Before
opening any attachment you should check for viruses.  The ABC's liability is
limited to resupplying any email and attachments
==============================================================================

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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