I have a problem with Xml and Serialization.
I use serialization to get Xml as a result. All
Serialization examples in Microsoft documentation writes
the result to a file.
I don't want a file, I want an XML-object (XmlNode)
instead that I can pass as a parameter to another method.
How can I do that?
Example code:
XmlSerializer mySerializer = new XmlSerializer(t ypeof
(myClass));
TextWriter myWriter = new StreamWriter(@" C:\myfile.xml") ;
mySerializer.Se rialize(myXmlWr iter, myNode);
myWriter.Close( );
I use serialization to get Xml as a result. All
Serialization examples in Microsoft documentation writes
the result to a file.
I don't want a file, I want an XML-object (XmlNode)
instead that I can pass as a parameter to another method.
How can I do that?
Example code:
XmlSerializer mySerializer = new XmlSerializer(t ypeof
(myClass));
TextWriter myWriter = new StreamWriter(@" C:\myfile.xml") ;
mySerializer.Se rialize(myXmlWr iter, myNode);
myWriter.Close( );
Comment