Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
toXmlAttributes escapes the incoming string. This is OK but it does not escape whitespace characters like the carriage return or linefeed. Since XML dictates all whitespace (such as a newline) be interpreted as a single blank space during reading—a string cannot be reversibly stored in XML with the xmltree module.
Attempting to escape the XML manually fails because the ampersands are consumed during escaping.
Nim Version
2.0.8
Current Output
No response
Expected Output
No response
Known Workarounds
It may be possible to break the XmlAttributes abstraction and inject the manually escaped string there. I have not tried.
Description
toXmlAttributes
escapes the incoming string. This is OK but it does not escape whitespace characters like the carriage return or linefeed. Since XML dictates all whitespace (such as a newline) be interpreted as a single blank space during reading—a string cannot be reversibly stored in XML with thexmltree
module.Attempting to escape the XML manually fails because the ampersands are consumed during escaping.
Nim Version
2.0.8
Current Output
No response
Expected Output
No response
Known Workarounds
It may be possible to break the
XmlAttributes
abstraction and inject the manually escaped string there. I have not tried.Additional Information