+2008-02-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XPathNavigator.cs : in some MoveTo*() methods, it should allow any
+ destination node when "type" is XPathNodeType.All. Based on the
+ patch by Sanghyeon Seo, fixed bug #365112.
+
2008-02-12 Atsushi Enomoto <atsushi@ximian.com>
* DefaultContext.cs : now number formatting for "R" works fine, so
{
XPathNavigator nav = Clone ();
while (nav.MoveToNext ()) {
- if (nav.NodeType == type) {
+ if (type == XPathNodeType.All || nav.NodeType == type) {
MoveTo (nav);
return true;
}
}
if (end != null && end.IsSamePosition (nav))
return false;
- if (nav.NodeType == type) {
+ if (type == XPathNodeType.All || nav.NodeType == type) {
MoveTo (nav);
return true;
}
+2008-02-27 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XPathNavigatorTests.cs : added test for bug #365112.
+
2007-11-29 Atsushi Enomoto <atsushi@ximian.com>
* XPathNavigatorTests.cs : added ValueAs() test.
AssertEquals ("1", nav.ValueAs (typeof (string), null));
AssertEquals (1, nav.ValueAs (typeof (int), null));
}
+
+ [Test]
+ public void MoveToFollowingNodeTypeAll ()
+ {
+ XmlDocument doc = new XmlDocument ();
+ doc.LoadXml ("<root><child/><child2/></root>");
+ XPathNavigator nav = doc.CreateNavigator ();
+ Assert ("#1", nav.MoveToFollowing (XPathNodeType.All));
+ Assert ("#2", nav.MoveToFollowing (XPathNodeType.All));
+ AssertEquals ("#3", "child", nav.LocalName);
+ Assert ("#4", nav.MoveToNext (XPathNodeType.All));
+ AssertEquals ("#5", "child2", nav.LocalName);
+ }
#endif
}
}