T
TPS
I need to go from an XMLTextWriter to a string!
I am using the XmlTextWriter class to build an xml document. I need the
ultimate
output to go to a string, so am using the MemoryStream class as the
underlying
stream for the writer. I can't figure out how to get the contents of the
MemoryStream into a string when I am finished. I attempted to use the
StreamReader object, but that got me an empty string. All the documentation
shows how to go to a byte array, and I suppose I could go from there, but
that
seems like a roundabout way to do what I would think would be a common task.
What do I need to do, or how does everyone else approach this?
Thanks
TPS
I am using the XmlTextWriter class to build an xml document. I need the
ultimate
output to go to a string, so am using the MemoryStream class as the
underlying
stream for the writer. I can't figure out how to get the contents of the
MemoryStream into a string when I am finished. I attempted to use the
StreamReader object, but that got me an empty string. All the documentation
shows how to go to a byte array, and I suppose I could go from there, but
that
seems like a roundabout way to do what I would think would be a common task.
What do I need to do, or how does everyone else approach this?
Thanks
TPS