xmlserializer
xmlserializer copied to clipboard
xmlserializer serializes a DOM subtree or DOM document into XML/XHTML
Some documents will cause the parser to throw a stack overflow exception (`Maximum call stack exceeded`). This can be avoided by making the code-non recursive.
Based on how `serializeNamespace` was implemented already it seems that xml is supported quite nicely already. This PR adds some functionality and tests to allow prefixing of xml node names...
I'm looking for something that follows the spec browsers use so that I can use it in jsdom. Any thoughts on adding a mode that follows that algorithm more exactly?
Yo! I've got some problems with namespaces on Firefox (v45.9.0). Some of them were not recognized, some prefixes were stripped, ... such things. So I've forked and enhanced your code...
There is an implementation of XMLSerializer in the xmldom package: https://github.com/jindw/xmldom/blob/master/dom.js
Tag names including colons result in invalid XML if translated 1:1. Example: http://www.theguardian.com/uk