I
Iain
Hello. I'm new to the XML lark, I've got a script to display some RSS feeds
on my ASP pages, but I can't work out how to just display the first three...
My XSL stylesheet looks like this... can anyone give me a tip as to how to
stop the for loop after 3 records?
TIA.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<xsl:for-each select="//*[local-name()='item']">
<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>
<xsl:value-of select="*[local-name()='title']"/>
</a><br/>
<xsl:value-of select="*[local-name()='description']"
disable-output-escaping="yes"/>
<br /><br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>
on my ASP pages, but I can't work out how to just display the first three...
My XSL stylesheet looks like this... can anyone give me a tip as to how to
stop the for loop after 3 records?
TIA.
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xslutput method="xml" omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="*">
<xsl:for-each select="//*[local-name()='item']">
<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>
<xsl:value-of select="*[local-name()='title']"/>
</a><br/>
<xsl:value-of select="*[local-name()='description']"
disable-output-escaping="yes"/>
<br /><br/>
</xsl:for-each>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
</xsl:stylesheet>