Saxon gives this error message:
Error on line 21 of file:/c:/temp/test.xsl:
XTDE0410: Cannot create an attribute node after creating a child of the containing element
XSLT 1.0 processors are allowed to ignore this error and "recover" by ignoring the xsl:attribute instruction. I expect you are using such a processor.
What's wrong is this:
<TD class="sCatName">
Today events
<xsl:attribute name="onclick">__Goto...;</xsl:attribute>
</TD>
where you create the child element of the TD before creating its attribute.
Incidentally, I would have spotted this far earlier if you had taken the trouble to lay out your code more neatly.
This becomes a hard error in XSLT 2.0 that all processors must report. Saxon actually detects this particular instance at compile time.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference