xsl-list
[Top] [All Lists]

RE: Select first two elements

2006-01-14 05:52:23
mac(_dot_)rost(_at_)mchsi(_dot_)com wrote:

I have a friend that wants his last 2 posts from
an atom xml feed to show.

    <xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
        xmlns:a="http://purl.org/atom/ns#";
        version="1.0">

      <xsl:output method="text"/>

      <xsl:template match="/">
        <xsl:apply-templates
            select="a:feed/a:entry[position() &lt;= 2]"/>
      </xsl:template>

      <xsl:template match="a:entry">
        <xsl:value-of select="a:title"/>
        <xsl:text>&#10;</xsl:text>
      </xsl:template>

    </xsl:stylesheet>

--drkm




















        

        
                
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs 
exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



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