So I am writing an XSLT transform to parse an XML file into HTML. For a while, everything was going well. However, I've run into a problem. Basically, doesn't seem to follow the order I would expect.
In the transform there is some code that looks like this.
<xsl:template match="/"
<html>
<head></head>
<body>
<h1>Summary</h1>
<table>
<xsl:apply-templates select="theItem"/>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="theItem"/>
<tr><td>Column1</td><td>Column2</td></tr>
</xsl:template>
What I would expect that to do is build a table, and fill in a row for each match to the template.
What it does instead is open and close the table, then put all the rows after. Something like this.
<table></table>
<tr>
<td>
Column1
</td>
<td>
Column2
</td>
</tr>
<tr>
<td>
Column1
</td>
<td>
Column2
</td>
</tr>
So what the heck is happening? I'm not sure if it matters, but I used msxsl to do the transform. I also tried embedding the transform in the data and opening it in IE. Creates the same issue. I can't see any way this would be the intended behavior, but maybe there's someting I'm missing.
EDIT
Note that I can wrap the template application in any number of tags of any type, and they all open and close before any of the template information is shown.