[Mono-bugs] [Bug 79420][Wis] New - XmlElement should not throw exception if constructed with null prefix
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Sep 17 02:51:08 EDT 2006
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 eric at extremeboredom.net.
http://bugzilla.ximian.com/show_bug.cgi?id=79420
--- shadow/79420 2006-09-17 02:51:08.000000000 -0400
+++ shadow/79420.tmp.14160 2006-09-17 02:51:08.000000000 -0400
@@ -0,0 +1,61 @@
+Bug#: 79420
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: atsushi at ximian.com
+ReportedBy: eric at extremeboredom.net
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: XmlElement should not throw exception if constructed with null prefix
+
+The following code throws an exception when run with mono, but not when run
+under Microsoft.NET 2.0 (Windows XP):
+
+-- begin code --
+
+using System;
+using System.Xml;
+
+public class XmlBugTest
+{
+ public static void Main ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ XmlQualifiedName name = new XmlQualifiedName ("Foo");
+ SadXmlElement e = new SadXmlElement (name, doc);
+ }
+}
+
+public class SadXmlElement : XmlElement
+{
+ // If you change the 'null' below to 'String.Empty', this works
+ public SadXmlElement (XmlQualifiedName qname, XmlDocument doc) : base
+(null, qname.Name, qname.Namespace, doc)
+ {
+ }
+}
+
+-- end code --
+
+
+The Exception thrown is:
+
+Unhandled Exception: System.ArgumentNullException: Argument cannot be null.
+Parameter name: key
+ at System.Xml.NameTable.Add (System.String key) [0x00000]
+ at System.Xml.XmlElement..ctor (System.String prefix, System.String
+localName, System.String namespaceURI, System.Xml.XmlDocument doc, Boolean
+atomizedNames) [0x00000]
+ at System.Xml.XmlElement..ctor (System.String prefix, System.String
+localName, System.String namespaceURI, System.Xml.XmlDocument doc) [0x00000]
+ at SadXmlElement..ctor (System.Xml.XmlQualifiedName qname,
+System.Xml.XmlDocument doc) [0x00000]
+ at XmlBugTest.Main () [0x00000]
More information about the mono-bugs
mailing list