jindw / xmldom

A PURE JS W3C Standard based(XML DOM Level2 CORE) DOMParser and XMLSerializer.
Other
816 stars 265 forks source link

Escaped Unicode codepoints in parsed input converted to character when serialized #234

Open agj opened 6 years ago

agj commented 6 years ago

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.

amitguptagwl commented 5 years ago

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

agj commented 5 years ago

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