[Mono-bugs] [Bug 57248][Wis] New - NullReferenceException in XmlNode.SelectNodes()

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 20 Apr 2004 02:21:52 -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 mono-bug@jerryweb.info.

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

--- shadow/57248	2004-04-20 02:21:52.000000000 -0400
+++ shadow/57248.tmp.10348	2004-04-20 02:21:52.000000000 -0400
@@ -0,0 +1,59 @@
+Bug#: 57248
+Product: Mono: Class Libraries
+Version: unspecified
+OS: GNU/Linux [Other]
+OS Details: Gentoo
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Sys.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: mono-bug@jerryweb.info               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: NullReferenceException in XmlNode.SelectNodes()
+
+NullReferenceException in XmlNode.SelectNodes()
+
+Steps to reproduce the problem:
+Compile and run the following code:
+===============================================================
+using System;
+using System.Xml;
+
+namespace Test {
+   class TestClass {
+      static void Main() {
+         XmlDocument doc = new XmlDocument();
+         XmlElement el;
+         doc.AppendChild(doc.CreateElement("html"));
+         doc.DocumentElement.AppendChild(el = doc.CreateElement("head"));
+         el.AppendChild(doc.CreateElement("title"));
+         doc.DocumentElement.AppendChild(el = doc.CreateElement("body"));
+         el.AppendChild(el = doc.CreateElement("p"));
+         el.AppendChild(doc.CreateEntityReference("nbsp"));
+         Console.WriteLine(doc.InnerXml);
+         doc.SelectNodes("/html/body//img");
+      }
+   }
+}
+===============================================================
+
+Actual Results:
+<html><head><title /></head><body><p>&nbsp;</p></body></html>
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x0003e> System.Xml.XmlDocumentNavigator:MoveToNext ()
+in <0x000e0> System.Xml.XPath.DescendantOrSelfIterator:MoveNext ()
+in <0x0008d> System.Xml.XPath.AxisIterator:MoveNext ()
+in <0x003c9> System.Xml.XPath.SlashIterator:MoveNext ()
+in <0x00378> System.Xml.XPath.SlashIterator:MoveNext ()
+in <0x003c9> System.Xml.XPath.SlashIterator:MoveNext ()
+in <0x000fe> System.Xml.XmlNode:SelectNodes
+(string,System.Xml.XmlNamespaceManager)
+in <0x00017> System.Xml.XmlNode:SelectNodes (string)
+in <0x001a2> Test.TestClass:Main ()