[Mono-bugs] [Bug 676020] ReadToNextSibling does not move as expected

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 7 09:37:53 EST 2011


https://bugzilla.novell.com/show_bug.cgi?id=676020

https://bugzilla.novell.com/show_bug.cgi?id=676020#c2


--- Comment #2 from Federico Delgado <flaker.kapper at gmail.com> 2011-03-07 14:37:52 UTC ---
Sorry I mixed up bug reports. Bellow is a test code for a console app.

    class Program
    {
        static void Main(string[] args)
        {
            string data = @"<SerializableStringDictionary>
<SerializableStringDictionary>
<DictionaryEntry Key=""Key1"" Value=""Value1""/>
<DictionaryEntry Key=""Key2"" Value=""Value2""/>
<DictionaryEntry Key=""Key3"" Value=""Value3""/>
</SerializableStringDictionary>
</SerializableStringDictionary>";

            using (StringReader st = new StringReader(data))
            {
                XmlReader xrd = XmlReader.Create(st);
                ReadXml(xrd);
            }

            Console.ReadLine();
        }

        public static void ReadXml(XmlReader reader)
        {
            if (!reader.ReadToDescendant("SerializableStringDictionary"))
            {
                return;
            }

            if (!reader.ReadToDescendant("DictionaryEntry"))
            {
                return;
            }

            do
            {
                reader.MoveToAttribute("Key");
                var key = reader.ReadContentAsString();
                reader.MoveToAttribute("Value");
                var value = reader.ReadContentAsString();
                Console.WriteLine(string.Format("Key: {0} Value {1}", key,
value));
            }
            while (reader.ReadToNextSibling("DictionaryEntry"));
        }
    }



(In reply to comment #1)
> You have attached wrong repro project. I grepped the entire project and found
> no call to MoveToNextSibling() or even "using System.Xml".

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list