jindw/xmldom

Escaped Unicode codepoints in parsed input converted to character when serialized

agj opened this issue · 2 comments

agj commented

I have the following occurring to me:

new xmldom.XMLSerializer().serializeToString(new xmldom.DOMParser().parseFromString('<node>&#x0009;</node>'))
// Returns:  '<node>\t</node>'
// Expected: '<node>&#x0009;</node>'

I believe that this occurs during serialization. Is this intended behavior? If so, how can I make it output escaped characters instead?

Thanks much.

This project is not active anymore. You can try fast-xml-parser instead

agj commented

Thank you, @amitguptagwl. I don't even quite remember what I was trying to use this for anymore, but your recommendation is duly noted. 😅