Is it possible via any configuration option to tell JavaScript's XMLSerializer
not to collapse empty tags into self-closing tags? I'm feeding an xml string into the xml parser then reserializing it after making modifications to the tree, but where I have an explicit closing tag in the input, this is collapsed to a self-closing tag in the output which is causing problems.
If you don't have jquery available and only wanted to go via xmlserialzer way, you can also use npm package 'xmldom'.
var serializer = require('xmldom').XMLSerializer;
var str = serializer.serializeToString('your node');
It takes care of self closing tags(eg. script tags). NPM xmldom Works fine in IE11.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With