Dear friends,
I am writing a function that creates an xml document named doc which will be consumed by another function. When I write the content of the XML file created (named doc) to a file using
<pre>XmlDocument doc = new XmlDocument();
..........
..........
..........
XmlTextWriter wrtr = new XmlTextWriter("\\doc.xml",Encoding.Unicode);
doc.WriteTo(wrtr);
wrtr.Close();</pre>
it works perfect. But instead of writing the XML document to a file I want to convert its content to string and pass it directly to the consuming function, so I used
<pre> .............
.............
StringWriter sw = new StringWriter();
XmlTextWriter xw = new XmlTextWriter(sw);
doc.WriteTo(xw);
return sw.ToString();</pre>
in this case the output string will contain only 1024 characters (including space) and as a result it will cut some of its contents. What do you suggest to solve it, Thanks!