I wonder why the serialization behaves that way. It does not make sense to me. If a user has the need to escape XML, it should be thorough, shouldn't it?

On Mon, Sep 9, 2019 at 10:47 PM Liam R. E. Quin <liam@fromoldbooks.org> wrote:
On Mon, 2019-09-09 at 15:04 +0200, Andreas Mixich wrote:
> when serializing a string, that contains literal XML with entities,
> how do I pass through those entities unchanged?

One way is to use a character map, as Bridger Dyson-Smith described.

Sometimes another way can be to have a version of the DTD in which the
replacement text of the entity marks the presence of the entity, e.g.
<!ENTITY eacute "&#38;eacute;">
but this will affect full-text searching of course.

Liam

--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Webslave for old illustrations  http://www.fromoldbooks.org/



--
Minden jót, all the best, Alles Gute,
Andreas Mixich