Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Streamreader to XML

Status
Not open for further replies.

qberta01

Programmer
Nov 14, 2005
113
Hello,

I am working with some code that returns a string. I would like the return value to be in XML so i can easily use XMLDoc in the main page:

Dim responseStream As System.IO.Stream = webResponse.GetResponseStream()

Dim responseEncoding As System.Text.Encoding = System.Text.Encoding.UTF8

' Pipes the response stream to a higher level stream reader with the required encoding format.

Dim responseReader As New StreamReader(responseStream, responseEncoding)

Dim responseContent As String = responseReader.ReadToEnd()
Return responseContent

----------------

Any help is greatly appreciated.

Q.
 
How about replacing the return line by these?
[tt] [red]'[/red]Return responseContent
Dim doc As XmlDocument=new XmlDocument()
Return doc.LoadXml(responseContent)
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top