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:
authorAjay kumar Dwivedi <ajay@mono-cvs.ximian.com>2002-07-06 18:08:09 +0400
committerAjay kumar Dwivedi <ajay@mono-cvs.ximian.com>2002-07-06 18:08:09 +0400
commitf0372f89b019bf494892599a8fad7ad17c0d2178 (patch)
tree54925a8728aabb275162b04e746793cad1860f09 /mcs/class/System.XML/System.Xml
parentdf14556dc19030ff96f3caef7e333f5acecf556d (diff)
2002-07-06 Ajay kumar Dwivedi <adwiv@yahoo.com>
* XmlTextWriter: Fixed Indentation. IndentationOverridden should not be set when inside a attribute. svn path=/trunk/mcs/; revision=5618
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.cs12
2 files changed, 10 insertions, 7 deletions
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,5 +1,10 @@
2002-07-06 Ajay kumar Dwivedi <adwiv@yahoo.com>
+ * XmlTextWriter: Fixed Indentation. IndentationOverridden should
+ not be set when inside a attribute.
+
+2002-07-06 Ajay kumar Dwivedi <adwiv@yahoo.com>
+
* XmlTextWriter: In WriteStartElement, if namespace is null and
prefix is null|empty do not write out xmlns=""
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 ("></{0}>", ((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]