The xsl:for-each instruction should nullify the current
template, so that xsl:apply-imports should fail within
xsl:for-each. This doesn't happen.
This is actually documented in the Saxon user
documentation but is nevertheless a nonconformance with
XSLT 1.0 and should be treated as a bug.
Test case added: error035
Applies to 6.5.2, 7.2, and all earlier releases.