XmlTextReader - start reading at a certain linenumber possible??

MAGIEL1234

New member
Joined
Dec 15, 2007
Messages
1
Programming Experience
5-10
While parsing a xml file, once an error is encountered, the ReadState of the XmlTextReader is set to Error and no more processing on the document can be performed.
I am handling the exeption, but subsequently I would like to (re)start processing again at the following LineNumber for example. (Skipping the line containing the fault which caused the ReadState to go in Error)
Settings.LineNumberOffset only works with XmlReader. I hope somebody can tell me how to start reading at a certain linenumber while using the XmlTextReader. Any alternative would also be welcome.
 
This might not be the best approach, but try this.

If you create a variable and you assign the last element you read to it, then if you crash you can reader.readtoelement(elementname) to the element right after your crash.
 
Back
Top