Discussion Forum > Xml parsing in .Net Micro Framework SDK V2.5 Beta



hi everyone!

I try to parse a string containing xml in the .Net Micro Framework SDK V2.5 Beta and I am getting
a 'System.NullReferenceException' exception. the code goes as folows :

byte[] data = System.Text.UTF8Encoding.UTF8.GetBytes("<?xml version=\"1.0\" ....... </rss>"); //just an xml fragment
MemoryStream strm = new MemoryStream(data);
XmlTextReader xml = new XmlTextReader(strm);
while (xml.Read())
{
if (xml.NodeType == XmlNodeType.Element && xml.Name == "title")
Debug.Print(xml.ReadElementString());
}

the same code work perfecty in the .Net 2.0 framework (place Console.Writeline instead of Debug.Print)
any ideas?

thanks !!
January 27, 2008 | Unregistered Commentergeorgios