[Mono-bugs] [Bug 77927][Wis] Changed - XmlTextReader: ReadOuterXml leaves reader at wrong position

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Mar 26 18:04:34 EST 2006


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 rodolfo.campero at gmail.com.

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

--- shadow/77927	2006-03-26 17:59:08.000000000 -0500
+++ shadow/77927.tmp.27637	2006-03-26 18:04:34.000000000 -0500
@@ -91,6 +91,29 @@
 
 
 ------- Additional Comments From atsushi at ximian.com  2006-03-26 17:59 -------
 hehe, as we talked on IRC, the next node processed by
 XmlReader.ReadOuterXml() on the first "element" element is a
 whitespace, not the second "element" element ;-)
+
+------- Additional Comments From rodolfo.campero at gmail.com  2006-03-26 18:04 -------
+This is the "fixed" sample code, which works as expected:
+
+using System;
+using System.Xml;
+
+class TestClass
+{
+        static void Main(string[] args)
+        {
+                XmlReader reader = new XmlTextReader("testreader.xml");
+                while(reader.LocalName != "element") reader.Read();
+                Console.WriteLine(reader.ReadOuterXml());
+                reader.MoveToContent();
+                bool ok = reader.LocalName == "element" &&
+reader.GetAttribute("order") == "2";
+                Console.WriteLine( ok ? "OK" : "FAILED" );
+        }
+}
+
+Thanks Atsushi for your help.
+


More information about the mono-bugs mailing list