xsl:for-each Element

Applies a template repeatedly, applying it in turn to each node in a set.

<xsl:for-each
  select = expression>
</xsl:for-each>

Attributes

  • select
    [required] Expression evaluated on the current context to determine the set of nodes to iterate over.

Element Information

Number of occurrences Unlimited
Parent elements xsl:attribute, xsl:comment, xsl:copy, xsl:element, xsl:for-each, xsl:if, xsl:otherwise, xsl:param, xsl:processing-instruction, xsl:template, xsl:variable, xsl:when, xsl:with-param, output elements
Child elements xsl:apply-templates, xsl:attribute, xsl:call-template, xsl:choose, xsl:comment, xsl:copy, xsl:copy-of, xsl:element, xsl:for-each, xsl:if, xsl:processing-instruction, xsl:sort, xsl:text, xsl:value-of, xsl:variable, output elements

Remarks

The <xsl:for-each> element establishes the context for iteration; the XSLT transformation instructions within this loop are to be applied to the selected nodes. Each source element selected by <xsl:for-each> becomes a new context against which any pattern matching within the <xsl:for-each> occurs.

See Also

XSLT Elements | Creating and Populating an HTML Template

 Last updated on Saturday, April 10, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.