From f0372f89b019bf494892599a8fad7ad17c0d2178 Mon Sep 17 00:00:00 2001 From: Ajay kumar Dwivedi Date: Sat, 6 Jul 2002 14:08:09 +0000 Subject: 2002-07-06 Ajay kumar Dwivedi * XmlTextWriter: Fixed Indentation. IndentationOverridden should not be set when inside a attribute. svn path=/trunk/mcs/; revision=5618 --- mcs/class/System.XML/System.Xml/ChangeLog | 5 +++++ mcs/class/System.XML/System.Xml/XmlTextWriter.cs | 12 +++++------- 2 files changed, 10 insertions(+), 7 deletions(-) (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 507e63582c6..2e1f47bed1b 100644 --- a/mcs/class/System.XML/System.Xml/ChangeLog +++ b/mcs/class/System.XML/System.Xml/ChangeLog @@ -1,3 +1,8 @@ +2002-07-06 Ajay kumar Dwivedi + + * XmlTextWriter: Fixed Indentation. IndentationOverridden should + not be set when inside a attribute. + 2002-07-06 Ajay kumar Dwivedi * XmlTextWriter: In WriteStartElement, if namespace is null and diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs index 6d8460a5658..44f456d452e 100644 --- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs +++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs @@ -181,7 +181,6 @@ namespace System.Xml if (!openWriter) { throw new InvalidOperationException ("The Writer is closed."); } - if ((documentStarted == true) && (formatting == Formatting.Indented) && (!IndentingOverriden)) { indentFormatting = "\r\n"; if (indentLevel > 0) { @@ -350,13 +349,11 @@ namespace System.Xml throw new InvalidOperationException("There was no XML start tag open."); indentLevel--; - CheckState (); if (openStartElement) { if (openAttribute) WriteEndAttribute (); - if (fullEndElement) w.Write (">", ((XmlTextWriterOpenElement)openElements.Peek ()).Name); else @@ -523,7 +520,7 @@ namespace System.Xml CheckState (); CloseStartElement (); - + string formatXmlns = ""; string formatPrefix = ""; @@ -549,6 +546,7 @@ namespace System.Xml formatPrefix = prefix + ":"; } } + w.Write ("{0}<{1}{2}{3}", indentFormatting, formatPrefix, localName, formatXmlns); openElements.Push (new XmlTextWriterOpenElement (formatPrefix + localName)); @@ -596,8 +594,10 @@ namespace System.Xml } if (!openAttribute) + { + IndentingOverriden = true; CloseStartElement (); - + } if (!openXmlLang && !openXmlSpace) w.Write (text); else @@ -620,8 +620,6 @@ namespace System.Xml } } } - - IndentingOverriden = true; } [MonoTODO] -- cgit v1.2.3