Link to home
Start Free TrialLog in
Avatar of jimseiwert
jimseiwertFlag for United States of America

asked on

XML String

Just seeing if someone has a better method out there. I am currently receiving an xml string back in my web app.  I was looking for a way to convert that xml string into something more usable that i can parse through on the fly and go through each one of the elements.

I am using vb.net

Thanks
ASKER CERTIFIED SOLUTION
Avatar of ozoid
ozoid
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
Avatar of jimseiwert

ASKER

Is there a way to do this without passing a file? I am trying to avoid creating a file just to read it and then delete it. I have the xml string already in memory?

Also can you provide an example of how you read your above example.

Thanks,
Jim
I dont need the example, I understand your method. Thanks,

If you can think of a way i can do this without loading a file.
SOLUTION
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
I am getting the following message when it gets to the .load - Illegal characters in path.  , any thoughts ?

 I tried to pass it a file and a xml string
Have you got a properly formatted xml document
you may need to add
<?xml version="1.0" encoding="utf-8"?>
to the beginning of the string to ensure the XMLDocument object knows whats happening..

the LoadXml function should take a string - exactly what would be the contents of the file..

Hey i was able to read the xml, it was my error. I did not change it to loadxml.

Any idea using your method how to read subtags?
Hi
To read child tags - check the node hasChildNodes then use another for next loop and more select case statements.

     If xrn.HasChildNodes Then
                xnl = xrn.ChildNodes
                For l As Integer = 0 To  xnl.Count - 1