Closed cmseaton42 closed 6 years ago
@cmseaton42 The parser and builder most likely work correctly. Your XML contains line breaks before and after the CDATA section which get encoded in different ways in JavaScript and XML (
is the XML encoding for \r
). Try this instead:
<Description><![CDATA[*]]></Description>
If you can't change the input XML, try the trim
(and maybe normalize
) options of the parser: https://github.com/Leonidas-from-XIV/node-xml2js/blob/master/README.md#options
I think this issue can be closed.
I ended up using a different module to handle this. The format that I am trying to parse is a superset of XML used be Rockwell Automation (".L5X")
The Issue
The following XML is being converted as follows.
Converted Object snippet below
I am attempting to write this back to another file and the cdata is being written as follows...
Why is this occurring? Is there an error in my script (see below)?