[Mono-bugs] [Bug 53073][Nor] New - XmlDocument allows multiple document elements.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 19 Jan 2004 18:08:38 -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 dave-mono@earth.li.

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

--- shadow/53073	2004-01-19 18:08:38.000000000 -0500
+++ shadow/53073.tmp.11045	2004-01-19 18:08:38.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 53073
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: dave-mono@earth.li               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlDocument allows multiple document elements.
+
+Description of Problem:
+
+You can add multiple elements directly under the XmlDocument. This is not
+valid, as you are only allowed a single document element.
+
+Steps to reproduce the problem:
+ 
+using System;                                                             
+     
+using System.Xml;                                                         
+     
+                                                                          
+     
+namespace p { 
+ public class m {                                                             
+                                                                          
+        public static void Main (string [] args) {       
+     XmlDocument x = new XmlDocument ();                                    
+     XmlElement a = x.CreateElement ("a");                                  
+     XmlElement b = x.CreateElement ("b");  
+     x.AppendChild (a);                                                     
+     x.AppendChild (b);
+    }
+  }
+}
+
+Actual Results:
+
+Nothing
+
+Expected Results:
+
+System.InvalidOperationException: This document already has a
+DocumentElement node.