preserving entities with lxml

Dieter Maurer dieter at handshake.de
Thu Jan 13 04:29:49 EST 2022


Robin Becker wrote at 2022-1-13 09:13 +0000:
>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 to expand the entities using ET.tostring so in some circumstances resolve_entities=False
>does work.

I think this is a misunderstanding: `tostring` will represent the text character `&` as `&`.


More information about the Python-list mailing list