Name
<xsl:apply-templates>
Synopsis
<xsl:apply-templates [select=”node-set-expression“] [mode=”mode“]/>
This specifies that the immediate children (default) or the selected nodes of the source element should be processed further. For example:
<xsl:template match="section">
<B><xsl:apply-templates/><B>
</xsl:template>This example processes the children of the selected
section element after applying a bold tag. The
optional select attribute determines which nodes
should be processed:
<xsl:template match="section">
<HR>
<xsl:apply-templates
select="paragraph (@indent)//sidebar"/>
<HR>
<xsl:apply-templates
select="paragraph (@indent)/quote"/>
<HR>
</xsl:template>This example processes only specific children of the selected
section element. In this case, the first target
is a sidebar element that is a descendant of a
paragraph element that has defined an
indent attribute. The second target is a
quote element that is the direct child of a
paragraph element that has defined an
indent attribute. The optional
mode attribute causes only templates with a
matching mode to be applied.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access