Groups | Blog | Home
all groups > dotnet xml > july 2004 >

dotnet xml : a XMLException


Mystique
7/13/2004 10:11:57 PM
I'm reading elements from a XML file, and when i get to
anElement.Name = aReader.ReadElementString();

when i'm debugging i get the exception:

'EndElement' is an invalid nod type. Line 4, position 31.

and when i'm not debugging i get (just start without debugging):

'None' is an invalid node type. Line 98, position 16.

I hope someone has an answer why i get an exception and why they are
different

thanks







Oleg Tkachenko [MVP]
7/14/2004 11:55:14 AM
[quoted text, click to view]

Well, with no any idea about your XML, code and full exception info
I doubt we can help you. Most likely you are using ReadElementString()
method in a wrong way.
And about the difference between debugging and not - XmlReader as
forward-only reader is a bit fragile WRT debugging, e.g. imagine
reader.ReadElementString() expression in Watch window - it can spoil
your processing by moving reader further.

--
Oleg Tkachenko [XML MVP]
AddThis Social Bookmark Button