how to read xml node value

N

.nLL

hi everyone i am trying to read a nodes ( i dont know if i am right by
calling it node. see sample) value with asp.
xml page is very simple :

<?xml version="1.0" ?> <response success="true" > </response>

my code is this

Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET",
"http://xml.my.net/tokencheck.asp?t="&token&"&u="&userid&"", False
xmlhttp.send()
Set xmlhttp=Nothing

how can i add xmldom and parse the result page so i can assign response's
value to a variable?

thanks
 
M

Martin Honnen

..nLL said:
<?xml version="1.0" ?> <response success="true" > </response>

my code is this

Set xmlhttp = CreateObject("Microsoft.XMLHTTP")
xmlhttp.Open "GET",
"http://xml.my.net/tokencheck.asp?t="&token&"&u="&userid&"", False
xmlhttp.send()
Set xmlhttp=Nothing

how can i add xmldom and parse the result page so i can assign response's
value to a variable?

After the send call you can try to read the status and then access
responseXML e.g.
xmlhttp.send
If xmlhttp.status = 200 Then
Set XmlDoc = xmlhttp.responseXML
If XmlDoc.parseError.errorCode = 0 Then
Response.Write XmlDoc.documentElement.getAttribute("success")
Else
' handle XML parse error here
End If
Else
' handle HTTP status here
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top