MAF wrote:
Is there a simple way to get the text, xml, from an xmlwriter.
I have a XML writer that writes to a file, and I want another function to
return the text that the xml writer is produced.
Use an XmlWriter over a StringWriter e.g.
StringWriter stringWriter = new StringWriter();
using (XmlWriter xmlWriter = XmlWriter.Create(stringWriter)) {
xmlWriter.WriteStartDocument();
xmlWriter.WriteStartElement("root");
xmlWriter.WriteElementString("element", "Kibo");
xmlWriter.WriteEndDocument();
}
string xml = stringWriter.ToString();
StringWriter is in System.IO.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/