Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Function to limit nodes? (using xslt to format xml from rss feed) Function to limit nodes? (using xslt to format xml from rss feed)To: NULL Date: 5/17/2008 1:02:00 PM I've just started using xslt, and it seems straightforward enough (for
now!). I am using a simple xsl template to format and display news
items from an rss news feed:
<xsl:template match="rss">
<xsl:apply-templates select="channel"/>
</xsl:template>
<xsl:template match="channel">
<xsl:apply-templates select="item"/>
</xsl:template>
<xsl:template match="item">
<dt>
<a href="/"><xsl:value-of select="title"/></a>
</dt>
<dd>
<ul>
<li>
<a><xsl:attribute name="href"><xsl:value-of
select="link"/></xsl:attribute>
<xsl:value-of select="description"/>
</a>
</li>
</ul>
</dd>
</xsl:template>
However, in another section of the site I'm building, I would like to
display only the four or so most recent items of the rss feed, rather
than the whole lot.
Can anyone tell me how to do this using xslt functions? As you will
see, at the moment my knowledge is limited to applying a blanket
template to every item.
Any help would be very much appreciated.
Many thanks,
Robin
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
