View Full Version : Ie equivalent to XMLSerialize?

03-26-2003, 09:27 PM
I've got a wonder about whether there's any IE method to do the same as you do with this code in moz:

var xmlDoc=(new XMLSerializer).serializeToString(document);

What I want here, is to get the entire, parsed, document tree, including xml declaration, xml-stylesheets, comments, doctype. You can use document.documentElement.outerHTML to get the html content, but you can't get the things before the html element that way. You can use document.all(index) to get the xml declaration, xml-stylesheets and comments. You can't get the doctype, however. Is there a way to get the doctype, at all, from a parsed document in ie?

Also, XMLSerialize used that way sometimes throw a URI error. Do you have any idea why it would do that?

03-27-2003, 12:32 AM
To answer my own post, I found out there existed a nice and easy way of getting it...

var i=0,source=[];

There - now I just wonder how to do the same in op7 and saf/konq.

// Liorean, posting his 100th post on CF