Open
Description
Hello! I'm aware this is a pretty old library, but libxml2
deletes all my namespaces. So xml.el
it is, and your xml-to-string
seems to still be the discerning connoisseur's way to re-serialise it.
However I've discovered a bug - xml-to-string
doesn't encode entities.
(let ((expected-output "<xml title=\"&\">&</xml>"))
(xml-to-string
(with-temp-buffer
(insert expected-output)
(xml-parse-region
(point-min)
(point-max)))))
The fix is to use the function (xml-escape-string )
when writing CDATA and attribute values.
Metadata
Metadata
Assignees
Labels
No labels