[Previous slide] [Next slide] Moving to XML

Incorporating Syndication [ii]: Sample code

<!-- sidebar sections: show title and top eight entries -->
  <xsl:template match="rss">
    <h2>
      <xsl:apply-templates select="channel/title" />
    </h2>
    <xsl:for-each select="channel/item">
      <xsl:if test="9 > position()">
    <p>
      <a>
        <xsl:attribute name="href"><xsl:value-of 
          select="link"/> 
        </xsl:attribute>
        <xsl:apply-templates select="title" />
      </a>
    </p>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>
Sample XSL code Moreover Internet Europe headlines, processed with this XSL 22nd May 2001