I think I know the answer to this, but I just want confirmation I'm understanding this correctly.
When an XSLT template matches and executes, the children of the current node (the node current having a matching template executed) are not processed by default. You must call "apply-templates" to get the processor to traverse down into the child nodes of the current (matched) node.
Consider this XML:
<person>
<firstName>Deane</firstName>
<lastName>Barker</lastName>
</person>
During the transform, the XSLT processor starts at the "person" element. If it finds a template for that, it will execute it, but then will not descend into the "firstName" and "lastName" elements to look for templates for those. It will only do this if "apply-templates" is explicitly called in the template for "person".
Consider this XSL:
<!-- Template #1 -->
<xsl:template match="person">
I found a "person" element
</xsl:template>
<!-- Template #2 -->
<xsl:template match="firstName">
I found a "firstName" element
</xsl:template>
In this case, Template #2 will not be run, correct? The traversal of the XML document will hit the "person" element, find Template #1, execute it, then never descend into the children of "person."
If I change the first template to this --
<!-- Template #1 -->
<xsl:template match="person">
I found a "person" element
<xsl:apply-templates select="firstName"/>
</xsl:template>
Only then will Template #2 run. Am I understanding this correctly?