Hi,

> I think the logic should be:
> If lxml find one matching child by property name then this is the correct 
> answer. If no or more than one child matches not action is taken.

I take it you mean namespace-unqualified property name here?
This is not desirable behavior in my book.

> Matching against the parent namespace is IMHO in no case correct. Matching 
> against a default namespace if would be a better option.

Again, I have a different opinion here: Matching against the parent namespace 
for child lookup is
exactly the right thing to do (TM). :-)

> > Still, your suggestion for a namespace-free lookup looks like it could be 
> > very useful.

Well, you can always do s.th. like

>>> from lxml import etree, objectify
>>> root = objectify.fromstring('<root 
>>> xmlns:otherns="/other/namespace"><otherns:x>1</otherns:x><x>2</x></root>')
>>> list(root.iterchildren('{*}x'))
[1, 2]

(works with other iterators too, or you could use XPaths (maybe even compiled) 
with local-name())

I must say I'm pretty fundamentally opposed to the suggestion, FWIW.

So -1 from me.

Best,
Holger






Landesbank Baden-Wuerttemberg
Anstalt des oeffentlichen Rechts
Hauptsitze: Stuttgart, Karlsruhe, Mannheim, Mainz
HRA 12704
Amtsgericht Stuttgart
HRA 4356, HRA 104 440
Amtsgericht Mannheim
HRA 40687
Amtsgericht Mainz

Die LBBW verarbeitet gemaess Erfordernissen der DSGVO Ihre personenbezogenen 
Daten.
Informationen finden Sie unter https://www.lbbw.de/datenschutz.
_______________________________________________
lxml - The Python XML Toolkit mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/lxml.python.org/
Member address: [email protected]

Reply via email to