StylesheetHandler erroneously parses attributes in top-level elements in unknown namespaces as attribute value templates. It should ignore attribute values and allow the use of unbalanced attributes in them. It is clear from both XSLT 1.0 and 2.0 specifications that top-level elements in unknown namespaces should not cause an error as long as they are well-formed.
The patch against the CVS is in the attachment.
A test:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:my="my.namespace"
version="1.0">
<xsl:output method="xml"
version="1.0"
indent="no"/>
<xsl:template match="/">
<xsl:copy-of select="document('')//my:a"/>
</xsl:template>
<my:a>
<my:b c="{"/>
</my:a>
</xsl:stylesheet>
diff -uBb to make 4xslt process stylesheets with unknown top-level elements