* XmlReader.cs : new 2.0 MoveToAttribute(int) failed to move to the
final attribute in an element.
* XPathNavigatorReaderTests.cs : added test for MoveToAttribute(int).
svn path=/trunk/mcs/; revision=69026
+2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlReader.cs : new 2.0 MoveToAttribute(int) failed to move to the
+ final attribute in an element.
+
2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
* XmlNode.cs : GetPrefixOfNamespace() was not correctly searching
if (i >= AttributeCount)
throw new ArgumentOutOfRangeException ();
MoveToFirstAttribute ();
- for (int a = 1; a < i; a++)
+ for (int a = 0; a < i; a++)
MoveToNextAttribute ();
}
#else
+2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XPathNavigatorReaderTests.cs : added test for MoveToAttribute(int).
+
2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
* XPathNavigatorTests.cs : added test for XPath navigator editor's
nav.MoveToFirstChild ();
nav.ReadSubtree ();
}
+
+ [Test]
+ public void ReadSubtreeAttributesByIndex ()
+ {
+ XmlWriter xw;
+ XmlDocument doc = new XmlDocument ();
+ doc.LoadXml ("<u:Timestamp u:Id='ID1' xmlns:u='urn:foo'></u:Timestamp>");
+ XmlReader r = doc.CreateNavigator ().ReadSubtree ();
+ r.Read ();
+ r.MoveToAttribute (0);
+ if (r.LocalName != "Id")
+ r.MoveToAttribute (1);
+ if (r.LocalName != "Id")
+ Assert.Fail ("Should move to the attribute.");
+ }
}
}