Stream to XML

  • Thread starter Thread starter Janne
  • Start date Start date
J

Janne

I have a Stream-object with a serialized Xml-Object.

How do I load an XmlDocument with the data from the
Stream-object?

I have tried the code below but it won't work.

Try 1.
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(myStream);

Try 2.
XmlTextReader myXmlTextReader = new XmlTextReader
(myStream);
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(myXmlTextReader);
 
Hi Janne,
Janne said:
I have a Stream-object with a serialized Xml-Object.

How do I load an XmlDocument with the data from the
Stream-object?

I have tried the code below but it won't work.

Try 1.
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(myStream);

Try 2.
XmlTextReader myXmlTextReader = new XmlTextReader
(myStream);
XmlDocument myXmlDoc = new XmlDocument();
myXmlDoc.Load(myXmlTextReader);

What's the indication that it isn't working?

Regards,
Dan
 
My stream object holds the data but when i try to load my
Xml-document I receive nothing. The Xml-document is empty.

Janne
 
Back
Top