[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Dr. Volker Jaenisch
Hi Holger! To motivate the problem. We are dealign with lots of XML files from different origins. Debugging becomes a great hassle if you are not able e.g. in your PyCharm IDE to navigate the XML tree your parser a currently processing. Even worse if some nodes do not seem to even exist. Do

[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Holger.Joukl
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 a

[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Holger.Joukl
Hi Volker, > > The reason for this is that obviously > > {http://www.isotc211.org/2005/gco}CharacterString is not a valid Python > > identifier and it makes sense > > to restrict unqualified lookup to children from the same namespace. > I like to disagree on > > and it makes sense > > to restr

[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Dr. Volker Jaenisch
Dear Charlie! Am 01.03.22 um 16:16 schrieb Charlie Clark: On 1 Mar 2022, at 16:06, Dr. Volker Jaenisch wrote: Other namespace based python libs like for instance RDFlib solve this problem generically by adding the namespace to the python property. Given how central namespaces are to XML and

[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Charlie Clark
On 1 Mar 2022, at 16:06, Dr. Volker Jaenisch wrote: > Other namespace based python libs like for instance RDFlib solve this problem > generically by adding the namespace to the python property. Given how central namespaces are to XML and how often conflicts can occur with abbreviations and pref

[lxml] Re: python lxml.objectify gives no attribute access to gco:CharacterString node

2022-03-01 Thread Dr. Volker Jaenisch
Hi Holger! Thank you very much for the fast response. Am 28.02.22 um 08:41 schrieb holger.jo...@lbbw.de: The reason for this is that obviously {http://www.isotc211.org/2005/gco}CharacterString is not a valid Python identifier and it makes sense to restrict unqualified lookup to children from