Processing Child Nodes

You use the <xsl:apply-templates> element to tell the XSLT processor it should process any matching templates for child nodes of the context node. The <xsl:apply-templates> element enables you to indicate exactly when the processing of child nodes should be finished, and that’s crucial if you want to insert their data into the HTML table at the correct point.

One important point often causes confusion: The <xsl:apply-templates> element applies templates to only the child nodes of the context or selected node or node set, by default. That seems innocuous enough, but what many people forget is that attributes are not considered child nodes of elements, and for that matter, neither are namespace declarations. That means you ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.