An _____ instruction do contains the template, which is been applied to each node selected with the select attribute.
-
xsl:for
-
xsl:for-each
-
xsl:do-while
-
xsl:while
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.