Sean Wegele via .NET 247 wrote:
I would like to get from
Xml.XMLDomDoc to a IO.MemoryStream
Here is a VB.NET example that loads an XML document into an DOM
XmlDocument, then saves it to a memory stream and then reloads from the
memory stream to show that it works:
Imports System
Imports System.IO
Imports System.Xml
Public Class Test20040514
Public Shared Sub Main (CmdArgs() As String)
Dim XmlDocument1 As XmlDocument
XmlDocument1 = New XmlDocument()
XmlDocument1.Load("test20040514.xml")
Console.WriteLine(XmlDocument1.OuterXml)
Dim MemStream As MemoryStream
MemStream = New MemoryStream()
XmlDocument1.Save(MemStream)
Dim XmlDocument2 As New XmlDocument()
MemStream.Position = 0
XmlDocument2.Load(MemStream)
Console.WriteLine(XmlDocument2.OuterXml)
End Sub
End Class
So all you need is the Save method and then pass in a MemoryStream to
that method
--
Martin Honnen
http://JavaScript.FAQTs.com/