How can I save the content of an XDocument object as it is without parsing the hexadecimal references to a file
Is there a way to have an XDocument object save its content and keeps the hexadecimal reference开发者_如何学运维s as they are without parsing them?
Thank you for any help.
No, that's not possible as an XDocument doesn't contain any hexadecimal references. The values are strings, so the characters are not kept as encoded XML entities.
When you load an XML document, the entities are decoded when the values are turned into strings. The strings only contains the characters, there is no information about how they once where encoded. So, it's not possible to encode the characters the same way they were before they were decoded, as that information doesn't exist in the XDocument.
精彩评论