RobG wrote:
<snip>
... . AFAIK (but I may well be wrong),
you can't get the doctype declaration which is
fundamental to validating the page.
On Mozilla and Opera (recent versions):-
document.doctype (object)
document.doctype.publicId (string)
document.doctype.systemId (string)
- could be used to re-produce it.
The other issues raised about the likely validity of a serialised DOM
makes doing so pointless in this context, but where a serialised DOM has
other uses it can be employed to make the results more complete (along
with maybe iterating the attributes collection of the documentElement in
order to supplement innerHTML with accurate HTML tags).
Richard.