Subject: [xsl] need to limit a For:each loop From: sales@xxxxxxxxxxxxxxxxxxxxxx Date: Thu, 5 May 2005 07:32:51 -0700 |
Hi, I'm totally new to XSL (didn't know it existed till yesterday!) i downloaded a RSS newsfeed script for my website and started to modify the design of it to suit my needs the current output can be seen here http://www.discountfirepagers.com/rss2/default.asp as you can see there are many articles ... I wish to limit the articles to just 5 items. however i can't figure how to modify the XSL to do that for me i know i have to break the for:each somehow or change it to a specified loop but can't find any info on how to do this can someone help please Here is the XSL http://www.discountfirepagers.com/rss2/news.xsl here is the XML http://news.search.yahoo.com/news/rss?p=fire%20department XSL <?xml version="1.0" ?> - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" /> - <xsl:template match="*"> - <table border="0" width="100%" bgcolor="#666666" align="center"> - <tr> - <td valign="top" bgcolor="white" class="headlines"> - <ul> - <xsl:for-each select="//*[local-name()='item']"> - <li> - <a> - <xsl:attribute name="href"> <xsl:value-of select="*[local-name()='link']" /> </xsl:attribute> - <xsl:attribute name="target"> <xsl:text>top</xsl:text> </xsl:attribute> - <font face="Verdana, Arial, Helvetica" color="#333333" size="0"> <xsl:value-of select="*[local-name()='title']" /> </font> </a> </li> </xsl:for-each> </ul> </td> </tr> </table> </xsl:template> - <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> </xsl:stylesheet>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSLT if sentence, David Carlisle | Thread | RE: [xsl] need to limit a For:each , Angel Gavin |
Re: [xsl] XSL - Transforming 2 XSL , Colin Paul Adams | Date | [xsl] XSL for WordML -> specific HT, Stephen |
Month |