When the xsl:copy or xsl:copy-of instructions use the type or validation attributes, the result type of the instruction is inferred incorrectly. This may result in spurious type errors being reported at compile time or at run time, or it may result in exceptions such as a ClassCastException due to run-time type conversions not being done when they are needed.
A parallel bug has been raised against the XSLT 2.0 spec because the effect of these instructions when the selected node is not an element or attribute node is unclear in the specification. The patch for this bug makes guesses about the best rules for these situations. However, this bug also arises when the node is an element or attribute, for example with validation="strip" - it incorrectly infers that the result type is the same as the type of the supplied node.
A patch is being raised on the Saxon 9.2 branch. The new code is fairly extensive and has not yet been thoroughly tested; however it appears to cause no regression to existing tests.