0
Answer

Reading XML with XmlTextReader.ReadElementString

mark 0

mark 0

20y
4.8k
1
Hello, I am reading some xml data, using an XmlTextReader. I am able to position the XmlTextReader on the node I want (the parent to a data element), and then can read the data element using ReadElementString(). So far so good. But ReadElementString is also supposed to allow you to specify the name of the element you are reading, presumably for verification purposes, like this: ReadElementString("dataelement"). If I try that form, I get an exception saying "System Error", but only sometimes. In some cases this form will succeed. Do any of you use this method to read data from an xml file? Can you think why the second form is not working? Thanks.