Parsing XML String

luckky300

New Member
Joined
Jul 17, 2010
Messages
3
i am just trying to get the value of "accountid" from the following XML string:

Code:
[SIZE=2]<S< font>[FONT=Times New Roman][SIZE=2][FONT=Times New Roman][SIZE=2]<SF< font>[/SIZE][/FONT][/SIZE][SIZE=2]SFResponse><ERROR>false</ERROR><VALUE><ID>[/SIZE][FONT=Times New Roman][SIZE=2][FONT=Times New Roman][SIZE=2]xxxxx[/SIZE][/FONT][/SIZE][/FONT][SIZE=2]-0b67-4512-8781-9d950468fa23</ID><NAME>test <A href="mailto:testupload0004xxxxx-04c0-41b7-b669-921dae80dd7atestupload0004@google.comFalseFalseTrueM/d/yyFalseTrue<SFResponse">testupload0004</NAME><ACCOUNTID>[/SIZE][FONT=Times New Roman][SIZE=2][FONT=Times New Roman][SIZE=2]xxxxx[/SIZE][/FONT][/SIZE][/FONT][SIZE=2]-04c0-41b7-b669-921dae80dd7a</ACCOUNTID>[/SIZE]
[SIZE=2]testupload0004@[/SIZE][FONT=Times New Roman][SIZE=2][FONT=Times New Roman][SIZE=2]google[/SIZE][/FONT][/SIZE][/FONT][SIZE=2].com</PRIMARYEMAIL><COMPANY></COMPANY><ACCOUNTEMPLOYEE>False</ACCOUNTEMPLOYEE><ACCOUNTADMIN>False</ACCOUNTADMIN><CANRESETPASSWORD>True</CANRESETPASSWORD><DATEFORMAT>M/d/yy</DATEFORMAT><REQUIREDOWNLOADLOGIN>False</REQUIREDOWNLOADLOGIN><CANVIEWMYSETTINGS>TrueS<S< CANVIEWMYSETTINGS></VALUE></S< font>[FONT=Times New Roman][SIZE=2][FONT=Times New Roman][SIZE=2]F[/SIZE][/FONT][/SIZE][/FONT][SIZE=2]Response>[/SIZE]
[/SIZE][/FONT]


I have got this far and can actually get the above XML String

Code:
    'Create User
    xURL = "[URL]https://frog.Lizard.com/rest/users.aspx?op=create&authid[/URL]=" & authid1 & "&firstname=" & firstname & "&lastname=" & lastname & "&email=" & EMail & "&isemployee=false&password=Roger123&fmt=xml"
 
    ' Create an XMLHTTP object and add some error trapping
    On Error Resume Next
    Set sHttp = CreateObject("MSXML2.XMLHTTP")
    If Err.Number <> 0 Then
        Set sHttp = CreateObject("MSXML.XMLHTTPRequest")
        MsgBox "Error 0 has occured while creating a MSXML.XMLHTTPRequest object"
    End If
    On Error GoTo 0
    If sHttp Is Nothing Then
        MsgBox "For some reason I wasn't able to make a MSXML2.XMLHTTP object create user"
        Exit Sub
    End If
 
    sHttp.Open "GET", xURL, False
    sHttp.send
userid = sHttp.responseText

The return listed above does not return with the normal header code and I am not sure if that is my problem

<?xml version="1.0" encoding="UTF-8" ?>


I have been stuck on this for several hours and cannot grasp the parse function. Thanks in advance.

[/SIZE]
 
Last edited:

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

Forum statistics

Threads
1,224,598
Messages
6,179,818
Members
452,946
Latest member
JoseDavid

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top