var serializer = new XMLSerializer( );
var str = serializer.serializeToString( document.documentElement );
var pretty = XML( str ).toXMLString( );As mentioned in my earlier post about XMLSerializer, the XML you get isn't perfect: element names come out ALL CAPS for some weird reason. And you get a bunch of automatic entity substitutions, most of which you probably want, others of which will simply break things if you try to deserialize the text back into a DOM later. (Forget about easy roundtripping.) But overall, it's a really useful trick.
I was hoping maybe this trick would also (as a free bonus) pretty-format any embedded scripts inside CDATA sections, but of course no such luck. In fact, due to automatic entity substitution, <![CDATA[ gets converted to <![CDATA[, which is hilarious in a sad kind of way.
This comment has been removed by a blog administrator.
ReplyDelete
ReplyDeleteWow actually i loved your blog man..Thanks for sharing awesome content..
videoder
Online notepad++
psiphon pro
ReplyDeleteHi after reading your blog I have finally found some knowledge which
I was looking for so long for that reason Thanks..
Facetime ios app
192.168.1.1 login ip
facetime app apk