[Mono-bugs] [Bug 28840][Nor] Changed - NullReferenceException in SelectNodes

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
12 Aug 2002 14:59:55 -0000


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 jason@379.com.

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

--- shadow/28840	Mon Aug 12 10:56:38 2002
+++ shadow/28840.tmp.10398	Mon Aug 12 10:59:55 2002
@@ -2,13 +2,13 @@
 Product: Mono/Runtime
 Version: unspecified
 OS: All
 OS Details: Red Hat 7.3
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: jason@379.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -36,6 +36,35 @@
 
 
 How often does this happen? 
 
 
 Additional Information:
+
+------- Additional Comments From jason@379.com  2002-08-12 10:59 -------
+I accidentally submitted this before I was ready. The code to
+reproduce the problem follows:
+
+using System;
+using System.Xml;
+
+class Example
+{
+   static string src = "<files><file
+for='linux'>abc</file><file>def</file></files";
+
+   public static void Main()
+   {
+      XmlDocument xml = new XmlDocument();
+      xml.LoadXml(src);
+
+      XmlNodeList files =
+xml.DocumentElement.SelectNodes("/files/file[not(@*)]/text()");
+      foreach (XmlNode f in files)
+         Console.WriteLine(f.Value);
+   }
+}
+
+This code should display:
+abc
+def
+