Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reading XML differences between MSXML2.XMLHTTP.6.0 and 3.0

Status
Not open for further replies.

stirfry

Programmer
Mar 4, 2001
26
IE
Olaf was very helpful with a good description on using MSXML2.XMLHTTP.6.0 & MSXML2.XMLHTTP.3.0 in thread
Code:
Try
   oXML = CreateObject("MSXML2.XMLHTTP.6.0")
Catch
   oXML = CreateObject("MSXML2.XMLHTTP.3.0")
Endtry

however when I have tried to implement it I have got stuck on reading the xml
when I use this re ver 3 it works:
oXML= oHTTP.responseXML
lQualifier=oxml.getElementsByTagName("Qualifier").item(0).text
but in ver 6 it errors with
'Member ITEM does not evaluate to an object'.

While I can resolve this with:
lResponseText =oHTTP.responseText
lQualifier=STREXTRACT(lResponseText,"Qualifier","/Qualifier")
I would prefer to use the xml method

stirfry
 
Well, then I have to revert that statement "in regard to XPATH and the XMLDOM object the compatibility is given"
Then there are more differences than you like.

'Member ITEM does not evaluate to an object' may also simply mean the xml differs in not having that item or you don't wait for the parsing into DOM to be finished. Are you waiting for document ready state?

Bye, Olaf.

 
Thanks Olaf

I check for the TRANSFORM(ohttp.status) is '200'
The xml that is sent back is always the same format.
It is quite small, only about 10 elements.
The routine has worked well for me for over 10 years, however a client had a problem with it at the beginning of this year, I suspect it was to do with 'ActiveX' safety settings. So I was keen to try "MSXML2.XMLHTTP.6.0"
My knowledge re XML is pretty poor, perhaps I might be better off putting the question to the XML forum.

Thanks for your help
Stirfry
 
document ready status has nothing to do with http status. xml must be parsed to the DOM model, before you can use DOM methods like getElementsByTagName()

In other words ResponseXML only is set after receiving ResponseText AND after parsing the XML into the DOM (object model).

There may be a difference here in doing so and in timings.

Bye, Olaf.
 
MSXML6 parsing may just be more strict.

What do you get from
? ResponseXML.validate.errorCode
? ResponseXML.validate.reason

Bye, Olaf.
 
Thanks Olaf

I think you have cracked it.

? ResponseXML.validate.errorCode = -1.0728E+9
& ? ResponseXML.validate.reason
"The node is neither valid nor invalid because no DTD/Schema declaration was found"

So either use
lQualifier=STREXTRACT(lResponseText,"Qualifier","/Qualifier")
or
go and beef up my XML skills big time.

Stirfry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top