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!

XMLHTTP to XMLDOM

Status
Not open for further replies.

rhull

Programmer
May 23, 2001
46
US
Basically after an XML file is retrieved from a server using XMLHTTP how can I convert that to a XMLDOM so I can serach through nodes?

<script language=&quot;VBScript&quot;>
dim session
dim http
dim xmlDoc
set http=createObject(&quot;Microsoft.xmlhttp&quot;)
set xmlDoc=createObject(&quot;Microsoft.XMLDOM&quot;)
http.open &quot;GET&quot;,&quot;http.setRequestHeader &quot;Content-Type&quot;,&quot;text/xml&quot;
http.send

xmlDoc.loadXML(http.responseXML)????

session = xmlDoc.selectSingleNode(&quot;session&quot;)???

</script>

THanks for any help offered!
 
Just load the response into an XML data island using
XMLDataIsland.load(XMLHTTPObject.ResponseXML).

Put an empty XML Data island on your page like
<XML id=&quot;anyid&quot; javadsocompatible=&quot;true&quot;><?XML>
Then parse it usinf the document.anyid.XMLDocument object.
 
I did what you recommended but I kept getting a &quot;object required error&quot;.
DO i need to specify the source in the XML data Island that refers to the XMLHTTP?
I cant find any documentation on XMLDataIsland.load( never seen it before)
Also what does this refer to <javadsocompatible=&quot;true&quot;>?
-R
 
Instead of this line:
xmlDoc.loadXML(http.responseXML)????

try
xmlDoc = http.responseXML

Hope this helps.

Jonathan
j.w.george@virginnet.co.uk

Working against: Visual Basic 6, Access 97, Visual Interdev 6, VBScript, JavaScript, Active Server Pages, SQL Server, Oracle 7, XML
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top