Entities with out-of-scope namespaces are broken
Entities which reference out-of-scope namespace have always been broken, at least when building a DOM tree. The main complication is that there could be different namespaces in scope when expanding the entity again. For example:
<!DOCTYPE doc [
<!ENTITY ent "<ns:elem/>">
]>
<doc>
<decl1 xmlns:ns="urn:ns1">
&ent;
</decl1>
<decl2 xmlns:ns="urn:ns2">
&ent;
</decl2>
</doc>
Before 2.12, xmlParseBalancedChunkMemoryInternal tried to reuse the namespaces currently in scope but these namespaces weren't visible to xmlSearchNs called from the SAX handler. Version 2.12 emulates this broken behavior.
Edited by Nick Wellnhofer