[objectify] namespace handling in child element attribute access

Hi, just noticed that namespace handling in child element access does not work correctly (any more) if the parent element is in no-namespace:
As root lives in no-namespace root.x should return the second, no-namespace x child element. This worked correctly up to ~2.0 (based on libxml 2.6.27) and stopped working for ~2.1.5 (libxml 2.6.32), judging from the versions I have tried. Funny that we never noticed it up to now. Not too much insane namespace mixing going on here, obviously ;-)
Btw this works correctly if the parent element is in a namespace, which is the case the documentation shows (and doctests). Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart

Holger Joukl, 18.12.2012 18:04:
Thanks for the report and the test case, here's a fix: https://github.com/lxml/lxml/commit/c0858cd3ea4a9d1bef6418a45f9841e3f1154641 It sets the requested namespace to the empty string instead of NULL to indicate that only the empty namespace should be matched and not any namespace.
Yes, quite impressive. I guess it's just a really rare case that namespaced tags are being mixed with namespaced tags in the same document. Given how long this went undetected, it won't pass as a simple bug fix anymore, so I'll keep it for lxml 3.1. Stefan

Hi, lxml-bounces@lxml.de schrieb am 18.12.2012 23:50:10:
Thanks for the report and the test case, here's a fix:
https://github.com/lxml/lxml/commit/c0858cd3ea4a9d1bef6418a45f9841e3f1154641
It sets the requested namespace to the empty string instead of NULL to indicate that only the empty namespace should be matched and not
anynamespace. Thanks, lightning-quick as ever.
Given how long this went undetected, it won't pass as a simple bug fix anymore, so I'll keep it for lxml 3.1.
Fine. If I ever needed this earlier I wouldn't hesitate to use a devel lxml, anyway. Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart

Holger Joukl, 18.12.2012 18:04:
Thanks for the report and the test case, here's a fix: https://github.com/lxml/lxml/commit/c0858cd3ea4a9d1bef6418a45f9841e3f1154641 It sets the requested namespace to the empty string instead of NULL to indicate that only the empty namespace should be matched and not any namespace.
Yes, quite impressive. I guess it's just a really rare case that namespaced tags are being mixed with namespaced tags in the same document. Given how long this went undetected, it won't pass as a simple bug fix anymore, so I'll keep it for lxml 3.1. Stefan

Hi, lxml-bounces@lxml.de schrieb am 18.12.2012 23:50:10:
Thanks for the report and the test case, here's a fix:
https://github.com/lxml/lxml/commit/c0858cd3ea4a9d1bef6418a45f9841e3f1154641
It sets the requested namespace to the empty string instead of NULL to indicate that only the empty namespace should be matched and not
anynamespace. Thanks, lightning-quick as ever.
Given how long this went undetected, it won't pass as a simple bug fix anymore, so I'll keep it for lxml 3.1.
Fine. If I ever needed this earlier I wouldn't hesitate to use a devel lxml, anyway. Holger Landesbank Baden-Wuerttemberg Anstalt des oeffentlichen Rechts Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz HRA 12704 Amtsgericht Stuttgart
participants (2)
-
Holger Joukl
-
Stefan Behnel