[Mono-bugs] [Bug 41976][Nor] New - XPath fails when the node to match is called "namespace"

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Sat, 26 Apr 2003 23:58:23 -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 miguel@ximian.com.

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

--- shadow/41976	Sat Apr 26 23:58:23 2003
+++ shadow/41976.tmp.31354	Sat Apr 26 23:58:23 2003
@@ -0,0 +1,55 @@
+Bug#: 41976
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XPath fails when the node to match is called "namespace"
+
+The following program makes the parser crash:
+
+using System;
+using System.Xml;
+using System.Xml.XPath;
+
+class X {
+	static void Main (string [] args)
+	{
+		XmlDocument doc = new XmlDocument ();
+		doc.Load (args [0]);
+		
+		XmlNamespaceManager nsm = new XmlNamespaceManager (doc.NameTable);
+		nsm.AddNamespace ("mono", "http://www.go-mono.com/ladeda" );
+
+		foreach(XmlNode n in doc.SelectNodes("mono:namespace", nsm)){
+			Console.WriteLine ("Root: " + n.Name);
+		}
+
+	}
+}
+
+
+Use the following input:
+
+<?xml version="1.0" encoding="utf-8" ?> 
+<mono xmlns="http://www.go-mono.com/ladeda">
+    <namespaces>
+      <namespace>name</namespace>
+    </namespaces>
+</mono>
+
+And compile and run like this:
+csc test.cs
+mono test.exe test.xml
+
+The problem seems to be with the word "namespace"