This is my requirement
i need to deserialize an object and then i need to do some xml parsing(i know how it sounds)
So here is my code
XmlTextReader myFileReader = new XmlTextReader(path);
XmlSerializer serializer = new XmlSerializer(typeof(MyType));
MyType par = serializer.Deserialize(myFileReader) as MyType;
XElement qListenerParXml = XElement.Load(qListenerPar);
When i try to load the reader again i’m getting exception because the reader cursor is at the end.
My question is how do i return it back to the beginning?
XmlTextReaderis forward-only, you cannot rewind the cursor on the data.You could do this by going over the data again with a new instance of
XmlTextReader, or by loading it as anXmlDocument.