From 2ad8710e190b7543989cdb96a5268d21d2b5cefb Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 18 May 2009 09:34:30 +0000 Subject: fixing XmlWriter problem --- OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs') diff --git a/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs b/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs index da37647..9a1047c 100644 --- a/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs +++ b/OpenSim/ApplicationPlugins/Rest/RestXmlWriter.cs @@ -33,6 +33,14 @@ namespace OpenSim.ApplicationPlugins.Rest { public class RestXmlWriter: XmlTextWriter { + private StringWriter m_sw = null; + + public RestXmlWriter(StringWriter sw) : base(sw) + { + m_sw = sw; + Formatting = Formatting.Indented; + } + public RestXmlWriter(TextWriter textWriter) : base(textWriter) { } @@ -52,5 +60,13 @@ namespace OpenSim.ApplicationPlugins.Rest public override void WriteStartDocument(bool standalone) { } + + public override string ToString() + { + WriteEndElement(); + Flush(); + Close(); + return m_sw.ToString(); + } } } -- cgit v1.1