1
Answer

XML bombs out when can't locate element

Thomas Morrison

Thomas Morrison

14y
2.5k
1


Hi, 

I'm using simple XML parsing:


                     XmlTextReader textReader = new XmlTextReader("http://somewhere.com");

                    textReader.Read();textReader.ReadToFollowing("someElement");

Games.Add(textReader.ReadElementContentAsString());


but when it can't find someElement my code bombs out with

The ReadElementContentAsString method is not supported on node type None. 

How do I test when it's exhausted all occurrences of the element. I can't find anything useful


Thanks

Thomas

Answers (1)