[Mono-bugs] [Bug 46129][Nor] New - XmlNode CloneNode method removes attributes

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Thu, 10 Jul 2003 21:43:24 -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 erik.pukinskis@uconn.edu.

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

--- shadow/46129	Thu Jul 10 21:43:24 2003
+++ shadow/46129.tmp.13425	Thu Jul 10 21:43:24 2003
@@ -0,0 +1,46 @@
+Bug#: 46129
+Product: Mono/Class Libraries
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: erik.pukinskis@uconn.edu               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XmlNode CloneNode method removes attributes
+
+Using mono-0.24-1 from RPM
+
+Description of Problem:
+
+System.Xml.XmlNode.CloneNode(bool deep) seems to drop the attributes of the
+node you are cloning, but <a
+href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxmlnodeclassclonenodetopic.asp>this
+is incorrect behavior</a>.
+
+Example code:
+
+	XmlDocument doc = new XmlDocument();
+	XmlElement element = doc.CreateElement("foo");
+	element.SetAttribute("something", "true");
+	XmlNode element2 = element.CloneNode(true);
+	doc.AppendChild(element);
+	doc.AppendChild(element2);
+	doc.Save(Console.Out);
+
+Expected Output:
+
+	<foo something="true" />
+	<foo something="true" />
+
+Actual Output:
+
+	<foo something="true" />
+	<foo />