[Mono-bugs] [Bug 55828][Nor] New - XmlTextWriter outputs extra linefeed characters

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 19 Mar 2004 18:02:43 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by gert.driesen@pandora.be.

http://bugzilla.ximian.com/show_bug.cgi?id=55828

--- shadow/55828	2004-03-19 18:02:43.000000000 -0500
+++ shadow/55828.tmp.13998	2004-03-19 18:02:43.000000000 -0500
@@ -0,0 +1,48 @@
+Bug#: 55828
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: gert.driesen@pandora.be               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlTextWriter outputs extra linefeed characters
+
+In Mono/cvs the XmlTextWriter outputs extra linefeeds characters when
+formatting is set to Formatting.Indented.
+
+The following code snippet :
+
+StringWriter sw = new StringWriter();
+XmlTextWriter writer = new XmlTextWriter(sw);
+writer.Formatting = Formatting.Indented;
+                                                                          
+     writer.WriteStartElement("message");
+writer.WriteCData("test");
+writer.WriteEndElement();
+writer.Flush();
+                                                                          
+     Console.WriteLine(sw.ToString());
+
+will result in :
+
+<message><![CDATA[test]]>
+</message>
+
+while this should ofcourse be :
+
+<message><![CDATA[test]]></message>
+
+(no linefeed before the closing tag of the message element)
+
+This issue is causing several NAnt unit tests to fail on Mono.
+
+I attached a repro for this issue.