<xsl:for-each> Loops

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XSLT Developer's Guide

<xsl:for-each> Loops

The <xsl:for-each> element establishes the context for iteration. The XSLT transformation instructions within the for-each loop are applied to each of the nodes selected by the select attribute of the <xsl:for-each> element. Each source element selected by <xsl:for-each> becomes a new context against which operations declared within the <xsl:for-each> are performed.

Example

<xsl:for-each select="//book">
   <tr>
      <td>
         <xsl:value-of select="author"/>
      </td>
      <td>
         <xsl:value-of select="title"/>
      </td>
   </tr>
</xsl:for-each>

See Also

xsl:for-each Element