Fix bug #1558 - return editable XPathNavigator from editable navigator's CreateNaviga...
authorAtsushi Eno <atsushi@ximian.com>
Thu, 19 Jan 2012 11:01:04 +0000 (20:01 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Thu, 19 Jan 2012 11:01:04 +0000 (20:01 +0900)
mcs/class/System.XML/Mono.Xml.XPath/XPathEditableDocument.cs
mcs/class/System.XML/Test/System.Xml.XPath/XPathEditableNavigatorTests.cs

index 3e2f3689373c50c1669decf5754c1e5bec80e53b..1c21cae56243233a0ac587c61787e25b13519841 100644 (file)
@@ -529,7 +529,7 @@ namespace Mono.Xml.XPath
 
                public override XPathNavigator CreateNavigator ()
                {
-                       return navigator.Clone ();
+                       return Clone ();
                }
 
                public XmlNode GetNode ()
index 8e4d4baf5cb0e0c44f21743753489f4ae1b70220..022dfc7c450e84e131f58795d6818f8cce7b3cf2 100644 (file)
@@ -780,6 +780,15 @@ namespace MonoTests.System.Xml.XPath
                        using (XmlWriter w = y.CreateNavigator ().AppendChild ())
                                w.WriteAttributeString ("test", "test1");
                }
+
+               [Test] // bug #1558
+               public void CreateNavigatorReturnsEdidable ()
+               {
+                       var document = new XmlDocument();
+                       document.LoadXml ("<div>hello world</div>");
+                       XPathNavigator navigator = document.CreateNavigator ().CreateNavigator ();
+                       navigator.SelectSingleNode ("//div").SetValue ("hello world 2");
+               }
        }
 }