Closed Thread Icon

Topic awaiting preservation: Accessing XML in an IE iframe (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=9009" title="Pages that link to Topic awaiting preservation: Accessing XML in an IE iframe (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Accessing XML in an IE iframe <span class="small">(Page 1 of 1)</span>\

 
amnon
Nervous Wreck (II) Inmate

From: Boulder, Colorado, USA
Insane since: Feb 2004

posted posted 02-05-2004 21:09

I have a page with a form and a hidden iframe.

The hidden iframe is the target of the form.

The result of the form submission is XML, meaning that when submission is done the hidden iframe has XML in it.

I have put an onload on the iframe tag that gets called when the submission is successful (on Gecko and IE) and also when the submission is not successful (IE only), for example if the network connection broke.

I have 2 questions:
1. Since the onload gets called in the case of error on IE, I can determine if it was successful or not. How do I do that on a Gecko browser?
2. On Gecko (in case of success) the iframe document is an XMLDocument, so I can walk its DOM etc. On IE the iframe document is an HTML representation of the XML document, with HTML tags, javascript, +/- controls for expansion, etc. But, when I ask IE to view the source from the pull down menu it gives me the desired XML. How do I access the XML from JavaScript on IE?

Thanks very much for any help.




___________________________
Amnon I. Govrin
Senior Software Engineer
Mercury Interactive

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-05-2004 21:29

Amnon: Welcome.
My super quick reply is to direct you to Peter-Paul Koch's Import XML Document article and suggest you to either generate an XML file on the server or to build it on client-side thanks to the datas providing by the form.

amnon
Nervous Wreck (II) Inmate

From: Boulder, Colorado, USA
Insane since: Feb 2004

posted posted 02-05-2004 22:12

Thanks, but we already do that.

We are trying to move to submitting a form to a hidden iframe via POST to get over the 1KB/4KB limit in GET / URL loading.

Thanks,
Amnon

___________________________
Amnon I. Govrin
Senior Software Engineer
Mercury Interactive

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-06-2004 02:44

Right, it should be a piece of cake to save the XML datas sent in POST into a temporary file and use it on client side in the IFRAME. If you have some troubles with the format of the XML file you could even check its validity on server side ( PHP can do that easily ) to avoid any trouble the cross browser compatibility.

amnon
Nervous Wreck (II) Inmate

From: Boulder, Colorado, USA
Insane since: Feb 2004

posted posted 02-06-2004 16:26

I'll explain myself better:
We want to submit a form to a hidden iframe. What comes back from the server is an XML.

The questions I had:
1. How do we know when the request failed on Gecko browsers since the onload isn't getting called?
2. How do I access the XML in the iframe on IE? All I got to was the HTML rendering of the XML.

poi, you didn't really answer my questions.

How can you create a file from JavaScript anyway?

Please help if you can.

Thanks!

___________________________
Amnon I. Govrin
Senior Software Engineer
Mercury Interactive

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 02-07-2004 08:46

amnon: When I talked to save the XML datas in a temporary file on the server I obviously meant to do that with a server side language like PHP. That's typically the kind of thing beyond the capabilities of JavaScript.

1. In fact you could use the onerror event of the body tag to detect a problem in Gecko, and eventually reload the frame and/or notice the problem to the end user.
2. AFAIK you can't manipulate a raw XML file from another frame. To manipulate it, you must load it via the methods described in PPK's article. Sorry.

Now, I wonder why you want to load a raw XML file in a frame while there's some methods to load/alter/XSLT them in JavaScript.

Last but not least, in IE you can also use a DATA ISLAND and perform some XSLT.

Hope that helps.

« BackwardsOnwards »

Show Forum Drop Down Menu