2006-12-05 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 5 Dec 2006 11:12:02 +0000 (11:12 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 5 Dec 2006 11:12:02 +0000 (11:12 -0000)
* 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

mcs/class/System.XML/System.Xml/ChangeLog
mcs/class/System.XML/System.Xml/XmlReader.cs
mcs/class/System.XML/Test/System.Xml.XPath/ChangeLog
mcs/class/System.XML/Test/System.Xml.XPath/XPathNavigatorReaderTests.cs

index 2afff057ca9d5a6a9e362d35f19e46a669c97a84..6475fbd2bf2c4932114aef8121e300f2996e7605 100644 (file)
@@ -1,3 +1,8 @@
+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
index 90f6cbe22bcf6aa1721a0afa90558e9b024af693..f8e1d3a3c402eb7466ec993f85daca13b3b322b4 100644 (file)
@@ -487,7 +487,7 @@ namespace System.Xml
                        if (i >= AttributeCount)
                                throw new ArgumentOutOfRangeException ();
                        MoveToFirstAttribute ();
-                       for (int a = 1; a < i; a++)
+                       for (int a = 0; a < i; a++)
                                MoveToNextAttribute ();
                }
 #else
index 0c0cffb1b7cb845c67c1e7b0beee9748dc7ffa79..9826a195d580a4a8478ab0c3f984a9036dd671f5 100644 (file)
@@ -1,3 +1,7 @@
+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
index 2e7d90a4cadb0ed31194ef1ecf66628d445db0d0..33abdfd1825923925eb6b03807f6303956d15f3a 100644 (file)
@@ -664,6 +664,21 @@ namespace MonoTests.System.Xml.XPath
                        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.");
+               }
        }
 }