Paulconsulting
asked on
Limit number of Rows returned in XSLT Loop
I'm using XSLT to style the data in an RSS Feed and I want to limit the number of rows returned:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xmlns:atom10="http://www.w3.org/2005/Atom">
<xsl:output method="html" encoding="utf-8"/>
<xsl:template match="/">
<img src="{rss/channel/image/url}" />
<br />
<xsl:for-each select="rss/channel/item">
<a href="{rss/channel/item/feedburner:origLink}"><xsl:value-of select="title"/></a> <br />
<xsl:value-of select="description" disable-output-escaping="yes"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
I'm sorry, the experts-exchange's text editor replaced a '& lt;' with a '<',
see the code snippet below, hope it will remain as is
see the code snippet below, hope it will remain as is
select="rss/channel/item[position()<4]"
ASKER
That kinda works, but <4 just returns 2 results - I have to do <7 to return 5 rows :~
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Your right, I missed one of the rows
ASKER
Thanks :)
select="rss/channel/item[p