node-xml2js
node-xml2js copied to clipboard
Error: Invalid character in string: at index 0
I have a control character in my XML and the builder seems to error on it.
The character is just a value in an attribute, the XML is otherwise valid.
In my case it is this character: which is ASCII character 5 "Enquiry".
Should the builder not remove these? All control characters except LF and CR aren't really wanted in text content.
I’m having the same issue and I’d like the same solution: just get rid of invalid characters. I’m talking to the author of the library on which this one is based over here: https://github.com/oozcitak/xmlbuilder-js/issues/147#issuecomment-604031768
The author of xmlbuilder
included a new option called invalidCharReplacement
to address this issue. It’s in the version 15.1.0 of the xmlbuilder
package. Unfortunately, we can’t use it yet because xml2js
require version 11.
@Leonidas-from-XIV, would you be okay with updating xmlbuilder
?
@Leonidas-from-XIV Would love support for this! Getting bitten by this problem very often
when will this update for xml2js come out?
Any update on this? (updating xmlbuilder to the newer version)