[Mono-bugs] [Bug 58247][Min] New - System.Xml.XmlTextWriter.WriteComment method not outputting to a new line

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 9 May 2004 10:06:56 -0400 (EDT)


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 richard_a_franco@hotmail.com.

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

--- shadow/58247	2004-05-09 10:06:56.000000000 -0400
+++ shadow/58247.tmp.22796	2004-05-09 10:06:56.000000000 -0400
@@ -0,0 +1,97 @@
+Bug#: 58247
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: Fedora Core 2 Test 3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: richard_a_franco@hotmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: System.Xml.XmlTextWriter.WriteComment method not outputting to a new line
+
+Description of Problem:
+
+When using System.Xml.XmlTextWriter.WriteComment method the comment is
+appended to the end of previous line instead of a new line.  
+
+This is inconsistant with MS .Net Framework 1.1 where comment is written to
+a new line.
+
+Steps to reproduce the problem:
+
+1. create a new c# source file called Main.cs file containing the following:
+
+// CODE START
+using System;
+using System.Xml;
+
+class MainClass
+{
+  public static void Main(string[] args)
+  {
+    XmlTextWriter writer = new XmlTextWriter("test.xml", 
+      System.Text.Encoding.UTF8);
+
+
+    writer.Formatting = Formatting.Indented;
+
+
+    writer.WriteStartDocument();
+
+    writer.WriteComment("my comment");
+
+
+    writer.WriteStartElement("list");
+
+    writer.WriteStartElement("item");
+    writer.WriteAttributeString("valueA", "first value row 0");
+    writer.WriteAttributeString("valueB", "second value row 0");
+    writer.WriteEndElement(); 
+
+    writer.WriteStartElement("item");
+    writer.WriteAttributeString("valueA", "first value row 1");
+    writer.WriteAttributeString("valueB", "second value row 1");
+    writer.WriteEndElement(); 
+		
+    writer.WriteEndElement();
+
+    writer.WriteEndDocument();
+
+    writer.Flush();
+
+    writer.Close();
+
+  }
+}
+// CODE END
+
+2. compile using: mcs /target:exe /out:XmlTextWriterCommentBug.exe
+/r:System.Xml Main.cs
+
+3. run using: mono XmlTextWriterCommentBug.exe
+
+4. look inside test.xml file created in same directory as exe and you'll
+see the following:
+
+<?xml version="1.0" encoding="utf-8"?><!--my comment-->
+<list>
+  <item valueA="first value row 0" valueB="second value row 0" />
+  <item valueA="first value row 1" valueB="second value row 1" />
+</list>
+
+
+Actual Results: xml comment appended to previous line
+
+Expected Results: xml comment on a new line
+
+How often does this happen? all the time regardless of when WriteComment is
+called.
+
+Additional Information: Using Mono Beta 1.