Link to home
Start Free TrialLog in
Avatar of immtrac
immtrac

asked on

XML data into comma seperated string

I call a web service and get following XML (see code).

I need to know how do I convert the data into:

7369, 8834

In other words, If I get results, I need to convert result into comma separated string so that I can pass it to query string in URL



- <NewDataSet>
- <Table>
  <ext_user_id>7369</ext_user_id> 
  </Table>
- <Table>
  <ext_user_id>8834</ext_user_id> 
  </Table>
  </NewDataSet>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of apresto
apresto
Flag of Italy 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
Avatar of immtrac
immtrac

ASKER

Thanks for your reply. When I call web service  I don't know if I get 10 ids, 100 ids or nothing.

So I can not  hard code the XML.

Also is there way that we can use split() function?
I was only hardcoding the xml for demonstration purposes, all you need to do is put the string returned by the webservice into it. This method will work for 10 or 100 nodes in an xml string.
Why would you want to use split, the XmlDocument class is there for a reason, lol
Avatar of immtrac

ASKER

What I am getting is 8834,8834

While is should be 7369,8834.
Avatar of immtrac

ASKER

Never mind. I got it.

Thanks for ur help