GNOME Bugzilla – Bug 600039
Incorrect Handling of Namespaces of Elements in Entities
Last modified: 2021-07-05 13:23:15 UTC
Created attachment 146508 [details] Simple test case for entity element namespace resolution Quick note: This is similar to bug #326605 (I think it is the same root problem), but it is much more general than just validation or just external entities, so it seemed more appropriate to make a new bug than expanding that one. If this is incorrect, please merge the bugs. In documents using XML namespaces, entities which contain elements (whether internal or external, regardless of prefixes used) will trigger warnings about missing namespace prefixes and will result in the elements inside the entities being expanded into the empty namespace. The expected behavior is for the element namespaces to be resolved at the time the entity is used. Without this behavior, the parent element in each entity must have its XML namespace declared in the entity, which is a bit of a pain. Note: This bug was mentioned on the mailing list back in 2004 <http://mail.gnome.org/archives/xml//2004-August/msg00085.html>, but I can't find a bug report that addresses it (other than #326605, mentioned above). I have attached a simple test case which demonstrates how an entity containing only <test_element /> results in test_element in the empty namespace, rather than the default namespace of its parent element. The test case also includes the error output from xsltproc as well as the expected output.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxml2/-/issues/ Thank you for your understanding and your help.