how to read xml node value
am 11.02.2007 18:26:48 von noone
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 :
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
Re: how to read xml node value
am 13.02.2007 15:56:37 von Martin Honnen
..nLL wrote:
>
>
> 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
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/