Wrox Home  
Search P2P Archive for: Go

  Return to Index  

xml thread: Re: ResponseText vs ResponseXML


Message #1 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 5 Jun 2001 16:58:07
For info in case anyone else encounters this problem, I've finally got to 
the bottom of it.

It seems that even though my component does 

response.contentType = "text/xml"

(and I do do it before writing anything else ;-)

this line must actually be in the ASP that calls the component.  If it is, 
then responseXML works properly.  If not, then it works sometimes, and not 
other times.  Very strange behaviour indeed, but this does seem to have 
fixed it.

> Brian (or anyone else..),
> 
> You may remember my post of last week in which I had a problem with
> character encoding over xmlhttp, in that if I set the character 
> encoding
> manually, the resulting XML could not be loaded into a DOM.  Your 
> suggestion
> was to use responseXML rather than responseText to get the XML out of 
> the
> xmlhttp object, which did fix that particular problem.
> 
> However, this seems to have had a very puzzling side effect:  The first 
> time
> I hit the button or whatever to make it send and receive data to the 
> server
> it works.  However, if I do it again without refreshing the page, 
> nothing is
> returned from the server.  Or rather it is, because everything's OK on 
> the
> server side, it just doesn't make it to the client, responseXML is 
> empty for
> some reason.  So I've had to revert back to using responseText, which 
> worked
> fine except that I can't change the character encoding, so when someone
> called Chlo=EB or Ren=E9e comes along and enters their name, the whole 
> thing's
> going to fall over...
> 
> Any ideas what could be causing this or how I can get round it?
> 
> Thanks,
> 
> Alex
>

  Return to Index