[Mono-bugs] [Bug 48931][Nor] New - XPath SelectNodes yields incorrect results

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Fri, 26 Sep 2003 05:55:20 -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 alp@atoker.com.

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

--- shadow/48931	2003-09-26 05:55:20.000000000 -0400
+++ shadow/48931.tmp.27942	2003-09-26 05:55:20.000000000 -0400
@@ -0,0 +1,50 @@
+Bug#: 48931
+Product: Mono/Class Libraries
+Version: unspecified
+OS: unknown
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: System.XML
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: alp@atoker.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: XPath SelectNodes yields incorrect results
+
+When SelectNodes/SelectSingleNode is run on a single XmlNode, the query is
+incorrectly run on the entire document.
+
+Expected results (as observed with the MS runtime):
+
+$ ./test.exe 
+<include id="new" />
+
+Incorrect result (as observed with Mono):
+
+$ ./test.exe 
+<include id="original" />
+
+Test case:
+
+using System;
+using System.Xml;
+
+class test
+{
+  static void Main ()
+  {
+    XmlDocument doc = new XmlDocument ();
+    doc.LoadXml ("<foo><include id='original' /></foo>");
+
+    XmlNode node = doc.CreateElement ("child");
+    node.InnerXml = "<include id='new' />";
+
+    XmlNode new_include = node.SelectSingleNode ("//include");
+    Console.WriteLine (new_include.OuterXml);
+  }
+}