If the name attribute of the xsl:namespace instruction is supplied as an attribute value template, the supplied expression is not type-checked. This can have a number of adverse consequences. If the expression delivers a value of the wrong type, or a value that needs atomization, then it is possible that a ClassCastException will be thrown. If the expression contains the only reference to a local variable, then the optimizer will wrongly decide that the variable is unused, and remove the variable binding from the expression tree, leading to the error "*** Internal Saxon error: local variable encountered whose binding has been deleted"
A patch is being committed to Subversion in the 9.2 branch. Affects module NamespaceConstructor.java.