How to prevent LXML from writing & instead of just &?

Viewed 36

I'm aware of the fact that the proper XML encoding for '&' is & but there is an attribute in the XML documents I work with that needs to remain '&' and not be converted to &.

In particular I need the HTML symbols for characters ' and " to be written as HTML symbols because they have to be properly rendered in the browser in some searches involving the XML docs.

When I do el.set('lemma', '"') or el.set('lemma', '''), however, the resulting document has:

lemma=""" 

How do I prevent this from happening?

0 Answers
Related