Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT Element

XSLT xsl:for-each Element


XSLT Element Reference Manual XSLT Element Reference Manual


Definition and Usage

xsl:for-each element loops through each node in a specified node set.


Syntax

property

property Value Description
select expression Required. An XPath expression that specifies the node set to be processed.

Example

The following example loops through each cd element and writes each cd to the output:

Example

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Try it »

The following example loops through each cd element and creates a table showing the title and artist of each cd:

Example

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Music Collection:

Title Artist

Try it »


XSLT Element Reference Manual XSLT Element Reference Manual