Link to home
Start Free TrialLog in
Avatar of apirnia
apirniaFlag for United States of America

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_val>
  </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
Avatar of dfu23
dfu23

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dfu23
dfu23

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 ...
Avatar of apirnia

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.XMLDOM")

For Reference:
http://devguru.com/technologies/xml_dom/15602.asp

Document.GetElementsByTagName Reference (should be handy):
http://devguru.com/technologies/xml_dom/15803.asp
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial