apirnia
asked on
Get value from XML to ASP variable
In my ASP I request data with XML over HTTP post. The returned result is also in XML. Based on the returned value in my ASP I need to run different functions. However I cant get the value in to an ASP variable.
After I do HTTP Post I do the following:
Response.Write xml.responseText
Which then displays this on the scrren:
<?xml version="1.0" encoding="UTF-8" ?>
- <connector_ret>
- <function name="sql_get_int" id="iEmailExist">
<ret_val name="rv" type="integer">2076</ret_v al>
</function>
</connector_ret>
Now I want the integer "2076" that was returned in a variable.
So I can do:
If Myvalue = '' Then
RUN Function
Else
Run another function
End If
Thansk
After I do HTTP Post I do the following:
Response.Write xml.responseText
Which then displays this on the scrren:
<?xml version="1.0" encoding="UTF-8" ?>
- <connector_ret>
- <function name="sql_get_int" id="iEmailExist">
<ret_val name="rv" type="integer">2076</ret_v
</function>
</connector_ret>
Now I want the integer "2076" that was returned in a variable.
So I can do:
If Myvalue = '' Then
RUN Function
Else
Run another function
End If
Thansk
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Another (better) way to do this would be to load your XML into an actual XML object and get to the data programmatically using its built in functionality ...
ASKER
I think the secound way you mentioned is the way I should go, but I dont know how to do it. Is it by using the XML DOME Object?
VBScript:
Set objXMLDoc = CreateObject("Microsoft.XM LDOM")
For Reference:
http://devguru.com/technologies/xml_dom/15602.asp
Document.GetElementsByTagN ame Reference (should be handy):
http://devguru.com/technologies/xml_dom/15803.asp
Set objXMLDoc = CreateObject("Microsoft.XM
For Reference:
http://devguru.com/technologies/xml_dom/15602.asp
Document.GetElementsByTagN
http://devguru.com/technologies/xml_dom/15803.asp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.