Multiple choice technology programming languages

An _____ instruction do contains the template, which is been applied to each node selected with the select attribute.

  1. xsl:for

  2. xsl:for-each

  3. xsl:do-while

  4. xsl:while

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

xsl:for-each is an XSLT instruction that processes a set of nodes selected by an XPath expression. It iterates over each node in the node-set and applies the contained template instructions to every node. The select attribute contains the XPath expression that identifies which nodes to process. This is the primary looping construct in XSLT for transforming XML documents. Options A, C, and D are not valid XSLT elements - the correct names are xsl:for-each, xsl:if, and xsl:choose/xsl:when/xsl:otherwise respectively.