vb.net - how do I use the xmlreader.create with a string rather than a file

I have a string that contains a xml file and want to read this with xml reader - the xmlreader.create command seems to want a file path?
If there a way to read the string into the xmlreader?.
donhannamAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
käµfm³d 👽Connect With a Mentor Commented:
Try:

Dim xml As String = "<root><somechild><somegrandchild></somegrandchild></somechild></root>"
Dim sReader As New System.IO.StringReader(xml)
Dim xReader As System.Xml.XmlReader = System.Xml.XmlReader.Create(sReader)

Open in new window

0
 
donhannamAuthor Commented:
Thanks that was what I as after
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.