I am trying to remotely retrieve an XML document using XMLHTTP (in ASP), and then parse out a particular tag. The problem I am running into is that Internet Explorer seems to want to parse the XML document on its own.
For example, the following code:
Set HttpReq = Server.CreateObject("Micro
soft.XMLHT
TP")
url = "
http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=PubMed&report=medline&mode=xml&id=15088295"
HttpReq.Open "GET", url, False, username, password
HttpReq.Send
buffer = HttpReq.responseText
Set HttpReq = Nothing
I then simply want to print out what is in the buffer:
Response.Write buffer
However, internet explorer is interpreting it as an XML document and processing it on it's own. Is there anyway to have the browser just treat is as a regular HTML document?
The reason I want to do it this way, is I get an error message back from Internet Explorer "An invalid character was found in text content. Error processing resource "
This is interesting because by typing the URL above directly into your browser, it displays fine. But using the code above, it generates this error message. (It is being tripped specifically on the Affiliation tag, when it comes the the letter 'e' with the accent over it).
Any idea what is going on? Or how to instruct Internet Explorer to handle the data as pure text, not XML??
Thanks very much.
When doing the parse with XMLDOM, I set the validateOnParse parameter to false, and then it doesn't complain about invalid characters.
This seems to be a work-around for my original problem, so I would still appreciate any suggestions on a better way to do this.