XSL Processing Order

aarikan

New Member
I've had trouble finding an exact, and simple, answer to this question on SO or elsewhere:In XSL files, how can you tell which template will be processed first, second, etc? I read that it was ordered by how specific the XPath was. Additionally, is there a difference in XSL 1.0 vs. 2.0?Finally, here is a flawed XSL file I am toying with. Currently the output is just the title "Table of Contents". I'll attach the XML here as well. \[code\]<xsl:template match="/"> <h1> <xsl:text>Table of Contents</xsl:text> </h1></xsl:template><xsl:template match="heading1"> <h2> <xsl:value-of select="."/> </h2></xsl:template><p> <xsl:text>This document contains </xsl:text> <xsl:value-of select="count(/article/body/heading1)"/> <xsl:text> chapters. </xsl:text></p>\[/code\]and the XML:\[code\]<article><title> Creating output</title><body> <heading1>Generating text</heading1> <heading1>Numbering things</heading1> <heading1>Formatting numbers</heading1> <heading1>Copying nodes from the input document to the output</heading1> <heading1>Handling whitespace</heading1></body> \[/code\]Any explanation as to why all the content isn't being displayed? Thank you for your help!
 
Back
Top