In XSLT, when the type (or xsl:type) attribute is used on an element in a stylesheet, and the type name is unprefixed, the code that evaluates the type name overwrites the element name of the parent stylesheet element in the stylesheet tree.
This problem was noticed during code inspection, and I have not been able to find a test case that demonstrates any adverse effect. With literal result elements (xsl:type) the name of the element has already been copied to a location that is not corrupted. With XSLT instructions, the only likely effect of changing the name is on diagnostics produced after the corruption occurs. Nevertheless the code is clearly wrong and dangerous, so I am issuing a patch that fixes it for the 9.1 and 9.2 branches. Affects method getSchemaType() in class net.sf.saxon.StyleElement.