Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Coleman <tim@mono-cvs.ximian.com>2002-07-26 21:29:39 +0400
committerTim Coleman <tim@mono-cvs.ximian.com>2002-07-26 21:29:39 +0400
commit6ae048fcc3c2758df9b08970515ee848aaaa168b (patch)
tree8f92117b8305e10a2ea3feb179b45136d57b0471 /mcs/class/System.XML/System.Xml
parent6728c63ca2c66cf6e0e0b3ed1645c9ec2bdc6a4c (diff)
2002-07-26 Tim Coleman <tim@timcoleman.com>
* 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
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextWriter.cs4
2 files changed, 8 insertions, 1 deletions
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 <tim@timcoleman.com>
+ * 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 <lupus@ximian.com>
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("<?xml version={0}1.0{0}{1}{2}?>", 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;