I typed this code, there's an error at the first line - the for-each tag is accidentally closed there.
<xsl:for-each select="./qualifier='author']" />
<xsl:value-of select="./node()"/><xsl:text>, </xsl:text>
</xsl:for-each>
That threw the following exception (line 443 is the third line here with the closing tag):
org.xml.sax.SAXParseException: The element type "xsl:if" must be terminated by the matching end-tag "</xsl:if>".
context:/jndi:/localhost/themes/abc/def.xsl - 443:23
The Exception talks about xsl:if, while this really was an xsl:for-each.
Maybe just this exception message needs to be fixed, maybe this points to some other underlying problem or maybe this is really nothing. I'm not really sure if this is a bug but I thought I'll report it anyway.
I was using XSL 1.0 in Apache Cocoon in DSpace, version is probably customized cocoon-core 2.2.0.
On a second look, xsl:if was the parent tag of xsl:for-each, so this message was telling me that I should have closed <xsl:if> with </xsl:if> when it encountered unexpected </xsl:for-each>.
It would make the exception message more helpful if it also said '...but it was terminated with end-tag "<xsl:for-each>" instead.' I know it's redundant to say so becuse when I look at the file position indicated I should see the problem, but I didn't. This would be more helpful.