First off, YES, this is for IE and IE only. NO, I cannot deviate from that. I am working on a corporate intranet application and I have no say whatsoever about the client browser; thus, it is IE (and IE 6, at that).
Now, the gist of what I'm trying to do is this: the application houses several XML data islands, and at times I need to present them to the user for viewing. I do this using an iframe so that I can leverage the built-in XML document handling features (expand/collapse nodes, coloring, etc). Currently, I have to send the XML to the server, then have the browser set the SRC of the iframe to request that XML; once that XML is sent back to the iframe the job is done, as the iframe then displays the prettified XML document.
What I'm trying to avoid is the round-trip of sending the XML to the server then back to the client. I'm also trying to avoid iterating the entire XML data structure, which could be inefficient and error-prone. I also would like to avoid serializing the XML to transfer it to the iframe, as that has potential to be a large performance hit.
So, given the following:
<html>
<body>
<xml id="theXml">
<foo>bar</foo>
</xml>
<iframe id="theFrame"></iframe>
</body>
</html>
...is there an easy/efficient method to have "theFrame" display the XML data island (prettified)?