First of all, thanks to both of you for the helpful and quick replies.
Evertjan wrote:
>It seems you want to use viewsource to copy the xml?
>Why not use serverside javascript,
bypassing your cross-browser problem of doing this,
so just returning a complete xml document to the client?
This would be exactly what I first tried to do. Alas, as you have
probably guessed, my skills are at a beginner level and all I did
manage to do was merely a work-around to my initial intention.
How would I do this, if I may ask??
Thomas 'PointedEars' Lahn wrote:
Don't. *One document.write() call is enough, more efficient, and less
error-prone.
Thank you for the suggestion — why is that so? Anyhow, I used several
of them merely because some of them are just conditional. Maybe I
should create a variable in which to store all the text to write and
join all the bunches I have there. Then use a document.write()
instance to write the joined variable. Would that be cleaner?
* document.open("text/xml");
might help. *Saving it as .xml instead of .html might help, too.
Hmm... alas it didn't help, by trying it I effectively get an unparsed
document (while, not specifying it, the xml opened was still rendered
as HTML by the browser, even though it was not showing it in the
source code until download attempt). However, trying to save it, gives
me an html document formed as such:
<html><body><h2>Filename missing</h2></body></html>
Merely saving it as a .xml (as I hoped would work as part of the above-
mentioned work-around I not so wittingly devised) doesn't work either.
On a side note, Safari apparently doesn't see any source code in
Javascript generated windows... is it just me?
You have not provided enough information for an educated guess.
The FAQ is currently broken, but it stands to reason that you should at
least post the relevant lines of your source code.
Sorry if I didn't give any deeper information; posting specifically
the source code I am working on would be impossible, as it works in
tandem with a whole other code.
Anyhow, reproducing this bug is for me very simple; try it out with
this example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
function test() {
new_window=window.open();
newdocument=new_window.document;
newdocument.write("Where is the source for this text,
Safari?");
newdocument.close();
}
</script>
</head>
<body>
<input type="button" value="Open" onclick="test()" />
</body>
</html>
Thank you very much again, I highly appreciate your support.
Regards,
L.