From 6ae048fcc3c2758df9b08970515ee848aaaa168b Mon Sep 17 00:00:00 2001 From: Tim Coleman Date: Fri, 26 Jul 2002 17:29:39 +0000 Subject: 2002-07-26 Tim Coleman * XmlTextWriter.cs: When given a textwriter, check to see if it has a null encoding. This was being done for other inputs than a textwriter. svn path=/trunk/mcs/; revision=6199 --- mcs/class/System.XML/System.Xml/ChangeLog | 5 +++++ mcs/class/System.XML/System.Xml/XmlTextWriter.cs | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'mcs/class/System.XML/System.Xml') diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog index eefc584c3e4..b54c25751b5 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,8 @@ +2002-07-26 Tim Coleman + * XmlTextWriter.cs: + When given a textwriter, check to see if it has a + null encoding. This was being done for other inputs + than a textwriter. Wed Jul 24 13:16:19 CEST 2002 Paolo Molaro diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs index 44f456d452e..73acae256e2 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs @@ -48,6 +48,7 @@ namespace System.Xml public XmlTextWriter (TextWriter w) : base () { this.w = w; + nullEncoding = (w.Encoding == null); try { baseStream = ((StreamWriter)w).BaseStream; @@ -494,7 +495,7 @@ namespace System.Xml string encodingFormatting = ""; - if (!nullEncoding) + if (!nullEncoding) encodingFormatting = String.Format (" encoding={0}{1}{0}", quoteChar, w.Encoding.HeaderName); w.Write("", quoteChar, encodingFormatting, standaloneFormatting); @@ -548,6 +549,7 @@ namespace System.Xml } w.Write ("{0}<{1}{2}{3}", indentFormatting, formatPrefix, localName, formatXmlns); + openElements.Push (new XmlTextWriterOpenElement (formatPrefix + localName)); ws = WriteState.Element; -- cgit v1.2.3