Best way of dealing with empty attributes
Hi, we often have the case where element attributes may turn out to be None. This leads to an error in lxml when creating an Element, or serialising it in ElementTree. Is it possible to configure the behaviour is such situations? Either to ignore the attribute or just create it with no value? Charlie -- Charlie Clark Managing Director Clark Consulting & Research German Office Kronenstr. 27a Düsseldorf D- 40217 Tel: +49-211-600-3657 Mobile: +49-178-782-6226
Charlie Clark schrieb am 24.09.2014 um 11:45:
we often have the case where element attributes may turn out to be None. This leads to an error in lxml when creating an Element, or serialising it in ElementTree. Is it possible to configure the behaviour is such situations? Either to ignore the attribute or just create it with no value?
No, not currently. And not sure there should be. (And if so, how.) How do you create them? **kwargs? attrib dict? And where do the values come from in the first place? Stefan
participants (2)
-
Charlie Clark -
Stefan Behnel