RE: [xml] python xmlReader remains in previous attribute

Hmm... now I'm a bit confused.  I was just in the midst of debugging
the problem (which is within the library itself, and not just a
python interface problem) when Stéphane's post arrived.  I have read
the data from the posted link (which describes how to use the
MoveToElement method), but I can't see from there why the Read
method should *not* return the proper node name.  Could someone
elaborate whether Read should return the proper name, or not?

I did the test... and my memory proved wrong.
The following C# code does work with or without MoveToElement:

        string s = "<test><e1 a1='a1' a2='a2'/><e2/></test>";
        XmlTextReader reader = new XmlTextReader(new StringReader(s));
                if (reader.HasAttributes)
                                Console.WriteLine(" {0}={1}", reader.Name, reader.Value);

So yes, after moving to the last attribute,
the next Read should move to the next node.
Sorry for the confusion.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]