You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When producing XML using WriteTo a set of strings.Replacer objects in etree.go are used to escape strings.
However, these replacers fail to replace some characters that are not valid in XML (e.g. 0xB vertical tab).
This leads to invalid XML being produced.
The go standard package xml replaces invalid characters with \uFFFD (unicode replacement character) which appears to be common practice across other XML libraries.
I propose using xml.EscapeText instead of the current approach based on strings.NewReplacer(...).
The text was updated successfully, but these errors were encountered:
The valid character range for XML is specified as:
When producing XML using
WriteTo
a set ofstrings.Replacer
objects in etree.go are used to escape strings.However, these replacers fail to replace some characters that are not valid in XML (e.g.
0xB
vertical tab).This leads to invalid XML being produced.
The go standard package
xml
replaces invalid characters with\uFFFD
(unicode replacement character) which appears to be common practice across other XML libraries.I propose using
xml.EscapeText
instead of the current approach based onstrings.NewReplacer(...)
.The text was updated successfully, but these errors were encountered: