Parsing prototype AJAX.response XML in IE
- by adam
Hi
I have an xml webservice which I'm fetching using PrototypeJS. The xml has the correct content type and is well-formed, and looks like this:
<GetTokenResponse xmlns="http://tempuri.org/">
<GetTokenResult>F655100D64F098F0AC33AFF414A4A0D5</GetTokenResult>
</GetTokenResponse>
The AJAX request is completing successfully, and I can access the GetTokenResult node in both IE and FF but can only get the text content of the node in FF. My code is below:
node = transport.responseXML.documentElement.getElementsByTagName('GetTokenResult')[0];
rawToken = (document.all) ? node.innerText : node.textContent;
I've tried innerText and innerHTML, as well as children[0] and a few other chance guesses but IE returns 'undefined' when I access rawToken.
Anyone able to lend a hand? Thanks, Adam