A
almurph
Hi everyone,
Hope you can help me. I'm converting an XMlDocuemnt object to a
string. I use the following code:
Dim doc As New XmlDocument
'Convert XmlDocument object -> String
Dim ms As New System.IO.MemoryStream
Dim xtw As XmlTextWriter = New XmlTextWriter(ms, Encoding.UTF8)
doc.Save(xtw)
Dim bytes() As Byte = ms.ToArray()
Dim st As String = Encoding.UTF8.GetString(bytes)
Only problem is though - when I debug the code it inserts a little
unusual character at the start of the xml string. It looks like a
little box in the "yellow" window and when I print it it looks lioke a
little dot. This strange character is making hte XML invalid.
Anyone with any ideas/suggestions/comments/code-snipets that can help.
Would greatly appreciate any assistance - I'm at my wits end.
Al.
The confused!
Hope you can help me. I'm converting an XMlDocuemnt object to a
string. I use the following code:
Dim doc As New XmlDocument
'Convert XmlDocument object -> String
Dim ms As New System.IO.MemoryStream
Dim xtw As XmlTextWriter = New XmlTextWriter(ms, Encoding.UTF8)
doc.Save(xtw)
Dim bytes() As Byte = ms.ToArray()
Dim st As String = Encoding.UTF8.GetString(bytes)
Only problem is though - when I debug the code it inserts a little
unusual character at the start of the xml string. It looks like a
little box in the "yellow" window and when I print it it looks lioke a
little dot. This strange character is making hte XML invalid.
Anyone with any ideas/suggestions/comments/code-snipets that can help.
Would greatly appreciate any assistance - I'm at my wits end.
Al.
The confused!