xsl-list
[Top] [All Lists]

Re: Limiting the number of RSS-items shown in result tree using xslt

2004-10-11 03:35:15
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


| Perhaps something like this:
| <xsl:for-each select='/item[position() &lt; 11 and not(category='A')]'>
|     <xsl:sort select='date:format-date(pubDate,"ssmmHHDD")'/>
|     <xsl:if test='position() < 4>
|         <!-- include -->
|     </xsl:if>
| </xsl:for-each>
|
| I also noticed that in your example, the rss feed is already sorted
| descending by date, can you rely on that? If so, you could use
| position() again to get the latest elements.
i.e. just leave out xsl:sort in the template above.



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Cygwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBamHjqjaicDyx8o8RAs+PAJ4zyRFBtIXiC/pOFKKmu+AnudHc+wCeLgOL
mXX0wgCodoAaE9fvmbH5kzM=
=Y/2O
-----END PGP SIGNATURE-----


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