Re: preserving entities with lxml

2022-01-13 Thread Robin Becker
On 13/01/2022 09:29, Dieter Maurer wrote: Robin Becker wrote at 2022-1-13 09:13 +: On 12/01/2022 20:49, Dieter Maurer wrote: ... Apparently, the `resolve_entities=False` was not effective: otherwise, your tree content should have more structure (especially some entity reference children).

Re: preserving entities with lxml

2022-01-13 Thread Dieter Maurer
Robin Becker wrote at 2022-1-13 09:13 +: >On 12/01/2022 20:49, Dieter Maurer wrote: > ... >> Apparently, the `resolve_entities=False` was not effective: otherwise, >> your tree content should have more structure (especially some >> entity reference children). >> >except that the tree knows not

Re: preserving entities with lxml

2022-01-13 Thread Robin Becker
On 12/01/2022 20:49, Dieter Maurer wrote: ... when run I see this $ python tmp/tlp.py using tostring xxml=b'a &mysym; < & > ! A' ET.tostring(tree)=b'a &mysym; < & > ! A' using attributes tree.text='a &mysym; < & > ! A' tree.getchildren(

Re: preserving entities with lxml

2022-01-12 Thread Dieter Maurer
Robin Becker wrote at 2022-1-12 10:22 +: >I have a puzzle over how lxml & entities should be 'preserved' code below >illustrates. To preserve I change & --> & >in the source and add resolve_entities=False to the parser definition. The >escaping means we only have one kind of >entity & which m

preserving entities with lxml

2022-01-12 Thread Robin Becker
I have a puzzle over how lxml & entities should be 'preserved' code below illustrates. To preserve I change & --> & in the source and add resolve_entities=False to the parser definition. The escaping means we only have one kind of entity & which means lxml will preserve it. For whatever reason lx